diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 6b64c5b0..00000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -@cerc-io:registry=https://git.vdb.to/api/packages/cerc-io/npm/ diff --git a/lerna.json b/lerna.json index ca39c121..f80d25d7 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", "useWorkspaces": true, - "version": "0.1.15" + "version": "0.2.7" } diff --git a/package.json b/package.json index 2181e93d..11bd180b 100644 --- a/package.json +++ b/package.json @@ -16,16 +16,16 @@ }, "scripts": { "lint": "lerna run lint --stream --parallel", - "build:browser": "TARGET=browser lerna run build --stream --ignore @cerc-io/server", - "build:node": "TARGET=node lerna run build --stream --ignore @cerc-io/example-web-app", - "test:browser": "lerna run test --stream --parallel --ignore @cerc-io/server", - "test:node": "lerna run test --stream --parallel --ignore @cerc-io/example-web-app", + "build:browser": "TARGET=browser lerna run build --stream --ignore @cerc-nitro/server", + "build:node": "TARGET=node lerna run build --stream --ignore @cerc-nitro/example-web-app", + "test:browser": "lerna run test --stream --parallel --ignore @cerc-nitro/server", + "test:node": "lerna run test --stream --parallel --ignore @cerc-nitro/example-web-app", "prepare": "husky install", "chain": "lerna run chain --scope=@cerc-io/server", - "test:deploy-contracts": "lerna run test:deploy-contracts --scope=@cerc-io/nitro-node", - "test:copy-addresses": "lerna run test:copy-addresses --scope=@cerc-io/nitro-node", - "build:contracts": "lerna run build:contracts --scope=@cerc-io/nitro-util", - "test:deploy-token": "lerna run test:deploy-token --scope=@cerc-io/nitro-util", + "test:deploy-contracts": "lerna run test:deploy-contracts --scope=@cerc-nitro/nitro-node", + "test:copy-addresses": "lerna run test:copy-addresses --scope=@cerc-nitro/nitro-node", + "build:contracts": "lerna run build:contracts --scope=@cerc-nitro/nitro-util", + "test:deploy-token": "lerna run test:deploy-token --scope=@cerc-nitro/nitro-util", "version:set": "lerna version --no-git-tag-version" } } diff --git a/packages/example-web-app/.env b/packages/example-web-app/.env index e91e6471..67438c66 100644 --- a/packages/example-web-app/.env +++ b/packages/example-web-app/.env @@ -1,2 +1,6 @@ -REACT_APP_RELAY_MULTIADDR= -REACT_APP_ASSET_ADDRESS= +REACT_APP_RPC_URL= +REACT_APP_TARGET_URL= +REACT_APP_NITRO_PK= +REACT_APP_NA_ADDRESS= +REACT_APP_VPA_ADDRESS= +REACT_APP_CA_ADDRESS= diff --git a/packages/example-web-app/package.json b/packages/example-web-app/package.json index 0923983b..7c3dac1d 100644 --- a/packages/example-web-app/package.json +++ b/packages/example-web-app/package.json @@ -1,9 +1,9 @@ { - "name": "@cerc-io/example-web-app", - "version": "0.1.15", + "name": "@cerc-nitro/example-web-app", + "version": "0.2.7", "private": true, "dependencies": { - "@cerc-io/nitro-node": "^0.1.15", + "@cerc-nitro/nitro-node": "^0.2.7", "@libp2p/crypto": "^1.0.4", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", diff --git a/packages/example-web-app/src/App.css b/packages/example-web-app/src/App.css index 74b5e053..a9345119 100644 --- a/packages/example-web-app/src/App.css +++ b/packages/example-web-app/src/App.css @@ -1,38 +1,103 @@ -.App { - text-align: center; +html { + margin: 0 auto; + padding: 2rem; + font-family: "Roboto", sans-serif; + background-color: #eeeff2; } -.App-logo { - height: 40vmin; - pointer-events: none; +#root { + background-color: #eeeff2; } -@media (prefers-reduced-motion: no-preference) { - .App-logo { - animation: App-logo-spin infinite 20s linear; - } +#top-group { + background-color: white; + border-radius: 3px; + border: 3px solid #04AA6D; + padding: 0.7em; } -.App-header { - background-color: #282c34; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); +#mid-group { + margin-top: 2em; + background-color: white; + border-radius: 3px; + border: 3px solid #04AADD; + padding: .7em; +} + +textarea { + width: 100%; + height: 20em; +} + +h2 { + margin-top: 0; + margin-bottom: 0.2em; +} + +ul { + list-style: none; +} + +.info-line { + padding: .2em; +} + +input { + border: 0; + font-size: 15px; + font-weight: 400; + letter-spacing: 1px; +} + +button { + border: none; + border-radius: 3px; + position: relative; + padding: 0.75em; + margin: 10px 1px; + font-size: 12px; + font-weight: 400; + text-transform: uppercase; + letter-spacing: 0; + will-change: box-shadow, transform; + transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), + background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 0.4s; + background-color: #04AADD; /* Green */ + color: white; +} + +button:disabled { + background-color: #DDD; /* Green */ + color: white; +} + +button:hover { + background-color: #f8881e; /* Green */ + color: white; +} + +button:hover:disabled { + background-color: #DDD; /* Green */ + color: white; +} + +.empty { + background-color: #ec3535; /* Green */ color: white; } -.App-link { - color: #61dafb; +.key { + padding-left: 1em; + font-size: 12px; + font-weight: 400; + text-transform: uppercase; + letter-spacing: 0; } -@keyframes App-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } +.value { + padding-left: 2em; + font-size: 15px; + font-weight: 400; + letter-spacing: 1px; } diff --git a/packages/example-web-app/src/App.tsx b/packages/example-web-app/src/App.tsx index 09baa138..3d17899c 100644 --- a/packages/example-web-app/src/App.tsx +++ b/packages/example-web-app/src/App.tsx @@ -1,50 +1,36 @@ -import React, { useEffect } from 'react'; -import assert from 'assert'; +import { useEffect, useState } from 'react'; +import { + utils, + LedgerChannelInfo, + PaymentChannelInfo +} from '@cerc-nitro/nitro-node'; +import { + JSONbigNative, + hex2Bytes +} from '@cerc-nitro/nitro-util'; -import { utils } from '@cerc-io/nitro-node'; -import { JSONbigNative, hex2Bytes, DEFAULT_CHAIN_URL_WEBSOCKET } from '@cerc-io/nitro-util'; - -import contractAddresses from './nitro-addresses.json'; -import logo from './logo.svg'; import './App.css'; -const { - ACTORS, - createPeerIdFromKey, - createPeerAndInit, - subscribeVoucherLogs -} = utils; - -declare global { - interface Window { - setupNode: (name: string) => Promise - clearNodeStorage: () => Promise - out: (jsonObject: any) => void - } -} - -window.clearNodeStorage = utils.Nitro.clearNodeStorage; - -// Method to setup nitro node with test actors -window.setupNode = async (name: string): Promise => { - const actor = ACTORS[name]; - assert(actor, `Actor with name ${name} does not exists`); - assert(process.env.REACT_APP_RELAY_MULTIADDR); +const { createPeerIdFromKey, createPeerAndInit, subscribeVoucherLogs } = utils; +const setupNode = async ( + websocketUrl: string, + privateKey: string, + bootNodeMultiAddr: string, + contractAddresses: { [key: string]: string } +): Promise => { // Create peer instance - const peerIdObj = await createPeerIdFromKey(hex2Bytes(actor.privateKey)); - const peer = await createPeerAndInit(process.env.REACT_APP_RELAY_MULTIADDR, {}, peerIdObj); + const peerIdObj = await createPeerIdFromKey(hex2Bytes(privateKey)); + const peer = await createPeerAndInit(bootNodeMultiAddr, {}, peerIdObj); const nitro = await utils.Nitro.setupNode( - actor.privateKey, - DEFAULT_CHAIN_URL_WEBSOCKET, - actor.chainPrivateKey, + privateKey, + websocketUrl, + privateKey, contractAddresses, peer, true, - `${name}-db`, - undefined, - process.env.REACT_APP_ASSET_ADDRESS + 'nitro-db' ); // Subscribe to vouchers and log them @@ -53,25 +39,398 @@ window.setupNode = async (name: string): Promise => { return nitro; }; -window.out = (jsonObject) => { - console.log(JSONbigNative.stringify(jsonObject, null, 2)); -}; +async function updateChannels ( + nitro: utils.Nitro, + setFocusedLedgerChannel: (l: LedgerChannelInfo | null) => void, + setFocusedPaymentChannel: (p: PaymentChannelInfo | null) => void, + setCreatingLedgerChannel: (v: boolean) => void, + setCreatingPaymentChannel: (v: boolean) => void +) { + if (!nitro) { + return; + } + const ledgerChannels = (await nitro.getAllLedgerChannels()).filter( + (lc) => lc.status === 'Open' + ); + const paymentChannels = new Map(); + + let focusedLedgerChannel: LedgerChannelInfo | null = null; + let focusedPaymentChannel: PaymentChannelInfo | null = null; + + for (const lc of ledgerChannels) { + const pcs = (await nitro.getPaymentChannelsByLedger(lc.iD.string())).filter( + (pc) => pc.status === 'Open' + ); + paymentChannels.set(lc.iD.string(), pcs); + for (const pc of pcs) { + if ( + focusedPaymentChannel == null || + pc.balance.remainingFunds!.valueOf() > + focusedPaymentChannel.balance.remainingFunds!.valueOf() + ) { + focusedLedgerChannel = lc; + focusedPaymentChannel = pc; + } + } + } + + if (!focusedLedgerChannel && ledgerChannels.length) { + focusedLedgerChannel = ledgerChannels[0]; + } + + setFocusedPaymentChannel(focusedPaymentChannel); + if (focusedPaymentChannel) { + setCreatingPaymentChannel(false); + } + setFocusedLedgerChannel(focusedLedgerChannel); + if (focusedLedgerChannel) { + setCreatingLedgerChannel(false); + } +} + +async function pay ( + nitro: utils.Nitro | null, + targetUrl: string, + paymentChannel: PaymentChannelInfo | null, + amount: number, + setToken: (p: any | null) => void +) { + if (nitro && paymentChannel) { + const voucher = await nitro.pay(paymentChannel.iD.string(), `${amount}`); + const response = await fetch(`${targetUrl}/pay/receive`, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSONbigNative.stringify(voucher) + }); + const token = await response.json(); + setToken(token); + } +} + +function getRpcUrl (rpcUrl?: string): string { + if (rpcUrl) { + return rpcUrl ?? ''; + } + return process.env.REACT_APP_RPC_URL ?? 'ws://localhost:8546'; +} + +function getTargetUrl (targetUrl?: string): string { + if (targetUrl) { + return targetUrl ?? ''; + } + + return process.env.REACT_APP_TARGET_URL ?? 'http://localhost:5678'; +} + +async function send (url: string): Promise { + try { + const fromEl = document.getElementById('api-send'); + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + // @ts-ignore + body: fromEl!.value + }); + + const text = await response.text(); + const recvEl = document.getElementById('api-recv'); + // @ts-ignore + recvEl.value = text; + } catch (e) { + const recvEl = document.getElementById('api-recv'); + // @ts-ignore + recvEl.value = e; + } +} function App () { + const [nitro, setNitro] = useState(null); + const [targetServerUrl, setTargetServerUrl] = useState( + getTargetUrl() + ); + const [myEthWebSocketUrl, setMyEthWebSocketUrl] = useState(getRpcUrl()); + const [myNitroAddress, setMyNitroAddress] = useState(''); + const [theirNitroAddress, setTheirNitroAddress] = useState(''); + const [targetMultiAddr, setTargetMultiAddr] = useState(''); + const [focusedLedgerChannel, setFocusedLedgerChannel] = + useState(null); + const [focusedPaymentChannel, setFocusedPaymentChannel] = + useState(null); + const [token, setToken] = useState(null); + const [creatingLedgerChannel, setCreatingLedgerChannel] = + useState(false); + const [creatingPaymentChannel, setCreatingPaymentChannel] = + useState(false); + + let updateEverything = async () => {}; + let updateInterval: NodeJS.Timeout | undefined; + + const rpcChange = async () => { + if (!myEthWebSocketUrl || !targetMultiAddr) { + return; + } + setFocusedPaymentChannel(null); + setFocusedLedgerChannel(null); + setMyNitroAddress(''); + const c = await setupNode(myEthWebSocketUrl, + process.env.REACT_APP_NITRO_PK!, + targetMultiAddr, + { + nitroAdjudicatorAddress: process.env.REACT_APP_NA_ADDRESS!, + virtualPaymentAppAddress: process.env.REACT_APP_VPA_ADDRESS!, + consensusAppAddress: process.env.REACT_APP_CA_ADDRESS! + }); + setNitro(c); + setMyNitroAddress(c.node.address); + updateEverything = async () => + updateChannels( + c, + setFocusedLedgerChannel, + setFocusedPaymentChannel, + setCreatingLedgerChannel, + setCreatingPaymentChannel + ); + if (updateInterval) { + clearInterval(updateInterval); + } + updateInterval = setInterval(updateEverything, 1000); + }; + useEffect(() => { - window.onunhandledrejection = (err) => { - // Log unhandled errors instead of stopping application - console.log(err); - }; - }, []); + const delayDebounceFn = setTimeout(rpcChange, 1000); + return () => clearTimeout(delayDebounceFn); + }, [myEthWebSocketUrl]); + + useEffect(() => { + if (nitro) { + setMyNitroAddress(nitro.store.getAddress()); + nitro.addPeerByMultiaddr(theirNitroAddress, targetMultiAddr); + updateEverything(); + // nitro.notifications.on('objective_completed', updateEverything); + } + }, [nitro, targetMultiAddr, theirNitroAddress]); + + useEffect(() => { + const delayDebounceFn = setTimeout(() => { + setFocusedPaymentChannel(null); + setFocusedLedgerChannel(null); + setTheirNitroAddress(''); + fetch(targetServerUrl + '/pay/address').then((response) => { + response.json().then((v: any) => { + setTheirNitroAddress(v?.address); + setTargetMultiAddr(v?.multiaddrs[0]); + rpcChange(); + if (nitro) { + updateEverything(); + } + }); + }); + }, 1000); + + return () => clearTimeout(delayDebounceFn); + }, [targetServerUrl, targetMultiAddr]); return ( -
-
- logo -

ts-nitro

-
-
+ <> +
+

Nitro Details

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ETH WebSocket URL + setMyEthWebSocketUrl(e.target.value)} + value={myEthWebSocketUrl?.toString()} + /> +
Consumer Address{myNitroAddress}
Provider Endpoint + setTargetServerUrl(e.target.value)} + value={targetServerUrl?.toString()} + /> +
Provider Address{theirNitroAddress}
Provider MultiAddr{targetMultiAddr}
Ledger Channel + {focusedLedgerChannel + ? ( + + {focusedLedgerChannel.iD.string()}{' '} + + + ) + : ( + + )} +
Ledger Balance + {focusedLedgerChannel + ? `${focusedLedgerChannel.balance.theirBalance} / ${focusedLedgerChannel.balance.myBalance}` + : ''} +
Payment Channel + {focusedPaymentChannel + ? ( + + {focusedPaymentChannel.iD.string()}{' '} + + + ) + : focusedLedgerChannel + ? ( + + ) + : ( + '' + )} +
Channel Balance + {focusedPaymentChannel + ? `${focusedPaymentChannel.balance.paidSoFar} / ${focusedPaymentChannel.balance.remainingFunds}` + : ''} +
API Token + {token && `${token.token}`}{' '} + {focusedPaymentChannel && ( + + )} +
+
+
+

Ethereum API

+ + + + + + + + + +
+ +
+ +
+
+ ); } diff --git a/packages/example-web-app/tsconfig.json b/packages/example-web-app/tsconfig.json index a273b0cf..1bdae4cf 100644 --- a/packages/example-web-app/tsconfig.json +++ b/packages/example-web-app/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "esnext", "lib": [ "dom", "dom.iterable", diff --git a/packages/nitro-node/package.json b/packages/nitro-node/package.json index 98acdd4f..558a4804 100644 --- a/packages/nitro-node/package.json +++ b/packages/nitro-node/package.json @@ -1,15 +1,16 @@ { - "name": "@cerc-io/nitro-node", - "version": "0.1.15", + "name": "@cerc-nitro/nitro-node", + "version": "0.2.7", "main": "dist/index.js", + "types": "dist/types/src/index.d.ts", "license": "MIT", "scripts": { "index:browser": "cp src/browser.ts src/index.ts", "index:node": "cp src/node.ts src/index.ts", "build": "if [ \"$TARGET\" = \"browser\" ]; then yarn build:browser; else yarn build:node; fi", - "build:browser": "yarn index:browser && webpack --config webpack.prod.ts --env target=browser", + "build:browser": "yarn index:browser && webpack --config webpack.prod.ts --env target=browser && scripts/uneval.sh", "build:node": "yarn index:node && webpack --config webpack.prod.ts --env target=node", - "build:dev:browser": "yarn index:browser && webpack --config webpack.dev.ts --env target=browser", + "build:dev:browser": "yarn index:browser && webpack --config webpack.dev.ts --env target=browser && scripts/uneval.sh", "build:dev:node": "yarn index:node && webpack --config webpack.dev.ts --env target=node", "build:update-package-name": "yarn ts-node scripts/update-package-name.ts", "dev": "webpack --watch --config webpack.dev.ts", @@ -33,6 +34,7 @@ "@types/webpack": "^5.28.1", "@typescript-eslint/eslint-plugin": "^5.13.0", "@typescript-eslint/parser": "^5.0.0", + "babel-loader": "^9.1.3", "chai": "^4.3.7", "eslint": "^7.32.0 || ^8.2.0", "eslint-config-airbnb-base": "^15.0.0", @@ -54,11 +56,14 @@ }, "dependencies": { "@cerc-io/libp2p": "0.42.2-laconic-0.1.4", - "@cerc-io/nitro-util": "^0.1.15", "@cerc-io/peer": "^0.2.65", "@cerc-io/ts-channel": "1.0.3-ts-nitro-0.1.1", + "@cerc-nitro/nitro-util": "^0.2.7", "@jpwilliams/waitgroup": "^2.1.0", - "@libp2p/crypto": "^1.0.4", + "@libp2p/crypto": "^2.0.2", + "@libp2p/interface-peer-id": "^2.0.2", + "@libp2p/peer-id": "^2.0.2", + "@libp2p/peer-id-factory": "^2.0.2", "@libp2p/tcp": "^6.0.0", "@multiformats/multiaddr": "^11.1.4", "@statechannels/nitro-protocol": "^2.0.1-alpha.5", @@ -67,7 +72,7 @@ "debug": "^4.3.4", "ethers": "^5.7.2", "heap": "^0.2.7", - "it-pipe": "^2.0.5", + "it-pipe": "^2.0.1", "level": "^8.0.0", "lodash": "^4.17.21", "path-browserify": "^1.0.1", diff --git a/packages/nitro-node/scripts/deploy-contracts.ts b/packages/nitro-node/scripts/deploy-contracts.ts index 6ed94fca..607e828d 100644 --- a/packages/nitro-node/scripts/deploy-contracts.ts +++ b/packages/nitro-node/scripts/deploy-contracts.ts @@ -3,7 +3,7 @@ import fs from 'fs'; import path from 'path'; import debug from 'debug'; -import { DEFAULT_CHAIN_URL } from '@cerc-io/nitro-util/src/constants'; +import { DEFAULT_CHAIN_URL } from '@cerc-nitro/nitro-util/src/constants'; import { deployContracts } from '../src/internal/chain/chain'; diff --git a/packages/nitro-node/scripts/uneval.sh b/packages/nitro-node/scripts/uneval.sh new file mode 100755 index 00000000..b74399dd --- /dev/null +++ b/packages/nitro-node/scripts/uneval.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +if [ ! -f "dist/index.js.orig" ]; then + cp dist/index.js dist/index.js.orig +fi + +sed -e "s|.*this.client.eval.*|// UNEVAL|" \ + -e "s|\(.*\)isBrowser = new Function.*;|\1isBrowser = () => true; // UNEVAL|" \ + dist/index.js.orig > dist/index.js +rc=$? + +diff -U1 dist/index.js.orig dist/index.js + +exit $rc diff --git a/packages/nitro-node/scripts/update-package-name.ts b/packages/nitro-node/scripts/update-package-name.ts index d3ec00af..0d7818fe 100644 --- a/packages/nitro-node/scripts/update-package-name.ts +++ b/packages/nitro-node/scripts/update-package-name.ts @@ -4,7 +4,7 @@ async function main() { const pkgJson = await PackageJson.load('.'); const { content } = pkgJson; - content.name = '@cerc-io/nitro-node-browser'; + content.name = '@cerc-nitro/nitro-node-browser'; pkgJson.update(content); await pkgJson.save(); diff --git a/packages/nitro-node/src/channel/channel.ts b/packages/nitro-node/src/channel/channel.ts index 9fe407f4..ee79ae16 100644 --- a/packages/nitro-node/src/channel/channel.ts +++ b/packages/nitro-node/src/channel/channel.ts @@ -5,7 +5,7 @@ import { ethers } from 'ethers'; import { fromJSON, toJSON, FieldDescription, Uint, Uint64, NitroSigner, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Bytes32 } from '@statechannels/nitro-protocol'; import { Signature } from '../crypto/signatures'; @@ -115,7 +115,7 @@ export class Channel extends FixedPart { myIndex: { type: 'uint' }, onChain: { type: 'class', value: OnChainData }, offChain: { type: 'class', value: OffChainData }, - ...super.jsonEncodingMap, + ...FixedPart.jsonEncodingMap, }; static fromJSON(data: string): Channel { diff --git a/packages/nitro-node/src/channel/consensus-channel/consensus-channel.ts b/packages/nitro-node/src/channel/consensus-channel/consensus-channel.ts index f1041cd0..562eca38 100644 --- a/packages/nitro-node/src/channel/consensus-channel/consensus-channel.ts +++ b/packages/nitro-node/src/channel/consensus-channel/consensus-channel.ts @@ -7,7 +7,7 @@ import { ethers } from 'ethers'; import { FieldDescription, NitroSigner, Uint, Uint64, fromJSON, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Bytes32 } from '@statechannels/nitro-protocol'; import { Signature } from '../../crypto/signatures'; @@ -591,7 +591,7 @@ export class SignedVars extends Vars { ]; static jsonEncodingMap: Record = { - ...super.jsonEncodingMap, + ...Vars.jsonEncodingMap, signatures: { type: 'array', value: { type: 'class', value: Signature } }, }; diff --git a/packages/nitro-node/src/channel/constants.ts b/packages/nitro-node/src/channel/constants.ts index eaf401d9..7f5067cf 100644 --- a/packages/nitro-node/src/channel/constants.ts +++ b/packages/nitro-node/src/channel/constants.ts @@ -1,4 +1,4 @@ -import { Uint64 } from '@cerc-io/nitro-util'; +import { Uint64 } from '@cerc-nitro/nitro-util'; // MaxTurnNum is a reserved value which is taken to mean "there is not yet a supported state" export const MaxTurnNum: Uint64 = BigInt(2 ** 64) - BigInt(1); diff --git a/packages/nitro-node/src/channel/state/outcome/allocation.ts b/packages/nitro-node/src/channel/state/outcome/allocation.ts index 9def2c3a..37d6677f 100644 --- a/packages/nitro-node/src/channel/state/outcome/allocation.ts +++ b/packages/nitro-node/src/channel/state/outcome/allocation.ts @@ -3,7 +3,7 @@ import { Buffer } from 'buffer'; import { FieldDescription, JSONbigNative, fromJSON, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Destination } from '../../../types/destination'; import { GuaranteeMetadata } from './guarantee'; diff --git a/packages/nitro-node/src/channel/state/outcome/exit.ts b/packages/nitro-node/src/channel/state/outcome/exit.ts index b441c2c1..0a0c05f3 100644 --- a/packages/nitro-node/src/channel/state/outcome/exit.ts +++ b/packages/nitro-node/src/channel/state/outcome/exit.ts @@ -4,7 +4,7 @@ import _ from 'lodash'; import { FieldDescription, JSONbigNative, fromJSON, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Destination } from '../../../types/destination'; import { Address } from '../../../types/types'; diff --git a/packages/nitro-node/src/channel/state/signedstate.ts b/packages/nitro-node/src/channel/state/signedstate.ts index 6aa9ecbd..cae37c2d 100644 --- a/packages/nitro-node/src/channel/state/signedstate.ts +++ b/packages/nitro-node/src/channel/state/signedstate.ts @@ -3,7 +3,7 @@ import { Buffer } from 'buffer'; import { FieldDescription, Uint, Uint64, fromJSON, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Signature } from '../../crypto/signatures'; import { State } from './state'; diff --git a/packages/nitro-node/src/channel/state/state.ts b/packages/nitro-node/src/channel/state/state.ts index d8cc5690..3bee7348 100644 --- a/packages/nitro-node/src/channel/state/state.ts +++ b/packages/nitro-node/src/channel/state/state.ts @@ -11,7 +11,7 @@ import { } from '@statechannels/nitro-protocol'; import { FieldDescription, NitroSigner, Uint64, bytes2Hex, fromJSON, hex2Bytes, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import * as nc from '../../crypto/signatures'; import { Signature } from '../../crypto/signatures'; diff --git a/packages/nitro-node/src/channel/virtual.ts b/packages/nitro-node/src/channel/virtual.ts index 48147b2d..d34bcc62 100644 --- a/packages/nitro-node/src/channel/virtual.ts +++ b/packages/nitro-node/src/channel/virtual.ts @@ -1,13 +1,13 @@ import { FieldDescription, Uint, fromJSON, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Channel } from './channel'; import { State } from './state/state'; export class VirtualChannel extends Channel { static jsonEncodingMap: Record = { - ...super.jsonEncodingMap, + ...Channel.jsonEncodingMap, }; static fromJSON(data: string): VirtualChannel { diff --git a/packages/nitro-node/src/crypto/signatures.ts b/packages/nitro-node/src/crypto/signatures.ts index 29012849..d58deab9 100644 --- a/packages/nitro-node/src/crypto/signatures.ts +++ b/packages/nitro-node/src/crypto/signatures.ts @@ -5,7 +5,7 @@ import { Buffer } from 'buffer'; import { JSONbigNative, NitroSigner, bytes2Hex, hex2Bytes, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; // Signature is an ECDSA signature export class Signature { diff --git a/packages/nitro-node/src/node/engine/chainservice/adjudicator/nitro-adjudicator.ts b/packages/nitro-node/src/node/engine/chainservice/adjudicator/nitro-adjudicator.ts index 08a8b252..c9e94a89 100644 --- a/packages/nitro-node/src/node/engine/chainservice/adjudicator/nitro-adjudicator.ts +++ b/packages/nitro-node/src/node/engine/chainservice/adjudicator/nitro-adjudicator.ts @@ -8,4 +8,4 @@ export { AllocationUpdatedEventObject, ConcludedEventObject, ChallengeRegisteredEventObject, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; diff --git a/packages/nitro-node/src/node/engine/chainservice/chainservice.ts b/packages/nitro-node/src/node/engine/chainservice/chainservice.ts index aa7061c2..f304a843 100644 --- a/packages/nitro-node/src/node/engine/chainservice/chainservice.ts +++ b/packages/nitro-node/src/node/engine/chainservice/chainservice.ts @@ -2,7 +2,7 @@ import { ethers } from 'ethers'; import type { ReadChannel } from '@cerc-io/ts-channel'; -import { Uint64, Uint } from '@cerc-io/nitro-util'; +import { Uint64, Uint } from '@cerc-nitro/nitro-util'; import { Bytes32 } from '@statechannels/nitro-protocol'; import { ChainTransaction, Objective } from '../../../protocols/interfaces'; diff --git a/packages/nitro-node/src/node/engine/chainservice/erc20/token.ts b/packages/nitro-node/src/node/engine/chainservice/erc20/token.ts index 778fed0d..1fd7e2e8 100644 --- a/packages/nitro-node/src/node/engine/chainservice/erc20/token.ts +++ b/packages/nitro-node/src/node/engine/chainservice/erc20/token.ts @@ -1,2 +1,2 @@ // Re-export bindings generated using TypeChain -export { Token, Token__factory } from '@cerc-io/nitro-util'; +export { Token, Token__factory } from '@cerc-nitro/nitro-util'; diff --git a/packages/nitro-node/src/node/engine/chainservice/eth-chainservice.ts b/packages/nitro-node/src/node/engine/chainservice/eth-chainservice.ts index 144d1e75..95777902 100644 --- a/packages/nitro-node/src/node/engine/chainservice/eth-chainservice.ts +++ b/packages/nitro-node/src/node/engine/chainservice/eth-chainservice.ts @@ -9,7 +9,7 @@ import Channel from '@cerc-io/ts-channel'; import { EthClient, go, hex2Bytes, Context, WrappedError, JSONbigNative, Uint64, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { ChainService, ChainEvent, DepositedEvent, ConcludedEvent, AllocationUpdatedEvent, ChallengeRegisteredEvent, diff --git a/packages/nitro-node/src/node/engine/chainservice/event-queue.ts b/packages/nitro-node/src/node/engine/chainservice/event-queue.ts index 23091695..fd036c0e 100644 --- a/packages/nitro-node/src/node/engine/chainservice/event-queue.ts +++ b/packages/nitro-node/src/node/engine/chainservice/event-queue.ts @@ -4,7 +4,7 @@ import { ethers } from 'ethers'; import Heap from 'heap'; import type { Log } from '@ethersproject/abstract-provider'; -import { Uint64 } from '@cerc-io/nitro-util'; +import { Uint64 } from '@cerc-nitro/nitro-util'; export class EventTracker { latestBlockNum?: bigint; diff --git a/packages/nitro-node/src/node/engine/chainservice/utils/utils.ts b/packages/nitro-node/src/node/engine/chainservice/utils/utils.ts index 6d3e4f0a..73680387 100644 --- a/packages/nitro-node/src/node/engine/chainservice/utils/utils.ts +++ b/packages/nitro-node/src/node/engine/chainservice/utils/utils.ts @@ -1,7 +1,7 @@ import { ethers } from 'ethers'; import { Buffer } from 'buffer'; -import { EthClient } from '@cerc-io/nitro-util'; +import { EthClient } from '@cerc-nitro/nitro-util'; // connectToChain connects to the chain at the given url and returns a client and a transactor. export async function connectToChain(chainUrl: string, chainPK: Buffer): Promise<[EthClient, ethers.Signer]> { diff --git a/packages/nitro-node/src/node/engine/engine.ts b/packages/nitro-node/src/node/engine/engine.ts index 221935c3..add43c65 100644 --- a/packages/nitro-node/src/node/engine/engine.ts +++ b/packages/nitro-node/src/node/engine/engine.ts @@ -10,7 +10,7 @@ import Channel from '@cerc-io/ts-channel'; import type { ReadChannel, ReadWriteChannel } from '@cerc-io/ts-channel'; import { JSONbigNative, go, Context, WrappedError, Ticker, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { MessageService } from './messageservice/messageservice'; import { ChainService, ChainEvent } from './chainservice/chainservice'; diff --git a/packages/nitro-node/src/node/engine/messageservice/p2p-message-service/service.ts b/packages/nitro-node/src/node/engine/messageservice/p2p-message-service/service.ts index b7511127..0a0da448 100644 --- a/packages/nitro-node/src/node/engine/messageservice/p2p-message-service/service.ts +++ b/packages/nitro-node/src/node/engine/messageservice/p2p-message-service/service.ts @@ -1,24 +1,19 @@ /* eslint-disable no-await-in-loop */ +// @ts-nocheck + import assert from 'assert'; import debug from 'debug'; import { ethers } from 'ethers'; import Channel from '@cerc-io/ts-channel'; import type { ReadChannel, ReadWriteChannel } from '@cerc-io/ts-channel'; -// @ts-expect-error import type { Libp2p } from '@cerc-io/libp2p'; -// @ts-expect-error import type { PrivateKey } from '@libp2p/interface-keys'; -// @ts-expect-error import type { Stream, Connection } from '@libp2p/interface-connection'; -// @ts-expect-error import type { IncomingStreamData } from '@libp2p/interface-registrar'; -// @ts-expect-error import type { PeerId } from '@libp2p/interface-peer-id'; -// @ts-expect-error import { PeerProtocolsChangeData } from '@libp2p/interface-peer-store'; -// @ts-expect-error import type { Peer } from '@cerc-io/peer'; import { SafeSyncMap } from '../../../../internal/safesync/safesync'; @@ -126,11 +121,11 @@ export class P2PMessageService implements MessageService { assert(ms.peer.node); ms.p2pHost = ms.peer.node; assert(ms.p2pHost); - ms.p2pHost.addEventListener('peer:connect', ms.handlePeerConnect.bind(ms)); - ms.p2pHost.peerStore.addEventListener('change:protocols', ms.handleChangeProtocols.bind(ms)); + ms.p2pHost!.addEventListener('peer:connect', ms.handlePeerConnect.bind(ms)); + ms.p2pHost!.peerStore.addEventListener('change:protocols', ms.handleChangeProtocols.bind(ms)); - ms.p2pHost.handle(GENERAL_MSG_PROTOCOL_ID, ms.msgStreamHandler.bind(ms)); - ms.p2pHost.handle(PEER_EXCHANGE_PROTOCOL_ID, ms.receivePeerInfo.bind(ms)); + ms.p2pHost!.handle(GENERAL_MSG_PROTOCOL_ID, ms.msgStreamHandler.bind(ms)); + ms.p2pHost!.handle(PEER_EXCHANGE_PROTOCOL_ID, ms.receivePeerInfo.bind(ms)); await ms.exchangeInfoWithConnectedPeers(); @@ -139,7 +134,7 @@ export class P2PMessageService implements MessageService { // id returns the libp2p peer ID of the message service. async id(): Promise { - const PeerIdFactory = await import('@libp2p/peer-id-factory'); + const PeerIdFactory = await import('@libp2p/peer-id-factory2'); assert(this.privateKey); return PeerIdFactory.createFromPrivKey(this.privateKey); @@ -147,11 +142,12 @@ export class P2PMessageService implements MessageService { // Custom Method to exchange info with already connected peers private async exchangeInfoWithConnectedPeers() { - const peerIds = this.p2pHost.getPeers(); + const peerIds = this.p2pHost!.getPeers(); await Promise.all(peerIds.map(async (peerId: PeerId) => { - const connection: Connection = await this.p2pHost.dial(peerId); + const connection = await this.p2pHost!.dial(peerId); + // @ts-expect-error await this.handlePeerConnect({ detail: connection } as CustomEvent); })); } @@ -161,7 +157,7 @@ export class P2PMessageService implements MessageService { // https://github.com/statechannels/go-nitro/pull/1534/ private async handleChangeProtocols({ detail: data }: CustomEvent) { // Ignore self protocol changes - if (data.peerId.equals(this.p2pHost.peerId)) { + if (data.peerId.equals(this.p2pHost!.peerId)) { return; } @@ -181,7 +177,7 @@ export class P2PMessageService implements MessageService { assert(this.p2pHost); // Get protocols supported by remote peer - const protocols = await this.p2pHost.peerStore.protoBook.get(data.remotePeer); + const protocols = await this.p2pHost!.peerStore.protoBook.get(data.remotePeer); // The protocol may not be updated in the list and will be handled later on change:protocols event if (!protocols.includes(PEER_EXCHANGE_PROTOCOL_ID)) { @@ -288,7 +284,7 @@ export class P2PMessageService implements MessageService { let stream: Stream; try { try { - stream = await this.p2pHost.dialProtocol(recipientId, PEER_EXCHANGE_PROTOCOL_ID); + stream = await this.p2pHost!.dialProtocol(recipientId, PEER_EXCHANGE_PROTOCOL_ID); } catch (err) { this.logger({ error: err, @@ -419,7 +415,7 @@ export class P2PMessageService implements MessageService { for (let i = 0; i < NUM_CONNECT_ATTEMPTS; i += 1) { try { - const s = await this.p2pHost.dialProtocol(peerId, GENERAL_MSG_PROTOCOL_ID); + const s = await this.p2pHost!.dialProtocol(peerId, GENERAL_MSG_PROTOCOL_ID); // Use await on pipe in place of writer.Flush() await pipe( @@ -462,8 +458,8 @@ export class P2PMessageService implements MessageService { assert(this.p2pHost); await this.peer?.close(); - await this.p2pHost.unhandle(GENERAL_MSG_PROTOCOL_ID); - await this.p2pHost.stop(); + await this.p2pHost!.unhandle(GENERAL_MSG_PROTOCOL_ID); + await this.p2pHost!.stop(); } // peerInfoReceived returns a channel that receives a PeerInfo when a peer is discovered @@ -487,7 +483,7 @@ export class P2PMessageService implements MessageService { const { peerIdFromString } = await import('@libp2p/peer-id'); const peerId = peerIdFromString(peerIdString); - await this.p2pHost.peerStore.addressBook.add( + await this.p2pHost!.peerStore.addressBook.add( peerId, [multi], ); @@ -548,7 +544,7 @@ export class P2PMessageService implements MessageService { assert(peerId); try { - await this.p2pHost.dial(peerId); + await this.p2pHost!.dial(peerId); } catch (err) { return [false, ERR_PEER_DIAL_FAILED]; } diff --git a/packages/nitro-node/src/node/engine/store/durablestore.ts b/packages/nitro-node/src/node/engine/store/durablestore.ts index 8c2e68d9..0a1c742f 100644 --- a/packages/nitro-node/src/node/engine/store/durablestore.ts +++ b/packages/nitro-node/src/node/engine/store/durablestore.ts @@ -5,7 +5,7 @@ import type { AbstractSublevel, AbstractSublevelOptions } from 'abstract-level'; import { JSONbigNative, NitroSigner, WrappedError, Uint64, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { ErrLoadVouchers, ErrNoSuchChannel, ErrNoSuchObjective, Store, lastBlockNumSeenKey, diff --git a/packages/nitro-node/src/node/engine/store/memstore.ts b/packages/nitro-node/src/node/engine/store/memstore.ts index 7d855b55..6330fe26 100644 --- a/packages/nitro-node/src/node/engine/store/memstore.ts +++ b/packages/nitro-node/src/node/engine/store/memstore.ts @@ -6,8 +6,8 @@ import { Mutex } from 'async-mutex'; import { JSONbigNative, WrappedError, Uint64, -} from '@cerc-io/nitro-util'; -import type { NitroSigner } from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; +import type { NitroSigner } from '@cerc-nitro/nitro-util'; import { ErrNoSuchChannel, ErrNoSuchObjective, Store, ErrLoadVouchers, diff --git a/packages/nitro-node/src/node/engine/store/store.ts b/packages/nitro-node/src/node/engine/store/store.ts index 82a6d1af..890fabea 100644 --- a/packages/nitro-node/src/node/engine/store/store.ts +++ b/packages/nitro-node/src/node/engine/store/store.ts @@ -1,4 +1,4 @@ -import { NitroSigner, Uint64 } from '@cerc-io/nitro-util'; +import { NitroSigner, Uint64 } from '@cerc-nitro/nitro-util'; import { Objective } from '../../../protocols/interfaces'; import { Channel } from '../../../channel/channel'; diff --git a/packages/nitro-node/src/node/engine/store/utils.ts b/packages/nitro-node/src/node/engine/store/utils.ts index ff23310b..43d0c3d8 100644 --- a/packages/nitro-node/src/node/engine/store/utils.ts +++ b/packages/nitro-node/src/node/engine/store/utils.ts @@ -1,7 +1,7 @@ import debug from 'debug'; import path from 'path-browserify'; -import { NitroSigner } from '@cerc-io/nitro-util'; +import { NitroSigner } from '@cerc-nitro/nitro-util'; import { Store } from './store'; import { DurableStore } from './durablestore'; diff --git a/packages/nitro-node/src/node/node.ts b/packages/nitro-node/src/node/node.ts index f7f8c886..ad0c6401 100644 --- a/packages/nitro-node/src/node/node.ts +++ b/packages/nitro-node/src/node/node.ts @@ -6,7 +6,7 @@ import type { ReadChannel, ReadWriteChannel } from '@cerc-io/ts-channel'; import Channel from '@cerc-io/ts-channel'; import { randUint64, WrappedError, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { MessageService } from './engine/messageservice/messageservice'; import { ChainService } from './engine/chainservice/chainservice'; diff --git a/packages/nitro-node/src/node/query/types.ts b/packages/nitro-node/src/node/query/types.ts index 6301e710..7df199ba 100644 --- a/packages/nitro-node/src/node/query/types.ts +++ b/packages/nitro-node/src/node/query/types.ts @@ -1,7 +1,7 @@ import { ethers } from 'ethers'; import _ from 'lodash'; -import { FieldDescription, toJSON } from '@cerc-io/nitro-util'; +import { FieldDescription, toJSON } from '@cerc-nitro/nitro-util'; import { Address } from '../../types/types'; import { Destination } from '../../types/destination'; diff --git a/packages/nitro-node/src/payments/voucher-manager.ts b/packages/nitro-node/src/payments/voucher-manager.ts index da0b18eb..d4c9150c 100644 --- a/packages/nitro-node/src/payments/voucher-manager.ts +++ b/packages/nitro-node/src/payments/voucher-manager.ts @@ -1,6 +1,6 @@ import _ from 'lodash'; -import { NitroSigner } from '@cerc-io/nitro-util'; +import { NitroSigner } from '@cerc-nitro/nitro-util'; import { Destination } from '../types/destination'; import { Address } from '../types/types'; diff --git a/packages/nitro-node/src/payments/vouchers.ts b/packages/nitro-node/src/payments/vouchers.ts index bd957fac..dafcbd49 100644 --- a/packages/nitro-node/src/payments/vouchers.ts +++ b/packages/nitro-node/src/payments/vouchers.ts @@ -15,7 +15,7 @@ import { Buffer } from 'buffer'; import { Bytes32, Voucher as NitroVoucher } from '@statechannels/nitro-protocol'; import { FieldDescription, NitroSigner, fromJSON, hex2Bytes, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Signature } from '../channel/state/state'; import { Address } from '../types/types'; diff --git a/packages/nitro-node/src/protocols/directdefund/directdefund.ts b/packages/nitro-node/src/protocols/directdefund/directdefund.ts index d2bd03ed..4bcc05a0 100644 --- a/packages/nitro-node/src/protocols/directdefund/directdefund.ts +++ b/packages/nitro-node/src/protocols/directdefund/directdefund.ts @@ -7,7 +7,7 @@ import cloneDeep from 'lodash/cloneDeep'; import Channel, { ReadWriteChannel } from '@cerc-io/ts-channel'; import { FieldDescription, NitroSigner, Uint64, fromJSON, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Destination } from '../../types/destination'; import { ConsensusChannel } from '../../channel/consensus-channel/consensus-channel'; diff --git a/packages/nitro-node/src/protocols/directfund/directfund.ts b/packages/nitro-node/src/protocols/directfund/directfund.ts index 7320ee67..b7c0da9d 100644 --- a/packages/nitro-node/src/protocols/directfund/directfund.ts +++ b/packages/nitro-node/src/protocols/directfund/directfund.ts @@ -7,7 +7,7 @@ import Channel from '@cerc-io/ts-channel'; import type { ReadWriteChannel } from '@cerc-io/ts-channel'; import { FieldDescription, JSONbigNative, NitroSigner, Uint64, WrappedError, fromJSON, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Exit } from '../../channel/state/outcome/exit'; import { Address } from '../../types/types'; diff --git a/packages/nitro-node/src/protocols/interfaces.ts b/packages/nitro-node/src/protocols/interfaces.ts index 4255ad96..dbdf478f 100644 --- a/packages/nitro-node/src/protocols/interfaces.ts +++ b/packages/nitro-node/src/protocols/interfaces.ts @@ -1,4 +1,4 @@ -import { NitroSigner } from '@cerc-io/nitro-util'; +import { NitroSigner } from '@cerc-nitro/nitro-util'; import { Message, ObjectiveId, ObjectivePayload } from './messages'; import { Proposal, SignedProposal } from '../channel/consensus-channel/consensus-channel'; import { Address } from '../types/types'; diff --git a/packages/nitro-node/src/protocols/messages.ts b/packages/nitro-node/src/protocols/messages.ts index 836285bd..682c466d 100644 --- a/packages/nitro-node/src/protocols/messages.ts +++ b/packages/nitro-node/src/protocols/messages.ts @@ -3,7 +3,7 @@ import { ethers } from 'ethers'; import { FieldDescription, JSONbigNative, Uint64, fromJSON, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { SignedProposal, Proposal } from '../channel/consensus-channel/consensus-channel'; import { Voucher } from '../payments/vouchers'; diff --git a/packages/nitro-node/src/protocols/virtualdefund/virtualdefund.ts b/packages/nitro-node/src/protocols/virtualdefund/virtualdefund.ts index 89d43776..90e81e90 100644 --- a/packages/nitro-node/src/protocols/virtualdefund/virtualdefund.ts +++ b/packages/nitro-node/src/protocols/virtualdefund/virtualdefund.ts @@ -11,7 +11,7 @@ import { Uint64, fromJSON, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Destination } from '../../types/destination'; import { Address } from '../../types/types'; diff --git a/packages/nitro-node/src/protocols/virtualfund/virtualfund.ts b/packages/nitro-node/src/protocols/virtualfund/virtualfund.ts index 280128e9..6b671232 100644 --- a/packages/nitro-node/src/protocols/virtualfund/virtualfund.ts +++ b/packages/nitro-node/src/protocols/virtualfund/virtualfund.ts @@ -7,7 +7,7 @@ import Channel from '@cerc-io/ts-channel'; import type { ReadWriteChannel } from '@cerc-io/ts-channel'; import { FieldDescription, JSONbigNative, NitroSigner, Uint, Uint64, fromJSON, toJSON, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Destination } from '../../types/destination'; import { diff --git a/packages/nitro-node/src/types/destination.ts b/packages/nitro-node/src/types/destination.ts index 64010346..9a7b5e51 100644 --- a/packages/nitro-node/src/types/destination.ts +++ b/packages/nitro-node/src/types/destination.ts @@ -2,7 +2,7 @@ import { ethers } from 'ethers'; import { Buffer } from 'buffer'; import { Bytes32, isExternalDestination } from '@statechannels/nitro-protocol'; -import { hex2Bytes } from '@cerc-io/nitro-util'; +import { hex2Bytes } from '@cerc-nitro/nitro-util'; import { Address } from './types'; diff --git a/packages/nitro-node/src/types/funds.ts b/packages/nitro-node/src/types/funds.ts index 7d4b2359..385936b9 100644 --- a/packages/nitro-node/src/types/funds.ts +++ b/packages/nitro-node/src/types/funds.ts @@ -1,6 +1,6 @@ import { FieldDescription, JSONbigNative, decodeMap, encodeMap, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { Address } from './types'; diff --git a/packages/nitro-node/src/utils/helpers.ts b/packages/nitro-node/src/utils/helpers.ts index e98e4560..b271bc0f 100644 --- a/packages/nitro-node/src/utils/helpers.ts +++ b/packages/nitro-node/src/utils/helpers.ts @@ -1,7 +1,7 @@ import debug from 'debug'; import { ethers } from 'ethers'; -import { JSONbigNative, bytes2Hex, hex2Bytes } from '@cerc-io/nitro-util'; +import { JSONbigNative, bytes2Hex, hex2Bytes } from '@cerc-nitro/nitro-util'; import { P2PMessageService } from '../node/engine/messageservice/p2p-message-service/service'; import { Node } from '../node/node'; diff --git a/packages/nitro-node/src/utils/nitro.ts b/packages/nitro-node/src/utils/nitro.ts index e74d8cc2..9ca3b478 100644 --- a/packages/nitro-node/src/utils/nitro.ts +++ b/packages/nitro-node/src/utils/nitro.ts @@ -1,9 +1,8 @@ import debug from 'debug'; import { providers } from 'ethers'; -// @ts-expect-error import type { Peer } from '@cerc-io/peer'; -import { NitroSigner, DEFAULT_ASSET } from '@cerc-io/nitro-util'; +import { NitroSigner, DEFAULT_ASSET } from '@cerc-nitro/nitro-util'; import { Node } from '../node/node'; import { P2PMessageService } from '../node/engine/messageservice/p2p-message-service/service'; diff --git a/packages/nitro-node/src/utils/peer.ts b/packages/nitro-node/src/utils/peer.ts index 66d725ad..4e808e9f 100644 --- a/packages/nitro-node/src/utils/peer.ts +++ b/packages/nitro-node/src/utils/peer.ts @@ -1,12 +1,13 @@ import { Buffer } from 'buffer'; -// @ts-expect-error -import type { Peer as PeerInterface, PeerInitConfig, PeerIdObj } from '@cerc-io/peer'; +import type { PeerInitConfig, PeerIdObj } from '@cerc-io/peer'; +import { Peer } from '@cerc-io/peer'; export const createPeerIdFromKey = async (pk: Buffer): Promise => { const { marshalPrivateKey, marshalPublicKey, generateKeyPairFromSeed, - } = await import('@libp2p/crypto/keys'); + // eslint-disable-next-line + } = await import('../../../../node_modules/@libp2p/crypto/dist/src/keys/index.js'); // @es // const messageKey = await unmarshalPrivateKey(pk); // Workaround to get a libp2p PrivateKey instance from `pk` passed to message service @@ -26,8 +27,7 @@ export const createPeerAndInit = async ( relayMultiAddr: string, initOptions: PeerInitConfig = {}, peerIdObj?: PeerIdObj, -): Promise => { - const { Peer } = await import ('@cerc-io/peer'); +): Promise => { // TODO: Debug connection issue with webrtc enabled in ts-nitro // Disabled by setting nodejs option to true below const peer = new Peer(relayMultiAddr, true); diff --git a/packages/nitro-node/src/utils/signers/key-signer.ts b/packages/nitro-node/src/utils/signers/key-signer.ts index 1ed69965..3035acde 100644 --- a/packages/nitro-node/src/utils/signers/key-signer.ts +++ b/packages/nitro-node/src/utils/signers/key-signer.ts @@ -1,7 +1,7 @@ import { ethers } from 'ethers'; import { signData as utilSignData } from '@statechannels/nitro-protocol/dist/src/signatures'; -import { NitroSigner } from '@cerc-io/nitro-util'; +import { NitroSigner } from '@cerc-nitro/nitro-util'; export class KeySigner implements NitroSigner { private pk: string; diff --git a/packages/nitro-node/src/utils/signers/snap-signer.ts b/packages/nitro-node/src/utils/signers/snap-signer.ts index 39fd2877..86389ec5 100644 --- a/packages/nitro-node/src/utils/signers/snap-signer.ts +++ b/packages/nitro-node/src/utils/signers/snap-signer.ts @@ -1,6 +1,6 @@ import { Signature, ethers } from 'ethers'; -import { NitroSigner } from '@cerc-io/nitro-util'; +import { NitroSigner } from '@cerc-nitro/nitro-util'; export class SnapSigner implements NitroSigner { private provider: ethers.providers.ExternalProvider; diff --git a/packages/nitro-node/tsconfig.json b/packages/nitro-node/tsconfig.json index 1ac9268c..aba80bf7 100644 --- a/packages/nitro-node/tsconfig.json +++ b/packages/nitro-node/tsconfig.json @@ -1,116 +1,15 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "ES2020", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - "lib": ["es6", "dom"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "ES2020", /* Specify what module code is generated. */ - // "rootDir": "./", /* Specify the root folder within your source files. */ - "moduleResolution": "nodenext", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "dist", /* Specify an output folder for all emitted files. */ - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ + "resolveJsonModule": true, + "esModuleInterop": true, + "lib": ["ES2020", "dom"], + "module": "commonjs", + "moduleResolution": "node", + "noEmit": false, + "strict": false, + "target": "es2017", + "declaration": true, + "declarationDir": "./dist/types" }, - // Used by webpack for TypeScript config files - "ts-node": { - "compilerOptions": { - "module": "CommonJS" - } - }, - "include": ["src"], - "exclude": ["node_modules"] + "exclude": ["./dist/**/*"] } diff --git a/packages/nitro-node/webpack.common.ts b/packages/nitro-node/webpack.common.ts index 4a099cf9..5bd88d5e 100644 --- a/packages/nitro-node/webpack.common.ts +++ b/packages/nitro-node/webpack.common.ts @@ -6,26 +6,59 @@ const baseConfig: webpack.Configuration = { output: { path: path.resolve(__dirname, 'dist'), library: { - name: '@cerc-io/nitro-node', + name: '@cerc-nitro/nitro-node', type: 'umd', }, libraryTarget: 'umd', globalObject: 'this', clean: true, filename: 'index.js', + chunkLoading: false, }, resolve: { extensions: ['.ts', '.js'], }, module: { rules: [ + { + test: /\.(?:js|mjs|cjs)$/, + use: { + loader: 'babel-loader', + options: { + presets: [ + ['@babel/preset-env', { targets: 'chrome 50' }], + ], + }, + }, + }, { test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/, + resolve: { + alias: { + 'uint8arrays/from-string': '../../../../../../../node_modules/uint8arrays/dist/src/from-string.js', + 'uint8arrays/to-string': '../../../../../../../node_modules/uint8arrays/dist/src/to-string.js', + '@libp2p/crypto/keys': '../../../../../node_modules/@libp2p/crypto/dist/src/keys/index.js', + '@libp2p/peer-id': '../../../../../node_modules/@libp2p/peer-id/dist/src/index.js', + '@libp2p/peer-id-factory': '../../../../node_modules/@libp2p/peer-id-factory/dist/src/index.js', + '@libp2p/peer-id-factory2': '../../../../../node_modules/@libp2p/peer-id-factory/dist/src/index.js', + 'it-pipe': '../../../../../../../node_modules/it-pipe/dist/src/index.js', + '@multiformats/multiaddr': '../../../../../node_modules/@multiformats/multiaddr/dist/src/index.js', + }, + }, }, ], }, +}; + +export const browserConfig: webpack.Configuration = merge(baseConfig, { + entry: './src/browser.ts', +}); + +export const nodeConfig: webpack.Configuration = merge(baseConfig, { + entry: './src/node.ts', + target: 'node', externals: { '@cerc-io/ts-channel': '@cerc-io/ts-channel', '@cerc-io/nitro-util': '@cerc-io/nitro-util', @@ -42,30 +75,6 @@ const baseConfig: webpack.Configuration = { // Internal NodeJS modules used by it cannot be resolved in build ws: 'ws', }, -}; - -export const browserConfig: webpack.Configuration = merge(baseConfig, { - entry: './src/browser.ts', - // Packages are resolved properly in browser build tool; so not required in build output - externals: { - '@chainsafe/libp2p-yamux': '@chainsafe/libp2p-yamux', - '@chainsafe/libp2p-noise': '@chainsafe/libp2p-noise', - '@cerc-io/peer': '@cerc-io/peer', - - // TODO: Fix export paths so that it can be resolved by react build - 'it-pipe': 'it-pipe', - '@libp2p/crypto/keys': '@libp2p/crypto/keys', - '@libp2p/peer-id-factory': '@libp2p/peer-id-factory', - '@libp2p/peer-id': '@libp2p/peer-id', - 'uint8arrays/to-string': 'uint8arrays/to-string', - 'uint8arrays/from-string': 'uint8arrays/from-string', - '@multiformats/multiaddr': '@multiformats/multiaddr', - }, -}); - -export const nodeConfig: webpack.Configuration = merge(baseConfig, { - entry: './src/node.ts', - target: 'node', }); export default { browserConfig, nodeConfig }; diff --git a/packages/nitro-node/webpack.prod.ts b/packages/nitro-node/webpack.prod.ts index 16487135..cc41ef0b 100644 --- a/packages/nitro-node/webpack.prod.ts +++ b/packages/nitro-node/webpack.prod.ts @@ -7,6 +7,7 @@ const prodConfig: webpack.Configuration = { mode: 'production', optimization: { // Add production-specific optimizations here + minimize: false, }, }; diff --git a/packages/nitro-util/package.json b/packages/nitro-util/package.json index 6e0879ae..192324ef 100644 --- a/packages/nitro-util/package.json +++ b/packages/nitro-util/package.json @@ -1,6 +1,6 @@ { - "name": "@cerc-io/nitro-util", - "version": "0.1.15", + "name": "@cerc-nitro/nitro-util", + "version": "0.2.7", "main": "dist/index.js", "license": "MIT", "scripts": { @@ -43,7 +43,7 @@ "assert": "^2.0.0", "debug": "^4.3.4", "ethers": "^5.7.2", - "it-pipe": "^3.0.1", + "it-pipe": "^2.0.5", "json-bigint": "^1.0.0", "lodash": "^4.17.21", "uint8arrays": "^4.0.3" diff --git a/packages/nitro-util/src/eth-client.ts b/packages/nitro-util/src/eth-client.ts index 8425428c..24c98db7 100644 --- a/packages/nitro-util/src/eth-client.ts +++ b/packages/nitro-util/src/eth-client.ts @@ -15,7 +15,12 @@ export class EthClient { static dial(chainUrl: string): EthClient { // Connect to the Ethereum provider - const provider = new ethers.providers.WebSocketProvider(chainUrl); + let provider; + if (chainUrl.startsWith('ws://') || chainUrl.startsWith('wss://')) { + provider = new ethers.providers.WebSocketProvider(chainUrl); + } else { + provider = new ethers.providers.JsonRpcProvider(chainUrl); + } return new EthClient(provider); } diff --git a/packages/server/package.json b/packages/server/package.json index 21d9236c..2c6f8e11 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { - "name": "@cerc-io/server", - "version": "0.1.15", + "name": "@cerc-nitro/server", + "version": "0.2.7", "main": "index.js", "license": "MIT", "private": true, @@ -32,8 +32,8 @@ "chain:anvil": "hardhat --config hardhat.anvil.config.ts node" }, "dependencies": { - "@cerc-io/nitro-node": "^0.1.15", - "@cerc-io/nitro-util": "^0.1.15", + "@cerc-nitro/nitro-node": "^0.2.7", + "@cerc-nitro/nitro-util": "^0.2.7", "assert": "^2.0.0", "debug": "^4.3.4", "dotenv": "^16.0.3", diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index bb6be336..df543437 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -5,10 +5,10 @@ import fs from 'fs'; import path from 'path'; import 'dotenv/config'; -import { utils } from '@cerc-io/nitro-node'; +import { utils } from '@cerc-nitro/nitro-node'; import { JSONbigNative, hex2Bytes, DEFAULT_CHAIN_URL_WEBSOCKET, DEFAULT_ASSET, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { waitForMultiplePeers } from './utils/index'; import contractAddresses from './nitro-addresses.json'; diff --git a/packages/server/src/types.ts b/packages/server/src/types.ts index 4b900fe5..5eeb65cb 100644 --- a/packages/server/src/types.ts +++ b/packages/server/src/types.ts @@ -1,4 +1,4 @@ -import { Exit } from '@cerc-io/nitro-node'; +import { Exit } from '@cerc-nitro/nitro-node'; /** * Objective params diff --git a/packages/server/src/utils/index.ts b/packages/server/src/utils/index.ts index 58bedd9e..e38524b0 100644 --- a/packages/server/src/utils/index.ts +++ b/packages/server/src/utils/index.ts @@ -1,6 +1,6 @@ import { P2PMessageService, -} from '@cerc-io/nitro-node'; +} from '@cerc-nitro/nitro-node'; // waitForPeerInfoExchange waits for all the P2PMessageServices to receive peer info from each other export async function waitForPeerInfoExchange(services: P2PMessageService[]) { diff --git a/packages/server/test-e2e/integration.test.ts b/packages/server/test-e2e/integration.test.ts index efb0fc74..21bd4d00 100644 --- a/packages/server/test-e2e/integration.test.ts +++ b/packages/server/test-e2e/integration.test.ts @@ -6,10 +6,10 @@ import { BigNumber } from 'ethers'; import { Node, Metrics, P2PMessageService, utils, Destination, LedgerChannelInfo, ChannelStatus, LedgerChannelBalance, PaymentChannelInfo, PaymentChannelBalance, ObjectiveResponse, deployContracts, -} from '@cerc-io/nitro-node'; +} from '@cerc-nitro/nitro-node'; import { hex2Bytes, DEFAULT_CHAIN_URL, DEFAULT_CHAIN_URL_WEBSOCKET, getBalanceByKey, getBalanceByAddress, -} from '@cerc-io/nitro-util'; +} from '@cerc-nitro/nitro-util'; import { DirectFundParams, diff --git a/packages/server/test-e2e/utils.ts b/packages/server/test-e2e/utils.ts index 3a217e86..71e75f48 100644 --- a/packages/server/test-e2e/utils.ts +++ b/packages/server/test-e2e/utils.ts @@ -1,4 +1,4 @@ -import { GetMetrics } from '@cerc-io/nitro-node'; +import { GetMetrics } from '@cerc-nitro/nitro-node'; export function getMetricsKey(arr: string[], address: string): string[] { return arr.map((element) => `${element},wallet=${address}`); diff --git a/yarn.lock b/yarn.lock index 8056888b..6222a9bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2337,6 +2337,20 @@ uint8arraylist "^2.4.3" uint8arrays "^4.0.2" +"@libp2p/crypto@^2.0.2": + version "2.0.8" + resolved "https://registry.yarnpkg.com/@libp2p/crypto/-/crypto-2.0.8.tgz#efa309944d2bd00427ae73d1ff2df72aaba38b0f" + integrity sha512-8e5fh6bsJNpSjhrggtlm8QF+BERjelJswIjRS69aKgxp24R4z2kDM4pRYPkfQjXJDLNDtqWtKNmePgX23+QJsA== + dependencies: + "@libp2p/interface" "^0.1.6" + "@noble/curves" "^1.1.0" + "@noble/hashes" "^1.3.1" + multiformats "^12.0.1" + node-forge "^1.1.0" + protons-runtime "^5.0.0" + uint8arraylist "^2.4.3" + uint8arrays "^4.0.6" + "@libp2p/floodsub@^6.0.0": version "6.0.3" resolved "https://registry.npmjs.org/@libp2p/floodsub/-/floodsub-6.0.3.tgz" @@ -2586,6 +2600,32 @@ "@multiformats/multiaddr" "^12.0.0" it-stream-types "^1.0.4" +"@libp2p/interface@^0.1.6": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@libp2p/interface/-/interface-0.1.6.tgz#1328cf6086f02c499183489ccb143fe9c159e871" + integrity sha512-Lzc5cS/hXuoXhuAbVIxJIHLCYmfPcbU0vVgrpMoiP1Qb2Q3ETU4A46GB8s8mWXgSU6tr9RcqerUqzFYD6+OAag== + dependencies: + "@multiformats/multiaddr" "^12.1.5" + abortable-iterator "^5.0.1" + it-pushable "^3.2.0" + it-stream-types "^2.0.1" + multiformats "^12.0.1" + p-defer "^4.0.0" + race-signal "^1.0.0" + uint8arraylist "^2.4.3" + +"@libp2p/interface@^1.0.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@libp2p/interface/-/interface-1.3.0.tgz#c4fcee2878aa8d37357974b6c7395cb2a645eb50" + integrity sha512-K72Km0Co1Z+pXpggWuoAvUUbvwZYvjCcywrHj2Ym3jt2anTE3hzL4rlZrrkzA0YhNTRFRiZ04dnu6WMXT5/4+A== + dependencies: + "@multiformats/multiaddr" "^12.2.1" + it-pushable "^3.2.3" + it-stream-types "^2.0.1" + multiformats "^13.1.0" + progress-events "^1.0.0" + uint8arraylist "^2.4.8" + "@libp2p/interfaces@^3.0.0", "@libp2p/interfaces@^3.0.2", "@libp2p/interfaces@^3.0.3", "@libp2p/interfaces@^3.2.0", "@libp2p/interfaces@^3.3.1": version "3.3.2" resolved "https://registry.npmjs.org/@libp2p/interfaces/-/interfaces-3.3.2.tgz" @@ -2689,6 +2729,20 @@ uint8arraylist "^2.0.0" uint8arrays "^4.0.2" +"@libp2p/peer-id-factory@^2.0.2": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@libp2p/peer-id-factory/-/peer-id-factory-2.0.4.tgz#ccf74ece34d16a069602e7cae28b1cb739803e0c" + integrity sha512-+0D+oklFzHpjRI3v7uw3PMMx00P36DV7YvAgL0+gpos0VzR/BI9tRiM6dpObZTrQ1hxp78F03p+qR1Zy9Qnmuw== + dependencies: + "@libp2p/crypto" "^1.0.0" + "@libp2p/interface-keys" "^1.0.2" + "@libp2p/interface-peer-id" "^2.0.0" + "@libp2p/peer-id" "^2.0.0" + multiformats "^11.0.0" + protons-runtime "^5.0.0" + uint8arraylist "^2.0.0" + uint8arrays "^4.0.2" + "@libp2p/peer-id@^2.0.0", "@libp2p/peer-id@^2.0.1": version "2.0.3" resolved "https://registry.npmjs.org/@libp2p/peer-id/-/peer-id-2.0.3.tgz" @@ -2699,6 +2753,16 @@ multiformats "^11.0.0" uint8arrays "^4.0.2" +"@libp2p/peer-id@^2.0.2": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@libp2p/peer-id/-/peer-id-2.0.4.tgz#d50d2ae4663ef79f6e31ce4eaf25e1f44e1667ab" + integrity sha512-gcOsN8Fbhj6izIK+ejiWsqiqKeJ2yWPapi/m55VjOvDa52/ptQzZszxQP8jUk93u36de92ATFXDfZR/Bi6eeUQ== + dependencies: + "@libp2p/interface-peer-id" "^2.0.0" + "@libp2p/interfaces" "^3.2.0" + multiformats "^11.0.0" + uint8arrays "^4.0.2" + "@libp2p/peer-record@^5.0.0": version "5.0.3" resolved "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-5.0.3.tgz" @@ -2875,6 +2939,19 @@ tweetnacl "^1.0.3" tweetnacl-util "^0.15.1" +"@multiformats/dns@^1.0.3": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@multiformats/dns/-/dns-1.0.6.tgz#b8c7de11459a02a5f4e609d35d3cdb95cb6ad152" + integrity sha512-nt/5UqjMPtyvkG9BQYdJ4GfLK3nMqGpFZOzf4hAmIa0sJh2LlS9YKXZ4FgwBDsaHvzZqR/rUFIywIc7pkHNNuw== + dependencies: + "@types/dns-packet" "^5.6.5" + buffer "^6.0.3" + dns-packet "^5.6.1" + hashlru "^2.3.0" + p-queue "^8.0.1" + progress-events "^1.0.0" + uint8arrays "^5.0.2" + "@multiformats/mafmt@^11.0.2": version "11.1.2" resolved "https://registry.npmjs.org/@multiformats/mafmt/-/mafmt-11.1.2.tgz" @@ -2921,6 +2998,19 @@ uint8arrays "^4.0.2" varint "^6.0.0" +"@multiformats/multiaddr@^12.1.5", "@multiformats/multiaddr@^12.2.1": + version "12.2.1" + resolved "https://registry.yarnpkg.com/@multiformats/multiaddr/-/multiaddr-12.2.1.tgz#d95d1590b17dbe39dcefbb4d832d14434d3fe075" + integrity sha512-UwjoArBbv64FlaetV4DDwh+PUMfzXUBltxQwdh+uTYnGFzVa8ZfJsn1vt1RJlJ6+Xtrm3RMekF/B+K338i2L5Q== + dependencies: + "@chainsafe/is-ip" "^2.0.1" + "@chainsafe/netmask" "^2.0.0" + "@libp2p/interface" "^1.0.0" + "@multiformats/dns" "^1.0.3" + multiformats "^13.0.0" + uint8-varint "^2.0.1" + uint8arrays "^5.0.0" + "@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": version "5.1.1-v1" resolved "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz" @@ -2928,6 +3018,13 @@ dependencies: eslint-scope "5.1.1" +"@noble/curves@^1.1.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.4.0.tgz#f05771ef64da724997f69ee1261b2417a49522d6" + integrity sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg== + dependencies: + "@noble/hashes" "1.4.0" + "@noble/ed25519@^1.6.0": version "1.7.3" resolved "https://registry.npmjs.org/@noble/ed25519/-/ed25519-1.7.3.tgz" @@ -2938,6 +3035,11 @@ resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz" integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== +"@noble/hashes@1.4.0", "@noble/hashes@^1.3.1": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + "@noble/secp256k1@1.7.1", "@noble/secp256k1@^1.5.4", "@noble/secp256k1@~1.7.0": version "1.7.1" resolved "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz" @@ -4274,6 +4376,13 @@ dependencies: "@types/ms" "*" +"@types/dns-packet@^5.6.5": + version "5.6.5" + resolved "https://registry.yarnpkg.com/@types/dns-packet/-/dns-packet-5.6.5.tgz#49fc29a40f5d30227ed028fa1ee82601d3745e15" + integrity sha512-qXOC7XLOEe43ehtWJCMnQXvgcIpv6rPmQ1jXT98Ad8A3TB1Ue50jsCbSSSyuazScEuZ/Q026vHbrOTVkmwA+7Q== + dependencies: + "@types/node" "*" + "@types/eslint-scope@^3.7.3": version "3.7.4" resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz" @@ -4971,7 +5080,7 @@ abortable-iterator@^4.0.2: get-iterator "^2.0.0" it-stream-types "^1.0.3" -abortable-iterator@^5.0.0: +abortable-iterator@^5.0.0, abortable-iterator@^5.0.1: version "5.0.1" resolved "https://registry.npmjs.org/abortable-iterator/-/abortable-iterator-5.0.1.tgz" integrity sha512-hlZ5Z8UwqrKsJcelVPEqDduZowJPBQJ9ZhBC2FXpja3lXy8X6MoI5uMzIgmrA8+3jcVnp8TF/tx+IBBqYJNUrg== @@ -5478,6 +5587,14 @@ babel-loader@^8.2.3: make-dir "^3.1.0" schema-utils "^2.6.5" +babel-loader@^9.1.3: + version "9.1.3" + resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-9.1.3.tgz#3d0e01b4e69760cc694ee306fe16d358aa1c6f9a" + integrity sha512-xG3ST4DglodGf8qSwv0MdeWLhrDsw/32QMdTO5T1ZIp9gQur0HkCyFs7Awskr10JKXFXwpAhiCuYX5oGXnRGbw== + dependencies: + find-cache-dir "^4.0.0" + schema-utils "^4.0.0" + babel-plugin-istanbul@^6.1.1: version "6.1.1" resolved "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz" @@ -7181,6 +7298,13 @@ dns-packet@^5.2.2: dependencies: "@leichtgewicht/ip-codec" "^2.0.1" +dns-packet@^5.6.1: + version "5.6.1" + resolved "https://registry.yarnpkg.com/dns-packet/-/dns-packet-5.6.1.tgz#ae888ad425a9d1478a0674256ab866de1012cf2f" + integrity sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw== + dependencies: + "@leichtgewicht/ip-codec" "^2.0.1" + doctrine@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz" @@ -8072,6 +8196,11 @@ eventemitter3@^4.0.0, eventemitter3@^4.0.4, eventemitter3@^4.0.7: resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz" integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw== +eventemitter3@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" + integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== + events@^3.2.0, events@^3.3.0: version "3.3.0" resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz" @@ -8312,6 +8441,14 @@ find-cache-dir@^3.3.1: make-dir "^3.0.2" pkg-dir "^4.1.0" +find-cache-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-4.0.0.tgz#a30ee0448f81a3990708f6453633c733e2f6eec2" + integrity sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg== + dependencies: + common-path-prefix "^3.0.0" + pkg-dir "^7.0.0" + find-replace@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz" @@ -8349,6 +8486,14 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" + integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw== + dependencies: + locate-path "^7.1.0" + path-exists "^5.0.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz" @@ -9062,6 +9207,11 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: inherits "^2.0.3" minimalistic-assert "^1.0.1" +hashlru@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/hashlru/-/hashlru-2.3.0.tgz#5dc15928b3f6961a2056416bb3a4910216fdfb51" + integrity sha512-0cMsjjIC8I+D3M44pOQdsy0OHXGLVz6Z0beRuufhKa0KfaD2wGwAev6jILzXsd3/vpnNQJmWyZtIILqM1N+n5A== + he@1.2.0, he@^1.2.0: version "1.2.0" resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" @@ -10060,7 +10210,7 @@ it-pb-stream@^3.2.0: uint8-varint "^1.0.6" uint8arraylist "^2.0.0" -it-pipe@^2.0.3, it-pipe@^2.0.4, it-pipe@^2.0.5: +it-pipe@^2.0.1, it-pipe@^2.0.3, it-pipe@^2.0.4, it-pipe@^2.0.5: version "2.0.5" resolved "https://registry.npmjs.org/it-pipe/-/it-pipe-2.0.5.tgz" integrity sha512-y85nW1N6zoiTnkidr2EAyC+ZVzc7Mwt2p+xt2a2ooG1ThFakSpNw1Kxm+7F13Aivru96brJhjQVRQNU+w0yozw== @@ -10069,7 +10219,7 @@ it-pipe@^2.0.3, it-pipe@^2.0.4, it-pipe@^2.0.5: it-pushable "^3.1.0" it-stream-types "^1.0.3" -it-pipe@^3.0.0, it-pipe@^3.0.1: +it-pipe@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/it-pipe/-/it-pipe-3.0.1.tgz" integrity sha512-sIoNrQl1qSRg2seYSBH/3QxWhJFn9PKYvOf/bHdtCBF0bnghey44VyASsWzn5dAx0DCDDABq1hZIuzKmtBZmKA== @@ -10083,6 +10233,13 @@ it-pushable@^3.0.0, it-pushable@^3.1.0, it-pushable@^3.1.2, it-pushable@^3.1.3: resolved "https://registry.npmjs.org/it-pushable/-/it-pushable-3.1.3.tgz" integrity sha512-f50iQ85HISS6DaWCyrqf9QJ6G/kQtKIMf9xZkgZgyOvxEQDfn8OfYcLXXquCqgoLboxQtAW1ZFZyFIAsLHDtJw== +it-pushable@^3.2.0, it-pushable@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/it-pushable/-/it-pushable-3.2.3.tgz#e2b80aed90cfbcd54b620c0a0785e546d4e5f334" + integrity sha512-gzYnXYK8Y5t5b/BnJUr7glfQLO4U5vyb05gPx/TyTw+4Bv1zM9gFk4YsOrnulWefMewlphCjKkakFvj1y99Tcg== + dependencies: + p-defer "^4.0.0" + it-reader@^6.0.1: version "6.0.4" resolved "https://registry.npmjs.org/it-reader/-/it-reader-6.0.4.tgz" @@ -11118,6 +11275,13 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" +locate-path@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-7.2.0.tgz#69cb1779bd90b35ab1e771e1f2f89a202c2a8a8a" + integrity sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA== + dependencies: + p-locate "^6.0.0" + lodash.camelcase@^4.3.0: version "4.3.0" resolved "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz" @@ -11771,6 +11935,16 @@ multiformats@^11.0.0, multiformats@^11.0.2: resolved "https://registry.npmjs.org/multiformats/-/multiformats-11.0.2.tgz" integrity sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg== +multiformats@^12.0.1: + version "12.1.3" + resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-12.1.3.tgz#cbf7a9861e11e74f8228b21376088cb43ba8754e" + integrity sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw== + +multiformats@^13.0.0, multiformats@^13.1.0: + version "13.1.0" + resolved "https://registry.yarnpkg.com/multiformats/-/multiformats-13.1.0.tgz#5aa9d2175108a448fc3bdb54ba8a3d0b6cab3ac3" + integrity sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ== + multimatch@5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz" @@ -12488,6 +12662,13 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" +p-locate@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-6.0.0.tgz#3da9a49d4934b901089dca3302fa65dc5a05c04f" + integrity sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw== + dependencies: + p-limit "^4.0.0" + p-map-series@2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/p-map-series/-/p-map-series-2.1.0.tgz" @@ -12521,6 +12702,14 @@ p-queue@^7.2.0: eventemitter3 "^4.0.7" p-timeout "^5.0.2" +p-queue@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/p-queue/-/p-queue-8.0.1.tgz#718b7f83836922ef213ddec263ff4223ce70bef8" + integrity sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA== + dependencies: + eventemitter3 "^5.0.1" + p-timeout "^6.1.2" + p-reduce@2.1.0, p-reduce@^2.0.0, p-reduce@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz" @@ -12564,6 +12753,11 @@ p-timeout@^6.0.0: resolved "https://registry.npmjs.org/p-timeout/-/p-timeout-6.1.1.tgz" integrity sha512-yqz2Wi4fiFRpMmK0L2pGAU49naSUaP23fFIQL2Y6YT+qDGPoFwpvgQM/wzc6F8JoenUkIlAFa4Ql7NguXBxI7w== +p-timeout@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/p-timeout/-/p-timeout-6.1.2.tgz#22b8d8a78abf5e103030211c5fc6dee1166a6aa5" + integrity sha512-UbD77BuZ9Bc9aABo74gfXhNvzC9Tx7SxtHSh1fxvx3jTLLYvmVhiQZZrJzqqU0jKbN32kb5VOKiLEQI/3bIjgQ== + p-try@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz" @@ -12718,6 +12912,11 @@ path-exists@^4.0.0: resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== +path-exists@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7" + integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" @@ -12826,6 +13025,13 @@ pkg-dir@^4.1.0, pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +pkg-dir@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-7.0.0.tgz#8f0c08d6df4476756c5ff29b3282d0bab7517d11" + integrity sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA== + dependencies: + find-up "^6.3.0" + pkg-up@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz" @@ -13476,6 +13682,11 @@ process@^0.11.10: resolved "https://registry.npmjs.org/process/-/process-0.11.10.tgz" integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== +progress-events@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/progress-events/-/progress-events-1.0.0.tgz#34f5e8fdb5dae3561837b22672d1e02277bb2109" + integrity sha512-zIB6QDrSbPfRg+33FZalluFIowkbV5Xh1xSuetjG+rlC5he6u2dc6VQJ0TbMdlN3R1RHdpOqxEFMKTnQ+itUwA== + promise-all-reject-late@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz" @@ -13648,6 +13859,11 @@ quick-lru@^4.0.1: resolved "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== +race-signal@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/race-signal/-/race-signal-1.0.2.tgz#e42379fba0cec4ee8dab7c9bbbd4aa6e0d14c25f" + integrity sha512-o3xNv0iTcIDQCXFlF6fPAMEBRjFxssgGoRqLbg06m+AdzEXXLUmoNOoUHTVz2NoBI8hHwKFKoC6IqyNtWr2bww== + raf@^3.4.1: version "3.4.1" resolved "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz" @@ -14908,7 +15124,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.npmjs.org/string-natural-compare/-/string-natural-compare-3.0.1.tgz" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -14925,6 +15141,15 @@ string-natural-compare@^3.0.1: is-fullwidth-code-point "^2.0.0" strip-ansi "^4.0.0" +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz" @@ -14998,7 +15223,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -15012,6 +15237,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1: version "7.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz" @@ -15726,6 +15958,14 @@ uint8-varint@^1.0.1, uint8-varint@^1.0.2, uint8-varint@^1.0.6: uint8arraylist "^2.0.0" uint8arrays "^4.0.2" +uint8-varint@^2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/uint8-varint/-/uint8-varint-2.0.4.tgz#85be52b3849eb30f2c3640a2df8a14364180affb" + integrity sha512-FwpTa7ZGA/f/EssWAb5/YV6pHgVF1fViKdW8cWaEarjB8t7NyofSWBdOTyFPaGuUG4gx3v1O3PQ8etsiOs3lcw== + dependencies: + uint8arraylist "^2.0.0" + uint8arrays "^5.0.0" + uint8arraylist@^2.0.0, uint8arraylist@^2.1.0, uint8arraylist@^2.1.1, uint8arraylist@^2.1.2, uint8arraylist@^2.3.1, uint8arraylist@^2.3.2, uint8arraylist@^2.4.1, uint8arraylist@^2.4.3: version "2.4.3" resolved "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.3.tgz" @@ -15733,6 +15973,13 @@ uint8arraylist@^2.0.0, uint8arraylist@^2.1.0, uint8arraylist@^2.1.1, uint8arrayl dependencies: uint8arrays "^4.0.2" +uint8arraylist@^2.4.8: + version "2.4.8" + resolved "https://registry.yarnpkg.com/uint8arraylist/-/uint8arraylist-2.4.8.tgz#5a4d17f4defd77799cb38e93fd5db0f0dceddc12" + integrity sha512-vc1PlGOzglLF0eae1M8mLRTBivsvrGsdmJ5RbK3e+QRvRLOZfZhQROTwH/OfyF3+ZVUg9/8hE8bmKP2CvP9quQ== + dependencies: + uint8arrays "^5.0.1" + uint8arrays@^4.0.2, uint8arrays@^4.0.3: version "4.0.3" resolved "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.3.tgz" @@ -15740,6 +15987,20 @@ uint8arrays@^4.0.2, uint8arrays@^4.0.3: dependencies: multiformats "^11.0.0" +uint8arrays@^4.0.6: + version "4.0.10" + resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-4.0.10.tgz#3ec5cde3348903c140e87532fc53f46b8f2e921f" + integrity sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA== + dependencies: + multiformats "^12.0.1" + +uint8arrays@^5.0.0, uint8arrays@^5.0.1, uint8arrays@^5.0.2: + version "5.0.3" + resolved "https://registry.yarnpkg.com/uint8arrays/-/uint8arrays-5.0.3.tgz#92b894d9c4269ba97c51544d6e1f279fe6f80d1f" + integrity sha512-6LBuKji28kHjgPJMkQ6GDaBb1lRwIhyOYq6pDGwYMoDPfImE9SkuYENVmR0yu9yGgs2clHUSY9fKDukR+AXfqQ== + dependencies: + multiformats "^13.0.0" + unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz" @@ -16542,7 +16803,16 @@ workerpool@6.2.1: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==