diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 85c6ac190..f0e55d4cd 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -9,16 +9,20 @@ jobs:
strategy:
matrix:
node-version: [14.x]
-
+
steps:
- - uses: actions/checkout@v2.3.4
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v1
- with:
- node-version: ${{ matrix.node-version }}
- - name: yarn install, build and run tests
- run: |
- yarn install --frozen-lockfile
- yarn build
- yarn test:once
- yarn lint
+ - uses: actions/checkout@v2.3.4
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v1
+ with:
+ node-version: ${{ matrix.node-version }}
+ - name: yarn install, build and run tests
+ run: |
+ yarn install --frozen-lockfile
+ yarn build
+ yarn test:once --coverage
+ yarn lint
+ - name: Upload coverage reports to Codecov
+ uses: codecov/codecov-action@v3
+ with:
+ token: ${{ secrets.CODECOV_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 398039c40..6b61cd390 100755
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
.DS_Store
node_modules
dist
+coverage
# Remove some common IDE working directories
.idea
diff --git a/README.md b/README.md
index 30aa90879..059fa1ead 100755
--- a/README.md
+++ b/README.md
@@ -2,31 +2,57 @@
[![npm](https://img.shields.io/npm/v/@snapshot-labs/snapshot.js?label=npm)](https://www.npmjs.com/package/@snapshot-labs/snapshot.js)
-### Install
+## Install
+
Snapshot.js was designed to work both in the browser and in Node.js.
-#### Node.js
+### In Node Applications
+
To install Snapshot.js on Node.js, open your terminal and run:
-```
+
+```bash
npm i @snapshot-labs/snapshot.js
```
#### Browser
+
You can create an index.html file and include Snapshot.js with:
+
```html
```
+
### Development
#### Install dependencies
+
```bash
yarn
```
#### Build package
+
```bash
yarn build
```
+#### Test cases
+
+```bash
+yarn test
+# or
+yarn test:once
+```
+
+#### Other useful scripts
+
+```bash
+# Format ABI
+ts-node scripts/abi.ts
+# Generate hash for types
+ts-node scripts/generateHashWithTypes.ts
+```
+
### License
+
[MIT](LICENSE).
diff --git a/package.json b/package.json
index 0be9100d2..76ee4fce6 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@snapshot-labs/snapshot.js",
- "version": "0.4.50",
+ "version": "0.4.103",
"repository": "snapshot-labs/snapshot.js",
"license": "MIT",
"main": "dist/snapshot.cjs.js",
@@ -15,10 +15,11 @@
"@ethersproject/contracts": "^5.6.2",
"@ethersproject/hash": "^5.6.1",
"@ethersproject/providers": "^5.6.8",
+ "@ethersproject/units": "^5.7.0",
"@ethersproject/wallet": "^5.6.2",
"ajv": "^8.11.0",
"ajv-formats": "^2.1.1",
- "cross-fetch": "^3.1.5",
+ "cross-fetch": "^3.1.6",
"json-to-graphql-query": "^2.2.4",
"lodash.set": "^4.3.2"
},
@@ -28,6 +29,7 @@
"@types/node": "^13.9.5",
"@typescript-eslint/eslint-plugin": "^4.28.2",
"@typescript-eslint/parser": "^4.33.0",
+ "@vitest/coverage-v8": "^0.32.2",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-plugin-import": "^2.20.2",
@@ -42,7 +44,7 @@
"rollup-plugin-terser": "^7.0.0",
"rollup-plugin-typescript2": "^0.27.0",
"typescript": "^3.8.3",
- "vitest": "^0.22.1"
+ "vitest": "^0.32.1"
},
"scripts": {
"build": "rollup -c",
diff --git a/test/abi.ts b/scripts/abi.ts
similarity index 100%
rename from test/abi.ts
rename to scripts/abi.ts
diff --git a/scripts/generateHashWithTypes.ts b/scripts/generateHashWithTypes.ts
new file mode 100644
index 000000000..f8c820a4b
--- /dev/null
+++ b/scripts/generateHashWithTypes.ts
@@ -0,0 +1,16 @@
+const { createHash } = require('crypto');
+
+const types = {
+ Statement: [
+ { name: 'from', type: 'address' },
+ { name: 'timestamp', type: 'uint64' },
+ { name: 'space', type: 'string' },
+ { name: 'about', type: 'string' },
+ { name: 'statement', type: 'string' }
+ ]
+};
+function sha256(str) {
+ return createHash('sha256').update(str).digest('hex');
+}
+const hash = sha256(JSON.stringify(types));
+console.log(hash);
diff --git a/src/client.ts b/src/client.ts
deleted file mode 100755
index 450dd476a..000000000
--- a/src/client.ts
+++ /dev/null
@@ -1,136 +0,0 @@
-import fetch from 'cross-fetch';
-import { Web3Provider } from '@ethersproject/providers';
-import { signMessage } from './utils/web3';
-import hubs from './hubs.json';
-import { version } from './constants.json';
-
-export default class Client {
- readonly address: string;
-
- constructor(address: string = hubs[0]) {
- this.address = address;
- }
-
- request(command: string, body?: any) {
- const url = `${this.address}/api/${command}`;
- let init;
- if (body) {
- init = {
- method: 'POST',
- headers: {
- Accept: 'application/json',
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(body)
- };
- }
- return new Promise((resolve, reject) => {
- fetch(url, init)
- .then((res) => {
- if (res.ok) return resolve(res.json());
- throw res;
- })
- .catch((e) => e.json().then((json) => reject(json)));
- });
- }
-
- async send(msg: any) {
- return this.request('message', msg);
- }
-
- async getSpaces() {
- return this.request('spaces');
- }
-
- async broadcast(
- web3: Web3Provider,
- account: string,
- space: string,
- type: string,
- payload: any
- ) {
- const msg: any = {
- address: account,
- msg: JSON.stringify({
- version,
- timestamp: (Date.now() / 1e3).toFixed(),
- space,
- type,
- payload
- })
- };
- msg.sig = await signMessage(web3, msg.msg, account);
- return await this.send(msg);
- }
-
- async sign(
- web3: Web3Provider,
- account: string,
- space: string,
- type: string,
- payload: any
- ) {
- const msg: any = {
- address: account,
- msg: JSON.stringify({
- version,
- timestamp: (Date.now() / 1e3).toFixed(),
- space,
- type,
- payload
- })
- };
- return await signMessage(web3, msg.msg, account);
- }
-
- async vote(web3: Web3Provider, address: string, space, { proposal, choice }) {
- return this.broadcast(web3, address, space, 'vote', {
- proposal,
- choice
- });
- }
-
- async proposal(
- web3: Web3Provider,
- address: string,
- space: string,
- {
- name,
- body,
- discussion = '',
- choices,
- start,
- end,
- snapshot,
- type = 'single-choice',
- metadata = {}
- }
- ) {
- return this.broadcast(web3, address, space, 'proposal', {
- name,
- body,
- discussion,
- choices,
- start,
- end,
- snapshot,
- type,
- metadata
- });
- }
-
- async deleteProposal(
- web3: Web3Provider,
- address: string,
- space: string,
- { proposal }
- ) {
- return this.broadcast(web3, address, space, 'delete-proposal', {
- proposal
- });
- }
-
- async settings(web3: Web3Provider, address: string, space: string, settings) {
- return this.broadcast(web3, address, space, 'settings', settings);
- }
-}
diff --git a/src/constants.json b/src/constants.json
index 0f0a0d928..2ffac8c76 100644
--- a/src/constants.json
+++ b/src/constants.json
@@ -1,3 +1,14 @@
{
- "version": "0.1.3"
+ "livenet": {
+ "hub": "https://hub.snapshot.org",
+ "sequencer": "https://seq.snapshot.org"
+ },
+ "testnet": {
+ "hub": "https://testnet.snapshot.org",
+ "sequencer": "https://testnet.seq.snapshot.org"
+ },
+ "local": {
+ "hub": "http://localhost:3000",
+ "sequencer": "http://localhost:3001"
+ }
}
diff --git a/src/delegationSubgraphs.json b/src/delegationSubgraphs.json
index 3f3ecb377..dc3cdbec7 100644
--- a/src/delegationSubgraphs.json
+++ b/src/delegationSubgraphs.json
@@ -1,12 +1,10 @@
{
- "1": "https://gateway.thegraph.com/api/0f15b42bdeff7a063a4e1757d7e2f99e/deployments/id/QmXZiV6S13ha6QXq4dmaM3TB4CHcDxBMvGexSNu9Kc28EH",
- "4": "https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-rinkeby",
- "5": "https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-goerli",
- "10": "https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-optimism",
- "42": "https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-kovan",
- "56": "https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-binance-smart-chain",
- "100": "https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-gnosis-chain",
- "137": "https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-polygon",
- "250": "https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-fantom",
- "42161": "https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-arbitrum"
+ "1": "https://subgrapher.snapshot.org/gateway.thegraph.com/api/0f15b42bdeff7a063a4e1757d7e2f99e/deployments/id/QmXZiV6S13ha6QXq4dmaM3TB4CHcDxBMvGexSNu9Kc28EH",
+ "5": "https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-goerli",
+ "10": "https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-optimism",
+ "56": "https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-binance-smart-chain",
+ "100": "https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-gnosis-chain",
+ "137": "https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-polygon",
+ "250": "https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-fantom",
+ "42161": "https://subgrapher.snapshot.org/api.thegraph.com/subgraphs/name/snapshot-labs/snapshot-arbitrum"
}
diff --git a/src/hubs.json b/src/hubs.json
deleted file mode 100644
index f56703666..000000000
--- a/src/hubs.json
+++ /dev/null
@@ -1,4 +0,0 @@
-[
- "https://hub.snapshot.org",
- "https://testnet.snapshot.org"
-]
diff --git a/src/index.ts b/src/index.ts
index 4944237dc..2ae7ae97a 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,10 +1,9 @@
import Client712 from './sign';
-import Client from './client';
import schemas from './schemas';
import utils from './utils';
export default {
- Client,
+ Client: Client712,
Client712,
schemas,
utils
diff --git a/src/networks.json b/src/networks.json
index 3332a1b9d..df5a5e686 100644
--- a/src/networks.json
+++ b/src/networks.json
@@ -5,7 +5,11 @@
"chainId": 1,
"network": "homestead",
"multicall": "0xeefba1e63905ef1d7acba5a8513c70307c1ce441",
- "ensResolver": "0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41",
+ "ensResolvers": [
+ "0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63",
+ "0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"
+ ],
+ "ensNameWrapper": "0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401",
"rpc": [
"https://rpc.ankr.com/eth",
{
@@ -24,8 +28,8 @@
"ws": [
"wss://eth-mainnet.ws.alchemyapi.io/v2/4bdDVB5QAaorY2UE-GBUbM2yQB3QJqzv"
],
- "explorer":{
- "url": "https://etherscan.io",
+ "explorer": {
+ "url": "https://etherscan.io",
"apiUrl": "https://api.etherscan.io"
},
"start": 7929876,
@@ -33,13 +37,17 @@
},
"5": {
"key": "5",
- "name": "Ethereum Testnet Görli",
- "shortName": "Görli",
+ "name": "Ethereum Testnet Goerli",
+ "shortName": "Goerli",
"chainId": 5,
"network": "goerli",
"testnet": true,
"multicall": "0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e",
- "ensResolver": "0x4B1488B7a6B320d2D721406204aBc3eeAa9AD329",
+ "ensResolvers": [
+ "0xd7a4F6473f32aC2Af804B3686AE8F1932bC35750",
+ "0x4B1488B7a6B320d2D721406204aBc3eeAa9AD329"
+ ],
+ "ensNameWrapper": "0x114D4603199df73e7D157787f8778E21fCd13066",
"rpc": [
"https://eth-goerli.alchemyapi.io/v2/v4nqH_J-J3STit45Mm07TxuYexMHQsYZ"
],
@@ -260,6 +268,22 @@
},
"logo": "ipfs://QmTpySsG7rjLwuZX1Ep4ewGyVAyGrvCRC1oqEvU6oP1huf"
},
+ "46": {
+ "key": "46",
+ "name": "Darwinia Network",
+ "shortName": "Darwinia",
+ "chainId": 46,
+ "network": "mainnet",
+ "multicall": "0x67f9ae42EaA9a8aBf065D60ec6Ab3C1A11370607",
+ "rpc": [
+ "https://rpc.darwinia.network"
+ ],
+ "explorer": {
+ "url": "https://darwinia.subscan.io"
+ },
+ "start": 141853,
+ "logo": "ipfs://bafkreicf55maidhx46pyu3mwsshlr43xbewr6tkckkonh4nesbkp7krwkm"
+ },
"50": {
"key": "50",
"name": "XDC.Network",
@@ -672,7 +696,7 @@
"wss://ws-mainnet.matic.network"
],
"explorer": {
- "url": "https://polygonscan.com",
+ "url": "https://polygonscan.com",
"apiUrl": "https://api.polygonscan.com"
},
"start": 9834491,
@@ -770,20 +794,36 @@
},
"280": {
"key": "280",
- "name": "zkSync 2 testnet",
- "shortName": "zkSync2",
+ "name": "zkSync Era Testnet",
+ "shortName": "zkSync testnet",
"chainId": 280,
"network": "zkSync alpha testnet",
"testnet": true,
- "multicall": "0xD2CF10EF0b64B2C9B7147740AEda677d3EfeD2f8",
+ "multicall": "0xbDAd32d600915cB70576D3d935d49bFf3C9cB0CF",
"rpc": [
- "https://zksync2-testnet.zksync.dev"
+ "https://testnet.era.zksync.dev"
],
"explorer": {
- "url": "https://zksync2-testnet.zkscan.io/"
+ "url": "https://goerli.explorer.zksync.io/"
},
- "start": 1374275,
- "logo": "ipfs://QmPDbdmwpEeenaLHAbqcAerXdH9Z4Gfd7gm9M8tbkkjcAS"
+ "start": 9012429,
+ "logo": "ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy"
+ },
+ "324": {
+ "key": "324",
+ "name": "zkSync Era",
+ "shortName": "zkSync-era",
+ "chainId": 324,
+ "network": "zkSync Era Mainnet",
+ "multicall": "0xF9cda624FBC7e059355ce98a31693d299FACd963",
+ "rpc": [
+ "https://mainnet.era.zksync.io"
+ ],
+ "explorer": {
+ "url": "https://explorer.zksync.io/"
+ },
+ "start": 3908235,
+ "logo": "ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy"
},
"288": {
"key": "288",
@@ -853,6 +893,22 @@
"start": 12559216,
"logo": "ipfs://QmcMP9s9mUqfT2SCiP75sZgAVVev7H7RQAKiSx9xWEDKwe"
},
+ "369": {
+ "key": "369",
+ "name": "Pulsechain Mainnet",
+ "shortName": "Pulsechain",
+ "chainId": 369,
+ "network": "mainnet",
+ "multicall": "0xdbdd0FD8B16F0092f306392b699D7fbddaA9011B",
+ "rpc": [
+ "https://rpc.pulsechain.com"
+ ],
+ "explorer": {
+ "url": "https://scan.pulsechain.com/"
+ },
+ "start": 17657774,
+ "logo": "ipfs://QmWUsiEWdejtHZ9B9981TYXn7Ds8C7fkB1S4h5rP3kCCZR"
+ },
"416": {
"key": "416",
"name": "SX Network",
@@ -941,6 +997,81 @@
"start": 1335512,
"logo": "ipfs://QmY1ZYBUzb46Mto7G1GitQWfaqq6n8Q4WArxFBzhNdLqvg"
},
+ "599": {
+ "key": "599",
+ "name": "Metis Testnet",
+ "chainId": 599,
+ "network": "testnet",
+ "testnet": true,
+ "multicall": "0x5A958c159F4AEA990b1195C44624B94dC0825470",
+ "rpc": [
+ "https://goerli.gateway.metisdevops.link"
+ ],
+ "explorer": {
+ "url": "https://goerli.explorer.metisdevops.link/"
+ },
+ "start": 1018715,
+ "logo": "ipfs://QmYeskHqrEvWHqeAuqett64LxfH52HUXZi2T9BAMmgKvBF"
+ },
+ "647": {
+ "key": "647",
+ "name": "SX Network Testnet",
+ "shortName": "647",
+ "chainId": 647,
+ "network": "testnet",
+ "testnet": true,
+ "multicall": "0x750e0f8efD3c3cF41c4D8BB0355d659bCbc75dB9",
+ "rpc": [
+ "https://rpc.toronto.sx.technology"
+ ],
+ "ws": [
+ "wss://rpc.toronto.sx.technology/ws"
+ ],
+ "explorer": {
+ "url": "https://explorer.toronto.sx.technology"
+ },
+ "start": 14441039,
+ "logo": "ipfs://QmSXLXqyr2H6Ja5XrmznXbWTEvF2gFaL8RXNXgyLmDHjAF"
+ },
+ "841": {
+ "key": "841",
+ "name": "Taraxa Mainnet",
+ "shortName": "841",
+ "chainId": 841,
+ "network": "mainnet",
+ "multicall": "0xFCe7a3121B42664AaD145712e1c2Bf2e38f60AA1",
+ "rpc": [
+ "https://rpc.mainnet.taraxa.io"
+ ],
+ "ws": [
+ "wss://ws.mainnet.taraxa.io"
+ ],
+ "explorer": {
+ "url": "https://mainnet.explorer.taraxa.io"
+ },
+ "start": 1515906,
+ "logo": "ipfs://Qmcc6ZCAGESMzZzoj5LsTVcCo2E35x3Ydk71uPJyov6Mwx"
+ },
+ "842": {
+ "key": "842",
+ "name": "Taraxa Testnet",
+ "shortName": "842",
+ "chainId": 842,
+ "network": "testnet",
+ "testnet": true,
+ "multicall": "0x7749051abc57e1105941Ea3Eb2a3F873F300E861",
+ "rpc": [
+ "https://rpc.testnet.taraxa.io"
+ ],
+ "ws": [
+ "wss://ws.testnet.taraxa.io"
+ ],
+ "explorer": {
+ "url": "https://testnet.explorer.taraxa.io"
+ },
+ "start": 1462328,
+ "logo": "ipfs://Qmcc6ZCAGESMzZzoj5LsTVcCo2E35x3Ydk71uPJyov6Mwx"
+ },
"888": {
"key": "888",
"name": "Wanchain",
@@ -1013,6 +1144,22 @@
"start": 451,
"logo": "ipfs://QmYeskHqrEvWHqeAuqett64LxfH52HUXZi2T9BAMmgKvBF"
},
+ "1234": {
+ "key": "1234",
+ "name": "Step Network",
+ "shortName": "stepnetwork",
+ "chainId": 1234,
+ "network": "mainnet",
+ "multicall": "0x176CcFFbAB792Aaa0da7C430FE20a7106d969f66",
+ "rpc": [
+ "https://rpc.step.network"
+ ],
+ "explorer": {
+ "url": "https://stepscan.io"
+ },
+ "start": 22,
+ "logo": "ipfs://QmUj734i8ggjnKhaoA346cA7rEuE5GkV4aDXQ1EKaQWdEF"
+ },
"1284": {
"key": "1284",
"name": "Moonbeam",
@@ -1024,7 +1171,7 @@
"https://rpc.api.moonbeam.network"
],
"explorer": {
- "url": "https://blockscout.moonbeam.network"
+ "url": "https://moonscan.io/"
},
"start": 171135,
"logo": "ipfs://QmWKTEK2pj5sBBbHnMHQbWgw6euVdBrk2Ligpi2chrWASk"
@@ -1078,6 +1225,22 @@
"start": 1893,
"logo": "ipfs://QmXbBMMhjTTGAGjmqMpJm3ufFrtdkfEXCFyXYgz7nnZzsy"
},
+ "1663": {
+ "key": "1663",
+ "name": "Horizen Gobi Testnet",
+ "shortName": "Gobi",
+ "chainId": 1663,
+ "network": "testnet",
+ "multicall": "0xC743e4910Bdd4e5aBacCA38F74cdA270281C5eef",
+ "rpc": [
+ "https://gobi-testnet.horizenlabs.io/ethv1"
+ ],
+ "explorer": {
+ "url": "https://gobi-explorer.horizen.io"
+ },
+ "start": 1,
+ "logo": "ipfs://QmUYQdsnkUoiDiQ3WaWrtH7fsc5yQDC7kZJCHmC2qWPTPt"
+ },
"1818": {
"key": "1818",
"name": "Cubechain mainnet",
@@ -1144,6 +1307,87 @@
"start": 19454413,
"logo": "ipfs://bafkreihh4y35xgshx7wbf7a2xj35do55f7lj4nhxqxtt5nqoohoojdvkki"
},
+ "2109": {
+ "key": "2109",
+ "name": "Exosama Network",
+ "shortName": "EXN",
+ "chainId": 2109,
+ "network": "mainnet",
+ "multicall": "0x2feFC828e2fEfdE0C9f7740919c6A9139F886067",
+ "rpc": [
+ "https://rpc.exosama.com"
+ ],
+ "explorer": {
+ "url": "https://explorer.exosama.com"
+ },
+ "start": 94085,
+ "logo": "ipfs://QmaQxfwpXYTomUd24PMx5tKjosupXcm99z1jL1XLq9LWBS"
+ },
+ "2152": {
+ "key": "2152",
+ "name": "Findora Mainnet",
+ "shortName": "Findora",
+ "chainId": 2152,
+ "network": "mainnet",
+ "multicall": "0xCF7D1e21CBe9bdEF235aef06C5d8051B3d4DF0f5",
+ "rpc": [
+ "https://archive.prod.findora.org:8545/"
+ ],
+ "explorer": {
+ "url": "https://evm.findorascan.io"
+ },
+ "start": 4219343,
+ "logo": "ipfs://QmXkneyRB6HbHTHRLCZpZqSsawiyJY7b2kZ2V8ydvKYAgv"
+ },
+ "2400": {
+ "key": "2400",
+ "name": "TCG Verse Mainnet",
+ "shortName": "TCGV",
+ "chainId": 2400,
+ "network": "mainnet",
+ "multicall": "0xceC65DEE0b5012F1b7321b2647681F997c7204FC",
+ "rpc": [
+ "https://rpc.tcgverse.xyz"
+ ],
+ "explorer": {
+ "url": "https://explorer.tcgverse.xyz"
+ },
+ "start": 57500,
+ "logo": "ipfs://bafkreidg4wpewve5mdxrofneqblydkrjl3oevtgpdf3fk3z3vjqam6ocoe"
+ },
+ "2611": {
+ "key": "2611",
+ "name": "Redlight Mainnet",
+ "shortName": "REDLC",
+ "chainId": 2611,
+ "network": "mainnet",
+ "multicall": "0x516C7A3F307eCb28F7F88AFfD31F26484c2e1BA2",
+ "rpc": [
+ "https://dataseed2.redlightscan.finance"
+ ],
+ "explorer": {
+ "url": "https://redlightscan.finance/"
+ },
+ "start": 6504228,
+ "logo": "ipfs://QmZDdFjM37M3Zn6aCAuBnRwnWYTzFMg8k2zhKedczwBb58"
+ },
+ "4062": {
+ "key": "4062",
+ "name": "Nahmii N3 Testnet",
+ "shortName": "Nahmii",
+ "chainId": 4062,
+ "network": "testnet",
+ "testnet": true,
+ "multicall": "0x495Da6Fdad384f3FF733f860d63c4F9457D2a0b0",
+ "rpc": [
+ "https://ngeth.testnet.n3.nahmii.io"
+ ],
+ "explorer": {
+ "url": "https://explorer.testnet.n3.nahmii.io/"
+ },
+ "start": 2607889,
+ "logo": "ipfs://QmPXPCBho3kGLt5rhG9JGkKmzdtLvqZmJqGzzijVCuggWY"
+ },
"4689": {
"key": "4689",
"name": "IoTeX Mainnet",
@@ -1193,23 +1437,6 @@
"start": 4364,
"logo": "ipfs://QmPXPCBho3kGLt5rhG9JGkKmzdtLvqZmJqGzzijVCuggWY"
},
- "5553": {
- "key": "5553",
- "name": "Nahmii Testnet",
- "shortName": "Nahmii",
- "chainId": 5553,
- "network": "testnet",
- "testnet": true,
- "multicall": "0x0e157d2E45af27564edFAaCcD68f2f0458F3D96c",
- "rpc": [
- "https://l2.testnet.nahmii.io"
- ],
- "explorer": {
- "url": "https://explorer.testnet.nahmii.io"
- },
- "start": 53370,
- "logo": "ipfs://QmPXPCBho3kGLt5rhG9JGkKmzdtLvqZmJqGzzijVCuggWY"
- },
"5851": {
"key": "5851",
"name": "Ontology Testnet",
@@ -1246,6 +1473,38 @@
"start": 3673983,
"logo": "ipfs://QmUkFZC2ZmoYPTKf7AHdjwRPZoV2h1MCuHaGM4iu8SNFpi"
},
+ "7700": {
+ "key": "7700",
+ "name": "Canto",
+ "shortName": "Canto",
+ "chainId": 7700,
+ "network": "mainnet",
+ "multicall": "0x9787792A1020B00fb65191754c3D87c89Bf36444",
+ "rpc": [
+ "https://canto.neobase.one"
+ ],
+ "explorer": {
+ "url": "https://evm.explorer.canto.io"
+ },
+ "start": 1683285,
+ "logo": "ipfs://QmVh5XRi7xN4UNw7SNKpEhjF1TsPXJnRyNkB4EuMVTVCB6"
+ },
+ "9052": {
+ "key": "9052",
+ "name": "Acrechain Mainnet",
+ "shortName": "Acrechain",
+ "chainId": 9052,
+ "network": "mainnet",
+ "multicall": "0x6D7ce9f27f188cD042b20742DC95b0C75D5667bB",
+ "rpc": [
+ "https://evm.acrescan.com"
+ ],
+ "explorer": {
+ "url": "https://acrescout.mindheartsoul.org"
+ },
+ "start": 1759024,
+ "logo": "ipfs://QmbA6CE3G81mm4eDEBUezwcq2qdqEh1zEToG3MbJHirxQt"
+ },
"10000": {
"key": "10000",
"name": "smartBCH",
@@ -1261,6 +1520,21 @@
},
"logo": "ipfs://QmWG1p7om4hZ4Yi4uQvDpxg4si7qVYhtppGbcDGrhVFvMd"
},
+ "10243": {
+ "key": "10243",
+ "name": "Arthera Testnet",
+ "shortName": "Arthera_",
+ "chainId": 10243,
+ "network": "testnet",
+ "testnet": true,
+ "multicall": "0x27c7FC597aD2E81C4c1cA1769972f79DaF042Da7",
+ "rpc": ["https://rpc-test.arthera.net"],
+ "explorer": {
+ "url": "https://explorer-test.arthera.net"
+ },
+ "start": 10523,
+ "logo": "ipfs://QmYQp3e52KjkT4bYdAvB6ACEEpXs2D8DozsDitaADRY2Ak"
+ },
"11437": {
"key": "11437",
"name": "Shyft Testnet",
@@ -1295,6 +1569,43 @@
"start": 79516,
"logo": "ipfs://QmTogMDLmDgJjDjUKDHDuc2KVTVDbXf8bXJLFiVe8PRxgo"
},
+ "16718": {
+ "key": "16718",
+ "name": "AirDAO Mainnet",
+ "chainId": 16718,
+ "network": "mainnet",
+ "multicall": "0x25e81aC81A8B03389D78CB45faB78353aB528574",
+ "rpc": [
+ "https://network-archive.ambrosus.io"
+ ],
+ "ws": [
+ "wss://network-archive.ambrosus.io/ws"
+ ],
+ "explorer": {
+ "url": "https://airdao.io/explorer"
+ },
+ "start": 22922566,
+ "logo": "ipfs://QmSxXjvWng3Diz4YwXDV2VqSPgMyzLYBNfkjJcr7rzkxom"
+ },
+ "22040": {
+ "key": "22040",
+ "name": "AirDAO Testnet",
+ "chainId": 22040,
+ "network": "testnet",
+ "testnet": true,
+ "multicall": "0x18f7BFad831D8ED9E16C4cD50D6041dD453Ca1EF",
+ "rpc": [
+ "https://network-archive.ambrosus-test.io"
+ ],
+ "ws": [
+ "wss://network-archive.ambrosus-test.io/ws"
+ ],
+ "explorer": {
+ "url": "https://testnet.airdao.io/explorer"
+ },
+ "start": 3368046,
+ "logo": "ipfs://QmSxXjvWng3Diz4YwXDV2VqSPgMyzLYBNfkjJcr7rzkxom"
+ },
"32659": {
"key": "32659",
"name": "Fusion Mainnet",
@@ -1329,6 +1640,22 @@
"start": 256508,
"logo": "ipfs://QmWZ5SMRfvcK8tycsDqojQaSiKedgtVkS7CkZdxPgeCVsZ"
},
+ "42170": {
+ "key": "42170",
+ "name": "Arbitrum Nova",
+ "chainId": 42170,
+ "network": "Arbitrum Nova",
+ "multicall": "0x4E74EBd9CABff51cE9a43EFe059bA8c5A28E4A14",
+ "rpc": [
+ "https://nova.arbitrum.io/rpc",
+ "https://arbitrum-nova.public.blastapi.io"
+ ],
+ "explorer": {
+ "url": "https://nova.arbiscan.io/"
+ },
+ "start": 6006607,
+ "logo": "ipfs://bafkreie5xsqt3mrrwu7v32qpmmctibhzhgxf4emfzzddsdhdlfsa7fmplu"
+ },
"42220": {
"key": "42220",
"name": "Celo Mainnet",
@@ -1501,7 +1828,7 @@
"https://godwoken-testnet-v1.ckbapp.dev"
],
"ws": [
- "wss://godwoken-testnet-v1.ckbapp.dev/ws"
+ "wss://godwoken-testnet-v1.ckbapp.dev/ws"
],
"explorer": {
"url": "https://gw-explorer.nervosdao.community"
@@ -1659,10 +1986,10 @@
"network": "testnet",
"multicall": "0x40643B8Aeaaca0b87Ea1A1E596e64a0e14B1d244",
"rpc": [
- "https://baobab.fandom.finance/archive"
+ "https://archive-en.baobab.klaytn.net"
],
"ws": [
- "wss://baobab.fandom.finance/archive/ws"
+ "wss://archive-en.baobab.klaytn.net/ws"
],
"explorer": {
"url": "https://baobab.scope.klaytn.com/"
@@ -1692,10 +2019,10 @@
"network": "mainnet",
"multicall": "0x5f5f0d1b9ff8b3dcace308e39b13b203354906e9",
"rpc": [
- "https://cypress.fandom.finance/archive"
+ "https://archive-en.cypress.klaytn.net"
],
"ws": [
- "wss://cypress.fandom.finance/archive/ws"
+ "wss://archive-en.cypress.klaytn.net/ws"
],
"explorer": {
"url": "https://scope.klaytn.com/"
@@ -1848,5 +2175,195 @@
},
"start": 2560501,
"logo": "ipfs://QmXqprM1TPafQFLirQ7dMPMgou1hoUGuCvHYSWU9g8ocv8"
+ },
+ "11155111": {
+ "key": "11155111",
+ "name": "Sepolia",
+ "shortName": "Sepolia",
+ "chainId": 11155111,
+ "network": "sepolia",
+ "testnet": true,
+ "multicall": "0xcA11bde05977b3631167028862bE2a173976CA11",
+ "rpc": [
+ "https://sepolia.infura.io/v3/d26b4fd748814fe994b05899fd89e667"
+ ],
+ "explorer": {
+ "url": "https://sepolia.etherscan.io",
+ "apiUrl": "https://api-sepolia.etherscan.io"
+ },
+ "start": 751532,
+ "logo": "ipfs://QmR2UYZczmYa4s8mr9HZHci5AQwyAnwUW7tSUZz7KWF3sA"
+ },
+ "813": {
+ "key": "813",
+ "name": "Qitmeer Mainnet",
+ "shortName": "MEER",
+ "chainId": 813,
+ "network": "mainnet",
+ "multicall": "0x55034b2cF530ae3A8fC1e2e4523F58496796610F",
+ "rpc": [
+ "https://evm-dataseed1.meerscan.io",
+ "https://evm-dataseed.meerscan.com",
+ "https://evm-dataseed2.meerscan.io",
+ "https://evm-dataseed3.meerscan.io"
+ ],
+ "explorer": {
+ "url": "https://evm.meerscan.io"
+ },
+ "start": 43317,
+ "logo": "ipfs://QmXvum7SNVaAqAc2jNzR1NpNZN1GGvNaKWydg8a1GEDQ7y"
+ },
+ "6102": {
+ "key": "6102",
+ "name": "Cascadia Testnet",
+ "shortName": "Cascadia",
+ "chainId": 6102,
+ "network": "testnet",
+ "multicall": "0x728989819bAD588F193563008E0a03E8cD6a3e4a",
+ "rpc": [
+ "https://testnet.cascadia.foundation"
+ ],
+ "explorer": {
+ "url": "https://explorer.cascadia.foundation"
+ },
+ "testnet": true,
+ "start": 370457,
+ "logo": "ipfs://QmWkhZYhReYyaa5pQXj32hEGxoRcBqarFMcfQScELmjYQj"
+ },
+ "84531": {
+ "key": "84531",
+ "name": "Base Goerli Testnet",
+ "chainId": 84531,
+ "network": "Base",
+ "testnet": true,
+ "multicall": "0x0012989E982C2c473e36418384Ab707C72f2B782",
+ "rpc": [
+ "https://goerli.base.org"
+ ],
+ "explorer": {
+ "url": "https://goerli.basescan.org/"
+ },
+ "start": 1151797,
+ "logo": "ipfs://QmQqrze3W1uSYWq2cGSYDeDwtjGXohTjWPnQ87EVJGeq2P"
+ },
+ "1116": {
+ "key": "1116",
+ "name": "Core Chain Mainnet ",
+ "shortName": "Core",
+ "chainId": 1116,
+ "network": "mainnet",
+ "multicall": "0x024f0041b76B598c2A0a75004F8447FaF67BD004",
+ "rpc": [
+ "https://rpc.coredao.org/"
+ ],
+ "explorer": {
+ "url": "https://scan.coredao.org"
+ },
+ "start": 853908,
+ "logo": "ipfs://QmVctLQ44vhkwejja9DDjDYUdYgVRBEWs242mhd95SeM5q"
+ },
+ "1071": {
+ "key": "1071",
+ "name": "Shimmer EVM Testnet",
+ "shortName": "ShimmerEVM",
+ "chainId": 1071,
+ "network": "testnet",
+ "testnet": true,
+ "multicall": "0xb6d9a0849bA7a6FB565567A6013cFEb8d91A1688",
+ "rpc": [
+ "https://json-rpc.evm.testnet.shimmer.network/"
+ ],
+ "explorer": {
+ "url": "https://explorer.evm.testnet.shimmer.network/"
+ },
+ "start": 38066,
+ "logo": "ipfs://QmYGxmEhV6djksUk97pdE9TmL6DXm9KW8BP7pwUv8pqp8r"
+ },
+ "119": {
+ "key": "119",
+ "name": "ENULS Mainnet",
+ "chainId": 119,
+ "network": "mainnet",
+ "multicall": "0xd7d2Aa52f5491cB60ccD85b8c39935BF0baCd142",
+ "rpc": [
+ "https://evmapi.nuls.io/"
+ ],
+ "explorer": {
+ "url": "https://evmscan.nuls.io"
+ },
+ "start": 501318,
+ "logo": "ipfs://QmYz8LK5WkUN8UwqKfWUjnyLuYqQZWihT7J766YXft4TSy"
+ },
+ "5555": {
+ "key": "5555",
+ "name": "Chain Verse Mainnet",
+ "shortName": "ChainVerse",
+ "chainId": 5555,
+ "network": "ChainVerse",
+ "multicall": "0xcA11bde05977b3631167028862bE2a173976CA11",
+ "rpc": [
+ "https://rpc.chainverse.info"
+ ],
+ "explorer": {
+ "url": "https://explorer.chainverse.info"
+ },
+ "logo": "ipfs://QmQyJt28h4wN3QHPXUQJQYQqGiFUD77han3zibZPzHbitk"
+ },
+ "59140": {
+ "key": "59140",
+ "name": "Linea Goerli testnet",
+ "shortName": "Linea Goerli",
+ "chainId": 59140,
+ "network": "testnet",
+ "testnet": true,
+ "multicall": "0xcA11bde05977b3631167028862bE2a173976CA11",
+ "rpc": [
+ "https://rpc.goerli.linea.build"
+ ],
+ "explorer": {
+ "url": "https://explorer.goerli.linea.build"
+ },
+ "start": 498623,
+ "logo": "ipfs://QmSwCnEeLoyMApQd1YfhmGvLt97bH5mLPoabjKqUSuQHHF"
+ },
+ "9000": {
+ "key": "9000",
+ "name": "Evmos Network Testnet",
+ "shortName": "Evmos Testnet",
+ "chainId": 9000,
+ "network": "testnet",
+ "testnet": true,
+ "multicall": "0xbf84d77eb467c4aaa2988ac070cd119984c0aaa2",
+ "rpc": [
+ "https://eth.bd.evmos.dev:8545"
+ ],
+ "ws": [
+ "wss://eth.bd.evmos.dev:8546"
+ ],
+ "explorer": {
+ "url": "https://testnet.escan.live"
+ },
+ "start": 14929860,
+ "logo": "ipfs://QmVgkQTA8cbYMijWS8AN44xzwAEQvFc2dCpih1qK78ZRQW"
+ },
+ "9001": {
+ "key": "9001",
+ "name": "Evmos Network",
+ "shortName": "Evmos",
+ "chainId": 9001,
+ "network": "mainnet",
+ "testnet": false,
+ "multicall": "0x37763d16f8dBf6F185368E0f256350cAb7E24b26",
+ "rpc": [
+ "https://eth.bd.evmos.org:8545"
+ ],
+ "ws": [
+ "wss://eth.bd.evmos.org:8546"
+ ],
+ "explorer": {
+ "url": "https://escan.live"
+ },
+ "start": 13959539,
+ "logo": "ipfs://QmVgkQTA8cbYMijWS8AN44xzwAEQvFc2dCpih1qK78ZRQW"
}
}
diff --git a/src/schemas/index.ts b/src/schemas/index.ts
index 6e1b94829..a0aa6972f 100644
--- a/src/schemas/index.ts
+++ b/src/schemas/index.ts
@@ -2,6 +2,7 @@ import space from './space.json';
import proposal from './proposal.json';
import vote from './vote.json';
import profile from './profile.json';
+import statement from './statement.json';
import zodiac from './zodiac.json';
export default {
@@ -9,5 +10,6 @@ export default {
proposal: proposal.definitions.Proposal,
vote: vote.definitions.Vote,
profile: profile.definitions.Profile,
+ statement: statement.definitions.Statement,
zodiac: zodiac.definitions.Zodiac
};
diff --git a/src/schemas/proposal.json b/src/schemas/proposal.json
index d5d25e5b7..1f0c87ae1 100644
--- a/src/schemas/proposal.json
+++ b/src/schemas/proposal.json
@@ -16,7 +16,7 @@
"type": "string",
"title": "body",
"minLength": 0,
- "maxLength": 14400
+ "maxLength": 20000
},
"discussion": {
"type": "string",
@@ -28,7 +28,7 @@
"type": "array",
"title": "choices",
"minItems": 1,
- "maxItems": 300
+ "maxItems": 500
},
"type": {
"type": "string",
@@ -56,10 +56,7 @@
"type": "number",
"title": "end",
"minimum": 1000000000,
- "maximum": 2000000000,
- "exclusiveMinimum": {
- "$data": "1/start"
- }
+ "maximum": 2000000000
},
"metadata": {
"type": "object",
diff --git a/src/schemas/space.json b/src/schemas/space.json
index 65d9c9188..b8d7f97a3 100644
--- a/src/schemas/space.json
+++ b/src/schemas/space.json
@@ -22,14 +22,20 @@
},
"guidelines": {
"type": "string",
+ "format": "customUrl",
"title": "guidelines",
+ "maxLength": 256
+ },
+ "template": {
+ "type": "string",
+ "title": "template",
"maxLength": 1024
},
"terms": {
"type": "string",
"title": "terms",
- "format": "uri",
- "maxLength": 128
+ "format": "customUrl",
+ "maxLength": 256
},
"avatar": {
"type": "string",
@@ -45,8 +51,8 @@
"website": {
"type": "string",
"title": "website",
- "format": "url",
- "maxLength": 128
+ "format": "customUrl",
+ "maxLength": 256
},
"twitter": {
"type": "string",
@@ -144,6 +150,18 @@
"title": "admins",
"uniqueItems": true
},
+ "moderators": {
+ "type": "array",
+ "maxItems": 100,
+ "items": {
+ "type": "string",
+ "pattern": "^0x[a-fA-F0-9]{40}$",
+ "minLength": 42,
+ "maxLength": 42
+ },
+ "title": "moderators",
+ "uniqueItems": true
+ },
"filters": {
"type": "object",
"properties": {
@@ -216,8 +234,36 @@
"required": ["name"],
"additionalProperties": false
},
- "delegation": {
- "type": "boolean"
+ "delegationPortal": {
+ "type": "object",
+ "properties": {
+ "delegationType": {
+ "type": "string",
+ "title": "Delegation type",
+ "description": "Specify the type of delegation that you are using",
+ "anyOf": [
+ { "const": "compound-governor", "title": "Compound governor" }
+ ]
+ },
+ "delegationContract": {
+ "type": "string",
+ "format": "address",
+ "title": "Contract address",
+ "description": "The address of your delegation contract",
+ "examples": ["0x3901D0fDe202aF1427216b79f5243f8A022d68cf"]
+ },
+ "delegationApi": {
+ "type": "string",
+ "format": "uri",
+ "title": "Delegation API",
+ "description": "The URL of your delegation API (e.g a subgraph)",
+ "examples": [
+ "https://api.thegraph.com/subgraphs/name/arr00/uniswap-governance-v2"
+ ]
+ }
+ },
+ "required": ["delegationType", "delegationApi", "delegationContract"],
+ "additionalProperties": false
},
"allowAlias": {
"type": "boolean"
@@ -255,10 +301,7 @@
},
"privacy": {
"type": "string",
- "enum": [
- "",
- "shutter"
- ]
+ "enum": ["", "shutter"]
}
},
"additionalProperties": false
diff --git a/src/schemas/statement.json b/src/schemas/statement.json
new file mode 100644
index 000000000..718965d6d
--- /dev/null
+++ b/src/schemas/statement.json
@@ -0,0 +1,26 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema#",
+ "$ref": "#/definitions/Statement",
+ "definitions": {
+ "Statement": {
+ "title": "Statement",
+ "type": "object",
+ "properties": {
+ "about": {
+ "type": "string",
+ "format": "long",
+ "title": "About",
+ "minLength": 1,
+ "maxLength": 140
+ },
+ "statement": {
+ "type": "string",
+ "format": "long",
+ "title": "Statement"
+ }
+ },
+ "required": ["about"],
+ "additionalProperties": false
+ }
+ }
+}
diff --git a/src/sign/eip1271.ts b/src/sign/eip1271.ts
index 1cc52262c..ae48a3967 100644
--- a/src/sign/eip1271.ts
+++ b/src/sign/eip1271.ts
@@ -20,8 +20,13 @@ export async function verifyDefault(
[address, 'isValidSignature', [arrayify(hash), sig]]
);
} catch (e) {
- return false;
+ // @ts-ignore
+ if (e.message.startsWith('missing revert data in call exception')) {
+ return false;
+ }
+ throw e;
}
+
return returnValue.toLowerCase() === magicValue.toLowerCase();
}
@@ -31,19 +36,15 @@ export async function verifyOldVersion(
hash: string,
provider: StaticJsonRpcProvider
) {
- let returnValue;
const magicValue = '0x20c13b0b';
const abi =
'function isValidSignature(bytes _hash, bytes memory _signature) public view returns (bytes4 magicValue)';
- try {
- returnValue = await call(
- provider,
- [abi],
- [address, 'isValidSignature', [arrayify(hash), sig]]
- );
- } catch (e) {
- return false;
- }
+
+ const returnValue = await call(
+ provider,
+ [abi],
+ [address, 'isValidSignature', [arrayify(hash), sig]]
+ );
return returnValue.toLowerCase() === magicValue.toLowerCase();
}
diff --git a/src/sign/index.ts b/src/sign/index.ts
index 8350d7f08..a848fca8f 100644
--- a/src/sign/index.ts
+++ b/src/sign/index.ts
@@ -13,6 +13,8 @@ import {
Unsubscribe,
Profile,
Alias,
+ DeleteSpace,
+ Statement,
spaceTypes,
proposalTypes,
cancelProposalTypes,
@@ -30,9 +32,9 @@ import {
profileTypes,
aliasTypes,
deleteSpaceType,
- DeleteSpace
+ statementTypes
} from './types';
-import hubs from '../hubs.json';
+import constants from '../constants.json';
const NAME = 'snapshot';
const VERSION = '0.1.4';
@@ -46,7 +48,16 @@ export const domain = {
export default class Client {
readonly address: string;
- constructor(address: string = hubs[0]) {
+ constructor(address: string = constants.livenet.sequencer) {
+ address = address.replace(
+ constants.livenet.hub,
+ constants.livenet.sequencer
+ );
+ address = address.replace(
+ constants.testnet.hub,
+ constants.testnet.sequencer
+ );
+ address = address.replace(constants.local.hub, constants.local.sequencer);
this.address = address;
}
@@ -64,7 +75,6 @@ export default class Client {
}
async send(envelop) {
- const url = `${this.address}/api/msg`;
const init = {
method: 'POST',
headers: {
@@ -74,7 +84,7 @@ export default class Client {
body: JSON.stringify(envelop)
};
return new Promise((resolve, reject) => {
- fetch(url, init)
+ fetch(this.address, init)
.then((res) => {
if (res.ok) return resolve(res.json());
throw res;
@@ -167,6 +177,14 @@ export default class Client {
return await this.sign(web3, address, message, profileTypes);
}
+ async statement(
+ web3: Web3Provider | Wallet,
+ address: string,
+ message: Statement
+ ) {
+ return await this.sign(web3, address, message, statementTypes);
+ }
+
async alias(web3: Web3Provider | Wallet, address: string, message: Alias) {
return await this.sign(web3, address, message, aliasTypes);
}
diff --git a/src/sign/types.json b/src/sign/types.json
index 5b01ad5ff..11ab9c310 100644
--- a/src/sign/types.json
+++ b/src/sign/types.json
@@ -43,5 +43,6 @@
"59b60a06b729bf429bb984f2ce93dd9be08e013fdc59bfb39493114ad31a79d3": "vote-string",
"bc8c6814ddd5b9b6ef6415c656c9e7b9e05e029cc19b954b7160dc2928a12caf": "vote",
"9cf05f3cc08b78654652fb2494d9b2beab8803b723cf1c36e1abaab7427f3823": "vote-array",
- "40bc49afc0f4084a08af0d768ff67816dde5c61550ff65008c835982a62c351e": "vote-string"
+ "40bc49afc0f4084a08af0d768ff67816dde5c61550ff65008c835982a62c351e": "vote-string",
+ "5339bc75243597107916a39d9235470342ad7ac8486b9424272afe4877d62f6b": "statement"
}
diff --git a/src/sign/types.ts b/src/sign/types.ts
index d11c09321..df4fc6d3d 100644
--- a/src/sign/types.ts
+++ b/src/sign/types.ts
@@ -79,6 +79,14 @@ export interface Profile {
profile: string;
}
+export interface Statement {
+ from?: string;
+ timestamp?: number;
+ space: string;
+ about: string;
+ statement: string;
+}
+
export interface Alias {
from?: string;
alias: string;
@@ -250,6 +258,16 @@ export const profileTypes = {
]
};
+export const statementTypes = {
+ Statement: [
+ { name: 'from', type: 'address' },
+ { name: 'timestamp', type: 'uint64' },
+ { name: 'space', type: 'string' },
+ { name: 'about', type: 'string' },
+ { name: 'statement', type: 'string' }
+ ]
+};
+
export const aliasTypes = {
Alias: [
{ name: 'from', type: 'address' },
diff --git a/src/utils.ts b/src/utils.ts
index 9bb0b6ebd..3b68927d4 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -1,6 +1,8 @@
import fetch from 'cross-fetch';
import { Interface } from '@ethersproject/abi';
import { Contract } from '@ethersproject/contracts';
+import { isAddress } from '@ethersproject/address';
+import { parseUnits } from '@ethersproject/units';
import { hash, normalize } from '@ensdomains/eth-ens-namehash';
import { jsonToGraphQLQuery } from 'json-to-graphql-query';
import Ajv from 'ajv';
@@ -8,7 +10,6 @@ import addFormats from 'ajv-formats';
import Multicaller from './utils/multicaller';
import { getSnapshots } from './utils/blockfinder';
import getProvider from './utils/provider';
-import validations from './validations';
import { signMessage, getBlockNumber } from './utils/web3';
import { getHash, verify } from './sign/utils';
import gateways from './gateways.json';
@@ -33,6 +34,53 @@ const ENS_RESOLVER_ABI = [
'function text(bytes32 node, string calldata key) external view returns (string memory)'
];
+const ajv = new Ajv({ allErrors: true, allowUnionTypes: true, $data: true });
+// @ts-ignore
+addFormats(ajv);
+
+ajv.addFormat('address', {
+ validate: (value: string) => {
+ try {
+ return isAddress(value);
+ } catch (err) {
+ return false;
+ }
+ }
+});
+
+ajv.addFormat('long', {
+ validate: () => true
+});
+
+ajv.addFormat('ethValue', {
+ validate: (value: string) => {
+ if (!value.match(/^([0-9]|[1-9][0-9]+)(\.[0-9]+)?$/)) return false;
+
+ try {
+ parseUnits(value, 18);
+ return true;
+ } catch {
+ return false;
+ }
+ }
+});
+
+// Custom URL format to allow empty string values
+// https://github.com/snapshot-labs/snapshot.js/pull/541/files
+ajv.addFormat('customUrl', {
+ type: 'string',
+ validate: (str) => {
+ if (!str.length) return true;
+ return (
+ str.startsWith('http://') ||
+ str.startsWith('https://') ||
+ str.startsWith('ipfs://') ||
+ str.startsWith('ipns://') ||
+ str.startsWith('snapshot://')
+ );
+ }
+});
+
export async function call(provider, abi: any[], call: any[], options?) {
const contract = new Contract(call[0], abi, provider);
try {
@@ -61,6 +109,7 @@ export async function multicall(
const itf = new Interface(abi);
try {
const max = options?.limit || 500;
+ if (options?.limit) delete options.limit;
const pages = Math.ceil(calls.length / max);
const promises: any = [];
Array.from(Array(pages)).forEach((x, i) => {
@@ -95,12 +144,19 @@ export async function subgraphRequest(url: string, query, options: any = {}) {
},
body: JSON.stringify({ query: jsonToGraphQLQuery({ query }) })
});
- const responseData = await res.json();
+ let responseData: any = await res.text();
+ try {
+ responseData = JSON.parse(responseData);
+ } catch (e) {
+ throw new Error(
+ `Errors found in subgraphRequest: URL: ${url}, Status: ${res.status}, Response: ${responseData}`
+ );
+ }
if (responseData.errors) {
throw new Error(
- 'Errors found in subgraphRequest: ' +
- url +
- JSON.stringify(responseData.errors)
+ `Errors found in subgraphRequest: URL: ${url}, Status: ${
+ res.status
+ }, Response: ${JSON.stringify(responseData.errors)}`
);
}
const { data } = responseData;
@@ -260,44 +316,84 @@ export async function validate(
}
export function validateSchema(schema, data) {
- const ajv = new Ajv({ allErrors: true, allowUnionTypes: true, $data: true });
- // @ts-ignore
- addFormats(ajv);
-
- // Custom URL format to allow empty string values
- // https://github.com/snapshot-labs/snapshot.js/pull/541/files
- ajv.addFormat('customUrl', {
- type: 'string',
- validate: (str) => {
- if (!str.length) return true;
- return (
- str.startsWith('http://') ||
- str.startsWith('https://') ||
- str.startsWith('ipfs://') ||
- str.startsWith('ipns://') ||
- str.startsWith('snapshot://')
- );
- }
- });
-
const ajvValidate = ajv.compile(schema);
const valid = ajvValidate(data);
return valid ? valid : ajvValidate.errors;
}
-export function getEnsTextRecord(ens: string, record: string, network = '1') {
- const address = networks[network].ensResolver || networks['1'].ensResolver;
+export async function getEnsTextRecord(
+ ens: string,
+ record: string,
+ network = '1'
+) {
+ const ensResolvers =
+ networks[network].ensResolvers || networks['1'].ensResolvers;
const ensHash = hash(normalize(ens));
const provider = getProvider(network);
- return call(provider, ENS_RESOLVER_ABI, [address, 'text', [ensHash, record]]);
+
+ const result = await multicall(
+ network,
+ provider,
+ ENS_RESOLVER_ABI,
+ ensResolvers.map((address: any) => [address, 'text', [ensHash, record]])
+ );
+ return result.flat().find((r: string) => r) || '';
}
-export async function getSpaceUri(id, network = '1') {
+export async function getSpaceUri(
+ id: string,
+ network = '1'
+): Promise {
try {
return await getEnsTextRecord(id, 'snapshot', network);
} catch (e) {
- return false;
+ console.log(e);
+ return null;
+ }
+}
+
+export async function getEnsOwner(
+ ens: string,
+ network = '1'
+): Promise {
+ const registryAddress = '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e';
+ const provider = getProvider(network);
+ const ensRegistry = new Contract(
+ registryAddress,
+ ['function owner(bytes32) view returns (address)'],
+ provider
+ );
+ const ensNameWrapper = networks[network].ensNameWrapper;
+ const ensHash = hash(normalize(ens));
+ let owner = await ensRegistry.owner(ensHash);
+ // If owner is the ENSNameWrapper contract, resolve the owner of the name
+ if (owner === ensNameWrapper) {
+ const ensNameWrapperContract = new Contract(
+ ensNameWrapper,
+ ['function ownerOf(uint256) view returns (address)'],
+ provider
+ );
+ owner = await ensNameWrapperContract.ownerOf(ensHash);
+ }
+ return owner;
+}
+
+export async function getSpaceController(
+ id: string,
+ network = '1'
+): Promise {
+ const spaceUri = await getSpaceUri(id, network);
+ if (spaceUri) {
+ let isUriAddress = isAddress(spaceUri);
+ if (isUriAddress) return spaceUri;
+
+ const uriParts = spaceUri.split('/');
+ const position = uriParts.includes('testnet') ? 5 : 4;
+ const address = uriParts[position];
+ isUriAddress = isAddress(address);
+ if (isUriAddress) return address;
}
+ return await getEnsOwner(id, network);
}
export async function getDelegatesBySpace(
@@ -379,6 +475,8 @@ export default {
validateSchema,
getEnsTextRecord,
getSpaceUri,
+ getEnsOwner,
+ getSpaceController,
getDelegatesBySpace,
clone,
sleep,
@@ -389,7 +487,6 @@ export default {
getBlockNumber,
Multicaller,
getSnapshots,
- validations,
getHash,
verify,
validate,
diff --git a/src/utils/blockfinder.ts b/src/utils/blockfinder.ts
index d335525d2..b81efead4 100644
--- a/src/utils/blockfinder.ts
+++ b/src/utils/blockfinder.ts
@@ -1,6 +1,9 @@
import { subgraphRequest } from '../utils';
+let cache = {};
export async function getSnapshots(network, snapshot, provider, networks) {
+ const cacheKey = `${network}-${snapshot}-${networks.join('-')}`;
+ if (cache[cacheKey]) return cache[cacheKey];
const snapshots = {};
networks.forEach((n) => (snapshots[n] = 'latest'));
if (snapshot === 'latest') return snapshots;
@@ -23,5 +26,8 @@ export async function getSnapshots(network, snapshot, provider, networks) {
const url = 'https://blockfinder.snapshot.org';
const data = await subgraphRequest(url, query);
data.blocks.forEach((block) => (snapshots[block.network] = block.number));
+ cache[cacheKey] = snapshots;
return snapshots;
}
+
+setInterval(() => (cache = {}), 1000 * 60 * 60 * 1); // Clear cache every 1 hour
diff --git a/src/utils/provider.ts b/src/utils/provider.ts
index dc4fffb0a..287d6a1c7 100644
--- a/src/utils/provider.ts
+++ b/src/utils/provider.ts
@@ -7,21 +7,26 @@ const providers = {};
const batchedProviders = {};
export default function getProvider(network) {
- const url = `https://brovider.xyz/${network}`;
+ const url = `https://rpc.snapshot.org/${network}`;
if (!providers[network])
providers[network] = new StaticJsonRpcProvider(
- { url, timeout: 25000 },
+ {
+ url,
+ timeout: 25000,
+ allowGzip: true
+ },
Number(network)
);
return providers[network];
}
export function getBatchedProvider(network) {
- const url = `https://brovider.xyz/${network}`;
+ const url = `https://rpc.snapshot.org/${network}`;
if (!batchedProviders[network])
batchedProviders[network] = new JsonRpcBatchProvider({
url,
- timeout: 25000
+ timeout: 25000,
+ allowGzip: true
});
return batchedProviders[network];
}
diff --git a/src/validations/aave/examples.json b/src/validations/aave/examples.json
deleted file mode 100644
index 4a1322ec2..000000000
--- a/src/validations/aave/examples.json
+++ /dev/null
@@ -1,107 +0,0 @@
-[
- {
- "name": "Example of Aave Proposition Power proposal validation",
- "validation": {
- "name": "aave",
- "params": {}
- },
- "network": "1",
- "userAddress": "0x5BC928BF0DAb1e4A2ddd9e347b0F22e88026D76c",
- "space": {
- "name": "Aave",
- "skin": "aave",
- "admins": [
- "0x8d07D225a769b7Af3A923481E1FdF49180e6A265",
- "0xc8E0345596D7196941E61D3aB607E57Fe61F85E7"
- ],
- "avatar": "ipfs://QmRKgfxSiCU3EmkN52ZaxgKvDyPFUR5DdPvnKxwyLRncKS",
- "domain": "signal.aave.com",
- "github": "aave",
- "symbol": "AAVE",
- "filters": {
- "minScore": 1,
- "onlyMembers": false
- },
- "members": [],
- "network": "1",
- "plugins": {},
- "twitter": "AaveAave",
- "strategies": [
- {
- "name": "erc20-balance-of",
- "params": {
- "symbol": "aAAVE",
- "address": "0xffc97d72e13e01096502cb8eb52dee56f74dad7b",
- "decimals": 18
- }
- },
- {
- "name": "aave-governance-power",
- "params": {
- "symbol": "AAVE+stkAAVE",
- "decimals": 18,
- "powerType": "vote",
- "governanceStrategy": "0xb7e383ef9b1e9189fc0f71fb30af8aa14377429e"
- }
- },
- {
- "name": "multichain",
- "params": {
- "graphs": {
- "137": "https://api.thegraph.com/subgraphs/name/sameepsi/maticblocks"
- },
- "symbol": "Matic AAVE+amAAVE",
- "strategies": [
- {
- "name": "erc20-balance-of",
- "params": {
- "symbol": "AAVE",
- "address": "0xD6DF932A45C0f255f85145f286eA0b292B21C90B",
- "decimals": 18
- },
- "network": "137"
- },
- {
- "name": "erc20-balance-of",
- "params": {
- "symbol": "amAAVE",
- "address": "0x1d2a0E5EC8E5bBDCA5CB219e649B565d8e5c3360",
- "decimals": 18
- },
- "network": 137
- }
- ]
- }
- },
- {
- "name": "contract-call",
- "params": {
- "args": ["%{address}"],
- "symbol": "AAVE in stkBPT",
- "address": "0xC0259c59D9f980E3b5e2574cD78C9A9Bc6A8E3fc",
- "decimals": 18,
- "methodABI": {
- "name": "balanceOf",
- "type": "function",
- "inputs": [
- {
- "name": "account",
- "type": "address",
- "internalType": "address"
- }
- ],
- "outputs": [
- {
- "name": "",
- "type": "uint256",
- "internalType": "uint256"
- }
- ],
- "stateMutability": "view"
- }
- }
- }
- ]
- }
- }
-]
diff --git a/src/validations/aave/index.ts b/src/validations/aave/index.ts
deleted file mode 100644
index bcd6faebf..000000000
--- a/src/validations/aave/index.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-import { getScores } from '../../utils';
-
-export const author = 'kartojal';
-export const version = '0.1.0';
-
-/**
- * Aave Space Validation proposal validation uses:
- * - Proposition power of GovernanceStrategy contract
- * - Other active Aave Snapshot voting strategies
- *
- * The current validation implementation mutates the "strategies" field of the space
- * to be able to use proposition power instead of voting power for "aave-governance-power".
- *
- */
-
-export default async function validate(
- author: string,
- space,
- proposal,
- options
-): Promise {
- const onlyMembers = options.onlyMembers || space.filters?.onlyMembers;
- const minScore = options.minScore || space.filters?.minScore;
- const members = (space.members || []).map((address) => address.toLowerCase());
- const strategies = [...space.strategies];
-
- const aaveGovernanceStrategyIndex = strategies.findIndex(
- ({ name }) => name === 'aave-governance-power'
- );
-
- // Use the proposition power instead of voting power
- if (aaveGovernanceStrategyIndex >= 0) {
- strategies[aaveGovernanceStrategyIndex].params.powerType = 'proposition';
- }
-
- if (members.includes(author.toLowerCase())) return true;
-
- if (onlyMembers) return false;
-
- if (minScore) {
- const scores = await getScores(
- space.id || space.key,
- strategies,
- space.network,
- [author]
- );
- const totalScore: any = scores
- .map((score: any) => Object.values(score).reduce((a, b: any) => a + b, 0))
- .reduce((a, b: any) => a + b, 0);
- if (totalScore < minScore) return false;
- }
-
- return true;
-}
diff --git a/src/validations/basic/examples.json b/src/validations/basic/examples.json
deleted file mode 100644
index 0dcf2b063..000000000
--- a/src/validations/basic/examples.json
+++ /dev/null
@@ -1,11 +0,0 @@
-[
- {
- "name": "Example of a basic proposal validation",
- "validation": {
- "name": "basic",
- "params": {}
- },
- "network": "1",
- "userAddress": "0xeF8305E140ac520225DAf050e2f71d5fBcC543e7"
- }
-]
diff --git a/src/validations/basic/index.ts b/src/validations/basic/index.ts
deleted file mode 100644
index 70cef6910..000000000
--- a/src/validations/basic/index.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-import { getScores } from '../../utils';
-
-export default async function validate(
- author: string,
- space,
- proposal,
- options
-): Promise {
- const strategies = options.strategies || space.strategies;
- const onlyMembers = options.onlyMembers || space.filters?.onlyMembers;
- const minScore = options.minScore || space.filters?.minScore;
- const members = (space.members || []).map((address) => address.toLowerCase());
-
- if (members.includes(author.toLowerCase())) return true;
-
- if (onlyMembers) return false;
-
- if (minScore) {
- const scores = await getScores(
- space.id || space.key,
- strategies,
- space.network,
- [author]
- );
- const totalScore: any = scores
- .map((score: any) => Object.values(score).reduce((a, b: any) => a + b, 0))
- .reduce((a, b: any) => a + b, 0);
- if (totalScore < minScore) return false;
- }
-
- return true;
-}
diff --git a/src/validations/index.ts b/src/validations/index.ts
deleted file mode 100644
index 440609eae..000000000
--- a/src/validations/index.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import basic from './basic';
-import aaveSpaceValidation from './aave';
-import nounsSpaceValidation from './nouns';
-import timeperiodSpaceValidation from './timeperiod';
-
-export default {
- basic,
- aave: aaveSpaceValidation,
- nouns: nounsSpaceValidation,
- timeperiod: timeperiodSpaceValidation
-};
diff --git a/src/validations/nouns/examples.json b/src/validations/nouns/examples.json
deleted file mode 100644
index 469e1a228..000000000
--- a/src/validations/nouns/examples.json
+++ /dev/null
@@ -1,50 +0,0 @@
-[
- {
- "name": "Example of Nouns Proposition Power proposal validation",
- "validation": {
- "name": "nouns",
- "params": {}
- },
- "network": "4",
- "userAddress": "0x03CD30Ab7b6eFaDfdc5D49Ec2B83DDD6a898e054",
- "space": {
- "name": "Nouns",
- "skin": "nouns",
- "admins": [
- "0xe6bcaacdca149114446612255cc4721bf7261b5b",
- "0xC4D2f3231879A26A2cAB5F1783D8a65f6B7191bE"
- ],
- "avatar": "ipfs://QmRKdsssCU3EmkN52ZaxgKvDyPFUR5DdPvnKxwyLRncKS",
- "domain": "signal.nouns.com",
- "github": "nouns",
- "symbol": "NOUNS",
- "filters": {
- "minScore": 1,
- "onlyMembers": false
- },
- "members": [],
- "network": "4",
- "plugins": {},
- "twitter": "NounishNounlet",
- "strategies": [
- {
- "name": "erc20-balance-of",
- "params": {
- "symbol": "LINK",
- "address": "0x01BE23585060835E02B77ef475b0Cc51aA1e0709",
- "decimals": 18
- }
- },
- {
- "name": "nouns-rfp-power",
- "params": {
- "symbol": "NOUNS",
- "decimals": 1,
- "powerType": "vote",
- "governanceStrategy": "0x50Acc1831E954fB5bB407d7A3CFe1e7769A41ab0"
- }
- }]
- }
- }
-]
-
diff --git a/src/validations/nouns/index.ts b/src/validations/nouns/index.ts
deleted file mode 100644
index 35d8b1722..000000000
--- a/src/validations/nouns/index.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { getScores } from '../../utils';
-
-export const author = 'waterdrops';
-export const version = '0.1.0';
-
-/**
- * Nouns Space Validation proposal validation uses:
- *
- * The current validation implementation mutates the "strategies" field of the space
- * to be able to use proposition power instead of voting power for "nouns-rfp-power".
- *
- */
-
-export default async function validate(
- author: string,
- space,
- proposal,
- options
-): Promise {
- const onlyMembers = options.onlyMembers || space.filters?.onlyMembers;
- const minScore = options.minScore || space.filters?.minScore;
- const members = (space.members || []).map((address) => address.toLowerCase());
- const strategies = [...space.strategies];
-
- const nounsRFPStrategyIndex = strategies.findIndex(
- ({ name }) => name === 'nouns-rfp-power'
- );
-
- // Use the proposition power instead of the voting power
- if (nounsRFPStrategyIndex >= 0) {
- strategies[nounsRFPStrategyIndex].params.powerType = 'proposition';
- }
-
- if (members.includes(author.toLowerCase())) return true;
-
- if (onlyMembers) return false;
-
- if (minScore) {
- const scores = await getScores(
- space.id || space.key,
- strategies,
- space.network,
- [author]
- );
- const totalScore: any = scores
- .map((score: any) => Object.values(score).reduce((a, b: any) => a + b, 0))
- .reduce((a, b: any) => a + b, 0);
- if (totalScore < minScore) return false;
- }
-
- return true;
-}
diff --git a/src/validations/timeperiod/examples.json b/src/validations/timeperiod/examples.json
deleted file mode 100644
index 02381e38e..000000000
--- a/src/validations/timeperiod/examples.json
+++ /dev/null
@@ -1,14 +0,0 @@
-[
- {
- "name": "Example of a prop entry time constrained validation",
- "validation": {
- "name": "timeperiod",
- "params": {
- "propEntryStart": 1659108444521,
- "propEntryEnd": 1659194844521
- }
- },
- "network": "1",
- "userAddress": ""
- }
-]
diff --git a/src/validations/timeperiod/index.ts b/src/validations/timeperiod/index.ts
deleted file mode 100644
index 2cbe85cc3..000000000
--- a/src/validations/timeperiod/index.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-export default async function validate(
- author: string,
- space,
- proposal,
- options
-): Promise {
- const onlyMembers = options.onlyMembers || space.filters?.onlyMembers;
- const members = (space.members || []).map((address) => address.toLowerCase());
- const { propEntryStart = 0, propEntryEnd = 0 } = options;
-
- if (!propEntryStart || !propEntryEnd || propEntryStart >= propEntryEnd)
- return false;
-
- if (members.includes(author.toLowerCase())) return true;
-
- if (onlyMembers) return false;
-
- const now = new Date().getTime();
- const startTime = new Date(propEntryStart).getTime();
- const endTime = new Date(propEntryEnd).getTime();
-
- // Only allow proposals being submitted in this time window.
- if (now >= startTime && now <= endTime) {
- return true;
- }
-
- return false;
-}
diff --git a/src/voting/approval.spec.js b/src/voting/approval.spec.js
index a22b28505..e80a67d05 100644
--- a/src/voting/approval.spec.js
+++ b/src/voting/approval.spec.js
@@ -19,7 +19,7 @@ const example2 = () => {
[139, 139, 139],
[125, 125, 125]
];
- const scoresTotal = 1161;
+ const scoresTotal = 1218;
const votes = example.votes.map((vote) => ({
choice: vote.choice,
balance: 3,
@@ -57,7 +57,7 @@ const rndChoices = () => {
rndNumber(),
rndNumber()
];
- return Math.random() < 0.9 ? choices : [];
+ return choices;
};
const votesWithInvalidChoices = () => {
@@ -161,23 +161,11 @@ test.each(getScoresByStrategyTests)(
const getScoresTotalTests = [
[example.proposal, example.votes, example.strategies, example.scoresTotal],
- [
- example.proposal,
- votesWithInvalidChoices(),
- example.strategies,
- example.scoresTotal
- ],
[
example2().proposal,
example2().votes,
example2().strategies,
example2().scoresTotal
- ],
- [
- example2().proposal,
- votesWithInvalidChoices2(),
- example2().strategies,
- example2().scoresTotal
]
];
diff --git a/src/voting/approval.ts b/src/voting/approval.ts
index c436aef48..2483e427e 100644
--- a/src/voting/approval.ts
+++ b/src/voting/approval.ts
@@ -29,9 +29,7 @@ export default class ApprovalVoting {
(choice) => proposalChoices?.[choice - 1] !== undefined
) &&
// If any voteChoice is duplicated, return false
- voteChoice.length === new Set(voteChoice).size &&
- // If voteChoice is empty, return false
- voteChoice.length > 0
+ voteChoice.length === new Set(voteChoice).size
);
}
@@ -64,7 +62,7 @@ export default class ApprovalVoting {
}
getScoresTotal(): number {
- return this.getValidVotes().reduce((a, b) => a + b.balance, 0);
+ return this.votes.reduce((a, b) => a + b.balance, 0);
}
getChoiceString(): string {
diff --git a/src/voting/examples/approval.json b/src/voting/examples/approval.json
index b08af45b6..e64cf46e8 100644
--- a/src/voting/examples/approval.json
+++ b/src/voting/examples/approval.json
@@ -5,7 +5,7 @@
"strategies": [{ "name": "ticket", "network": 1, "params": {} }],
"scores": [257, 171, 139, 125],
"scoresByStrategy": [[257], [171], [139], [125]],
- "scoresTotal": 387,
+ "scoresTotal": 406,
"selectedChoice": [1, 3],
"votes": [
{
diff --git a/src/voting/examples/quadratic.json b/src/voting/examples/quadratic.json
index 0f5f3d4fe..5c5860eac 100644
--- a/src/voting/examples/quadratic.json
+++ b/src/voting/examples/quadratic.json
@@ -3,21 +3,18 @@
"choices": [
"PistachioSwap",
"Pistachio UBI",
- "ProofofPistachio",
+ "ProofOfPistachio",
"iPistachio"
]
},
"strategies": [{ "name": "ticket", "network": 1, "params": {} }],
"scores": [
- 284.88967796546933,
- 45.02408310751504,
- 39.67106885693506,
- 24.415170070080556
+ 284.8896779654694, 45.02408310751503, 39.671068856935065, 24.415170070080556
],
"scoresByStrategy": [
- [284.88967796546933],
- [45.02408310751504],
- [39.67106885693506],
+ [284.8896779654694],
+ [45.02408310751503],
+ [39.671068856935065],
[24.415170070080556]
],
"scoresTotal": 394,
diff --git a/src/voting/examples/rankedChoice.json b/src/voting/examples/rankedChoice.json
index f6d941092..df89aa890 100644
--- a/src/voting/examples/rankedChoice.json
+++ b/src/voting/examples/rankedChoice.json
@@ -14,1057 +14,37 @@
"scores": [1]
},
{
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 2, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 3, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 2, 1, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 1, 4, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1, 2, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1, 4, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 2, 4, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 1, 2, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1, 4, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 3, 4, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1, 2, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 3, 2, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1, 4, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1, 2, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 3, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 2, 4, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 2, 4, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 3, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 2, 3, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 3, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 2, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 3, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 2, 3, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 2, 1, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 3, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 3, 2, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1, 2, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 3, 2, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 1, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1, 4, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 3, 4, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 2, 1, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 2, 3, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 3, 4, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1, 4, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 2, 4, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 1, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 2, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 1, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 2, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 3, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 4, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 3, 4, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 2, 3, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 3, 4, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 3, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 3, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 3, 4, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 1, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 3, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 3, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4, 3, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 4, 3, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 4, 3, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 1, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2, 4, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 1, 3, 4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 1, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 4, 2, 1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3, 1, 4, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2, 1, 4, 3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [2],
+ "choice": [1, 4, 2, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 2, 3, 4],
+ "choice": [1, 4, 3, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [2, 3, 4, 1],
+ "choice": [4, 2, 1, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [4, 3, 2, 1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 1, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [2],
+ "choice": [3, 4, 1, 2],
"balance": 1,
"scores": [1]
},
@@ -1074,57 +54,57 @@
"scores": [1]
},
{
- "choice": [1, 3, 2, 4],
+ "choice": [2, 1, 4, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [2],
+ "choice": [3, 1, 2, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [3],
+ "choice": [3, 1, 4, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [2, 1, 4, 3],
+ "choice": [3, 2, 4, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 1, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [4, 1, 2, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 1, 4, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 3, 4, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [4, 1],
+ "choice": [3, 1, 2, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
@@ -1134,57 +114,57 @@
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 3, 2, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 4, 2, 1],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [4, 2, 3, 1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [2, 3, 4, 1],
+ "choice": [3, 1, 4, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [4],
+ "choice": [3, 1, 2, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 2],
+ "choice": [1, 4, 3, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [3],
+ "choice": [3, 2, 4, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 4, 1, 2],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 1, 2, 4],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 2, 4, 1],
"balance": 1,
"scores": [1]
},
@@ -1194,27 +174,17 @@
"scores": [1]
},
{
- "choice": [1, 4, 3, 2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
+ "choice": [4, 2, 3, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [2, 3, 4, 1],
+ "choice": [1, 4, 3, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [2],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
@@ -1224,27 +194,22 @@
"scores": [1]
},
{
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
+ "choice": [3, 4, 1, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 4, 3, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 2],
+ "choice": [4, 2, 3, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
@@ -1254,82 +219,82 @@
"scores": [1]
},
{
- "choice": [1],
+ "choice": [4, 2, 1, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [3],
+ "choice": [4, 3, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 2, 3, 4],
+ "choice": [1, 3, 2, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 4, 2, 1],
+ "choice": [3, 1, 2, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 3, 2, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 1, 4, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 3, 4, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [4, 2, 1, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 4, 3, 2],
+ "choice": [4, 2, 3, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 3, 4, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 1, 4, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [2],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 2, 4, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [2],
+ "choice": [2, 1, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 2, 3, 4],
+ "choice": [1, 4, 2, 3],
"balance": 1,
"scores": [1]
},
@@ -1339,172 +304,172 @@
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 4, 2, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [2, 4, 1, 3],
+ "choice": [1, 4, 3, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 3],
+ "choice": [1, 2, 4, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [4, 2, 3, 1],
+ "choice": [1, 3, 4, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [4, 2, 3, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 3, 4, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [2, 3, 1, 4],
+ "choice": [1, 4, 3, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [4, 3, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 3, 4, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [2],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 4, 2, 1],
+ "choice": [2, 1, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [2],
+ "choice": [1, 4, 3, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [2, 1, 3, 4],
+ "choice": [4, 3, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [4, 3, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 4, 2, 1],
+ "choice": [1, 4, 3, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 4, 3, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 1, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 2, 4, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 1, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 1, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 4, 1, 2],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [4, 1],
+ "choice": [3, 1, 4, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 1, 4, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 3, 4, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [4],
+ "choice": [4, 3, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 3, 2, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 1, 4, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
@@ -1514,52 +479,52 @@
"scores": [1]
},
{
- "choice": [4, 3, 2, 1],
+ "choice": [4, 2, 3, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [4],
+ "choice": [2, 3, 4, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 1, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [2],
+ "choice": [3, 1, 2, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 4, 2, 1],
+ "choice": [4, 3, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [2, 1, 3, 4],
+ "choice": [1, 4, 3, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 1, 2, 4],
+ "choice": [2, 3, 4, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 4, 2, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 2, 4, 3],
+ "choice": [3, 4, 1, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [4],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
@@ -1569,77 +534,72 @@
"scores": [1]
},
{
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1, 2],
+ "choice": [1, 4, 3, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 3, 4, 2],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 1, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 4, 1, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 3, 4, 2],
+ "choice": [4, 2, 3, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [2, 3, 4, 1],
+ "choice": [2, 3, 1, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [4, 1, 2, 3],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 4, 1, 2],
+ "choice": [2, 1, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 3],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 1, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [4, 3, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 1, 3, 4],
"balance": 1,
"scores": [1]
},
@@ -1648,23 +608,18 @@
"balance": 1,
"scores": [1]
},
- {
- "choice": [1, 4, 3],
- "balance": 1,
- "scores": [1]
- },
{
"choice": [1, 2, 4, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 2, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1, 2, 3, 4],
+ "choice": [1, 3, 4, 2],
"balance": 1,
"scores": [1]
},
@@ -1674,27 +629,27 @@
"scores": [1]
},
{
- "choice": [1],
+ "choice": [2, 3, 4, 1],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [4, 1, 2, 3],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 4, 1, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 1, 2, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [2, 1, 3, 4],
+ "choice": [1, 2, 4, 3],
"balance": 1,
"scores": [1]
},
@@ -1704,32 +659,32 @@
"scores": [1]
},
{
- "choice": [1, 4, 3, 2],
+ "choice": [1, 3, 4, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 2, 1, 4],
+ "choice": [2, 1, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [3, 1, 4, 2],
+ "choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [1, 4, 3, 2],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 2, 1, 4],
"balance": 1,
"scores": [1]
},
{
- "choice": [1],
+ "choice": [3, 1, 4, 2],
"balance": 1,
"scores": [1]
},
@@ -1738,26 +693,11 @@
"balance": 1,
"scores": [1]
},
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
{
"choice": [2, 3, 4, 1],
"balance": 1,
"scores": [1]
},
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
{
"choice": [1, 3, 2, 4],
"balance": 1,
@@ -1768,86 +708,26 @@
"balance": 1,
"scores": [1]
},
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
{
"choice": [1, 3, 4, 2],
"balance": 1,
"scores": [1]
},
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
{
"choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
{
"choice": [4, 3, 2, 1],
"balance": 1,
"scores": [1]
},
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [4],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
{
"choice": [3, 1, 4, 2],
"balance": 1,
"scores": [1]
},
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [2],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [1],
- "balance": 1,
- "scores": [1]
- },
- {
- "choice": [3],
- "balance": 1,
- "scores": [1]
- },
{
"choice": [2, 1, 3, 4],
"balance": 1,
@@ -2038,489 +918,11 @@
"balance": 1,
"scores": [1]
},
- {
- "choice": [
- 1,
- 21,
- 21,
- 21,
- 21,
- 21,
- 21,
- 21,
- 22,
- 1,
- 1,
- 11,
- 21,
- 21,
- 21,
- 21,
- 22,
- 11,
- 21,
- 2,
- 21,
- 22,
- 11,
- 22,
- 1,
- 32,
- 11,
- 3,
- 21,
- 21,
- 11,
- 2,
- 5,
- 3,
- 31,
- 21,
- 25,
- 1,
- 2,
- 2,
- 31,
- 22,
- 1,
- 11,
- 23,
- 1,
- 1,
- 12,
- 11,
- 21,
- 22,
- 11,
- 11,
- 21,
- 21,
- 21,
- 21,
- 21,
- 21,
- 21,
- 22,
- 11,
- 21,
- 21,
- 21,
- 21,
- 2,
- 2,
- 21,
- 2,
- 4,
- 3,
- 5,
- 52,
- 4,
- 5,
- 5,
- 6,
- 1,
- 1,
- 1,
- 11,
- 1,
- 11,
- 23,
- 1,
- 21,
- 22,
- 11,
- 21,
- 21,
- 22,
- 11,
- 21,
- 22,
- 11,
- 22,
- 11,
- 11,
- 21,
- 2,
- 31,
- 2,
- 3,
- 41,
- 11,
- 2,
- 2,
- 22,
- 11,
- 11,
- 21,
- 11,
- 22,
- 1,
- 12,
- 1,
- 31,
- 2,
- 3,
- 3,
- 3,
- 3,
- 33,
- 1,
- 12,
- 11,
- 2,
- 34,
- 3,
- 2,
- 1,
- 11,
- 21,
- 2,
- 31,
- 11,
- 22,
- 1,
- 1,
- 1,
- 11,
- 21,
- 11,
- 3,
- 21,
- 22,
- 3,
- 1,
- 11,
- 21,
- 3,
- 21,
- 21,
- 11,
- 22,
- 11,
- 21,
- 2,
- 32,
- 1,
- 3,
- 3,
- 3,
- 31,
- 21,
- 1,
- 24,
- 3,
- 1,
- 21,
- 2,
- 5,
- 8,
- 4,
- 6,
- 3,
- 7,
- 9,
- 102,
- 12,
- 11,
- 2,
- 21,
- 21,
- 21,
- 22,
- 12,
- 11,
- 21,
- 11,
- 1,
- 12,
- 11,
- 21,
- 21,
- 22,
- 11,
- 2,
- 22,
- 11,
- 11,
- 2,
- 21,
- 21,
- 12,
- 17,
- 2,
- 6,
- 5,
- 1,
- 1,
- 31,
- 22,
- 11,
- 2,
- 31,
- 2,
- 32,
- 1,
- 3,
- 3,
- 31,
- 24,
- 1,
- 1,
- 11,
- 21,
- 11,
- 21,
- 3,
- 21,
- 21,
- 2,
- 21,
- 21,
- 21,
- 21,
- 23,
- 2,
- 13,
- 2,
- 11,
- 21,
- 21,
- 21,
- 21,
- 21,
- 21,
- 23,
- 1,
- 4,
- 21,
- 2,
- 22,
- 11,
- 13,
- 1,
- 11,
- 21,
- 21,
- 11,
- 21,
- 11,
- 11,
- 11,
- 11,
- 1,
- 2,
- 22,
- 11,
- 21,
- 21,
- 12,
- 1,
- 11,
- 21,
- 2,
- 21,
- 22,
- 11,
- 21,
- 21,
- 22,
- 12,
- 1,
- 1,
- 12,
- 11,
- 23,
- 1,
- 11,
- 21,
- 21,
- 11,
- 2,
- 4,
- 31,
- 3,
- 2,
- 4
- ],
- "balance": 1,
- "scores": [1]
- },
{
"choice": [1, 2, 3, 4],
"balance": 1,
"scores": [1]
},
- {
- "choice": [
- 1,
- 22,
- 1,
- 32,
- 11,
- 11,
- 3,
- 21,
- 3,
- 21,
- 21,
- 11,
- 11,
- 12,
- 1,
- 11,
- 21,
- 21,
- 22,
- 11,
- 22,
- 12,
- 11,
- 2,
- 4,
- 3,
- 5,
- 511,
- 22,
- 4,
- 5,
- 5,
- 6,
- 1,
- 1,
- 1,
- 11,
- 211,
- 21,
- 21,
- 5,
- 4,
- 3,
- 21,
- 2,
- 3,
- 41,
- 21,
- 11,
- 2,
- 2,
- 21,
- 22,
- 1,
- 12,
- 1,
- 31,
- 2,
- 3,
- 3,
- 3,
- 3,
- 33,
- 1,
- 12,
- 14,
- 3,
- 2,
- 1,
- 11,
- 21,
- 2,
- 31,
- 211,
- 2,
- 22,
- 3,
- 1,
- 43,
- 1,
- 11,
- 21,
- 21,
- 21,
- 21,
- 2,
- 32,
- 1,
- 3,
- 3,
- 3,
- 33,
- 1,
- 1,
- 11,
- 3,
- 23,
- 1,
- 12,
- 12,
- 12,
- 12,
- 11,
- 2,
- 27,
- 2,
- 6,
- 5,
- 1,
- 1,
- 31,
- 2,
- 3,
- 3,
- 3,
- 3,
- 3,
- 31,
- 21,
- 21,
- 22,
- 1,
- 3,
- 3,
- 31,
- 21,
- 2,
- 21,
- 21,
- 21,
- 21,
- 21,
- 2,
- 21,
- 2,
- 21,
- 21,
- 4,
- 2,
- 22,
- 12,
- 13,
- 2,
- 12,
- 1,
- 11,
- 21,
- 2,
- 21,
- 11,
- 21,
- 21,
- 211,
- 21,
- 21,
- 23,
- 1,
- 111,
- 11,
- 2,
- 4,
- 31,
- 3,
- 2,
- 4
- ],
- "balance": 1,
- "scores": [1]
- },
{
"choice": [1, 2, 3, 4],
"balance": 1,
diff --git a/src/voting/quadratic.spec.js b/src/voting/quadratic.spec.js
index 78ba67757..afc7e546d 100644
--- a/src/voting/quadratic.spec.js
+++ b/src/voting/quadratic.spec.js
@@ -18,13 +18,13 @@ const example2 = () => {
{ name: 'ticket', network: 1, params: {} }
];
const scores = [
- 854.6690338964087, 135.07224932254462, 119.01320657080511, 73.24551021024158
+ 854.6690338964088, 135.07224932254462, 119.01320657080512, 73.24551021024158
];
const scoresByStrategy = [
[284.8896779654692, 284.8896779654692, 284.8896779654692],
[45.02408310751502, 45.02408310751502, 45.02408310751502],
[39.671068856935044, 39.671068856935044, 39.671068856935044],
- [24.41517007008055, 24.41517007008055, 24.41517007008055]
+ [24.415170070080546, 24.415170070080546, 24.415170070080546]
];
const scoresTotal = 1182;
const votes = example.votes.map((vote) => ({
@@ -172,23 +172,11 @@ test.each(getScoresByStrategyTests)(
const getScoresTotalTests = [
[example.proposal, example.votes, example.strategies, example.scoresTotal],
- [
- example.proposal,
- votesWithInvalidChoices(),
- example.strategies,
- example.scoresTotal
- ],
[
example2().proposal,
example2().votes,
example2().strategies,
example2().scoresTotal
- ],
- [
- example2().proposal,
- votesWithInvalidChoices2(),
- example2().strategies,
- example2().scoresTotal
]
];
@@ -208,11 +196,11 @@ test.each(getScoresTotalTests)(
test.each([
[
{ 1: 1, 2: 1, 3: 4, 4: 4 },
- '10% for PistachioSwap, 10% for Pistachio UBI, 40% for ProofofPistachio, 40% for iPistachio'
+ '10% for PistachioSwap, 10% for Pistachio UBI, 40% for ProofOfPistachio, 40% for iPistachio'
],
[
{ 1: 4, 2: 4, 3: 1, 4: 1 },
- '40% for PistachioSwap, 40% for Pistachio UBI, 10% for ProofofPistachio, 10% for iPistachio'
+ '40% for PistachioSwap, 40% for Pistachio UBI, 10% for ProofOfPistachio, 10% for iPistachio'
]
])('getChoiceString %s %s', (selected, expected) => {
const quadratic = new QuadraticVoting(
diff --git a/src/voting/quadratic.ts b/src/voting/quadratic.ts
index 250b54457..24e10f9d5 100644
--- a/src/voting/quadratic.ts
+++ b/src/voting/quadratic.ts
@@ -1,28 +1,46 @@
-import { QuadraticVote, Strategy } from './types';
+import { QuadraticVote, QuadraticChoice, Strategy } from './types';
-export function percentageOfTotal(i, values, total): number {
- const reducedTotal: any = total.reduce((a: any, b: any) => a + b, 0);
- const percent = (values[i] / reducedTotal) * 100;
+export function calcPercentageOfSum(
+ part: number,
+ wholeArray: number[]
+): number {
+ const whole = wholeArray.reduce((a, b) => a + b, 0);
+ const percent = part / whole;
return isNaN(percent) ? 0 : percent;
}
-export function quadraticMath(i, choice, balance): number {
- return Math.sqrt(
- (percentageOfTotal(i + 1, choice, Object.values(choice)) / 100) * balance
- );
+export function calcSqrt(
+ percentageWeight: number,
+ votingPower: number
+): number {
+ return Math.sqrt(percentageWeight * votingPower);
+}
+
+function calcSquare(num: number): number {
+ return num * num;
+}
+
+function calcReducedQuadraticScores(
+ percentages: number[],
+ scoresTotal: number
+): number[] {
+ // Reduce each quadratic score so that the sum of quadratic scores matches
+ // the total scores.
+ // This is done to unsure that features like quorum still work as expected.
+ return percentages.map((p) => scoresTotal * p);
}
export default class QuadraticVoting {
proposal: { choices: string[] };
votes: QuadraticVote[];
strategies: Strategy[];
- selected: { [key: string]: number };
+ selected: QuadraticChoice;
constructor(
proposal: { choices: string[] },
votes: QuadraticVote[],
strategies: Strategy[],
- selected: { [key: string]: number }
+ selected: QuadraticChoice
) {
this.proposal = proposal;
this.votes = votes;
@@ -31,7 +49,7 @@ export default class QuadraticVoting {
}
static isValidChoice(
- voteChoice: { [key: string]: number },
+ voteChoice: QuadraticChoice,
proposalChoices: string[]
): boolean {
return (
@@ -62,57 +80,82 @@ export default class QuadraticVoting {
}
getScores(): number[] {
- const results = this.proposal.choices
- .map((choice, i) =>
- this.getValidVotes()
- .map((vote) => quadraticMath(i, vote.choice, vote.balance))
- .reduce((a, b: any) => a + b, 0)
- )
- .map((sqrt) => sqrt * sqrt);
+ const validVotes = this.getValidVotes();
+ const scoresTotal = this.getValidVotes().reduce(
+ (a, b: any) => a + b.balance,
+ 0
+ );
+
+ const quadraticScores = this.proposal.choices.map((_, i) => {
+ const votingPowerSqrt = validVotes
+ .map((vote) => {
+ const choiceWeightPercent = calcPercentageOfSum(
+ vote.choice[i + 1],
+ Object.values(vote.choice)
+ );
+ return calcSqrt(choiceWeightPercent, vote.balance);
+ })
+ .reduce((a, b: any) => a + b, 0);
+ return calcSquare(votingPowerSqrt);
+ });
- return results
- .map((res, i) => percentageOfTotal(i, results, results))
- .map((p) => (this.getScoresTotal() / 100) * p);
+ const percentagesOfScores = quadraticScores.map((_, i) =>
+ calcPercentageOfSum(quadraticScores[i], quadraticScores)
+ );
+
+ return calcReducedQuadraticScores(percentagesOfScores, scoresTotal);
}
getScoresByStrategy(): number[][] {
- const results = this.proposal.choices
- .map((choice, i) =>
- this.strategies.map((strategy, sI) =>
- this.getValidVotes()
- .map((vote) => quadraticMath(i, vote.choice, vote.scores[sI]))
+ const validVotes = this.getValidVotes();
+ const scoresTotal = this.getValidVotes().reduce(
+ (a, b: any) => a + b.balance,
+ 0
+ );
+
+ const quadraticScoresByStrategy = this.proposal.choices
+ .map((_, i) =>
+ this.strategies.map((_, sI) =>
+ validVotes
+ .map((vote) => {
+ const choiceWeightPercentByStrategy = calcPercentageOfSum(
+ vote.choice[i + 1],
+ Object.values(vote.choice)
+ );
+ return calcSqrt(choiceWeightPercentByStrategy, vote.scores[sI]);
+ })
.reduce((a, b: any) => a + b, 0)
)
)
- .map((arr) => arr.map((sqrt) => [sqrt * sqrt]));
+ .map((arr) => arr.map((num) => [calcSquare(num)]));
- return results.map((res, i) =>
- this.strategies
- .map((strategy, sI) =>
- percentageOfTotal(0, results[i][sI], results.flat(2))
+ const reducedQuadraticScores = quadraticScoresByStrategy.map((_, i) => {
+ const percentagesOfScores = this.strategies.map((_, sI) =>
+ calcPercentageOfSum(
+ quadraticScoresByStrategy[i][sI][0],
+ quadraticScoresByStrategy.flat(2)
)
- .map((p) => [(this.getScoresTotal() / 100) * p])
- .flat()
- );
+ );
+
+ return calcReducedQuadraticScores(percentagesOfScores, scoresTotal);
+ });
+
+ return reducedQuadraticScores;
}
getScoresTotal(): number {
- return this.getValidVotes().reduce((a, b: any) => a + b.balance, 0);
+ return this.votes.reduce((a, b: any) => a + b.balance, 0);
}
getChoiceString(): string {
return this.proposal.choices
.map((choice, i) => {
if (this.selected[i + 1]) {
- return `${
- Math.round(
- percentageOfTotal(
- i + 1,
- this.selected,
- Object.values(this.selected)
- ) * 10
- ) / 10
- }% for ${choice}`;
+ const percent = calcPercentageOfSum(
+ this.selected[i + 1],
+ Object.values(this.selected)
+ );
+ return `${Math.round(percent * 1000) / 10}% for ${choice}`;
}
})
.filter((el) => el != null)
diff --git a/src/voting/rankedChoice.spec.js b/src/voting/rankedChoice.spec.js
index 54e134b7e..70c3f905c 100644
--- a/src/voting/rankedChoice.spec.js
+++ b/src/voting/rankedChoice.spec.js
@@ -155,23 +155,11 @@ test.each(getScoresByStrategyTests)(
const getScoresTotalTests = [
[example.proposal, example.votes, example.strategies, example.scoresTotal],
- [
- example.proposal,
- votesWithInvalidChoices(),
- example.strategies,
- example.scoresTotal
- ],
[
example2().proposal,
example2().votes,
example2().strategies,
example2().scoresTotal
- ],
- [
- example2().proposal,
- votesWithInvalidChoices2(),
- example2().strategies,
- example2().scoresTotal
]
];
diff --git a/src/voting/rankedChoice.ts b/src/voting/rankedChoice.ts
index 5b98efca6..6e6cae145 100644
--- a/src/voting/rankedChoice.ts
+++ b/src/voting/rankedChoice.ts
@@ -77,6 +77,18 @@ function getFinalRound(
return finalRound.sortedByHighest;
}
+function getScoresMethod(
+ votes: RankedChoiceVote[],
+ proposal: { choices: string[] }
+) {
+ const finalRound = getFinalRound(votes);
+ return proposal.choices.map((choice, i) =>
+ finalRound
+ .filter((res) => Number(res[0]) === i + 1)
+ .reduce((a, b) => a + b[1][0], 0)
+ );
+}
+
export default class RankedChoiceVoting {
proposal: { choices: string[] };
votes: RankedChoiceVote[];
@@ -122,12 +134,7 @@ export default class RankedChoiceVoting {
}
getScores(): number[] {
- const finalRound = getFinalRound(this.getValidVotes());
- return this.proposal.choices.map((choice, i) =>
- finalRound
- .filter((res) => Number(res[0]) === i + 1)
- .reduce((a, b) => a + b[1][0], 0)
- );
+ return getScoresMethod(this.getValidVotes(), this.proposal);
}
getScoresByStrategy(): number[][] {
@@ -142,7 +149,7 @@ export default class RankedChoiceVoting {
}
getScoresTotal(): number {
- return this.getScores().reduce((a, b) => a + b);
+ return getScoresMethod(this.votes, this.proposal).reduce((a, b) => a + b);
}
getChoiceString(): string {
diff --git a/src/voting/singleChoice.spec.js b/src/voting/singleChoice.spec.js
index e7f088c20..e4b3226b6 100644
--- a/src/voting/singleChoice.spec.js
+++ b/src/voting/singleChoice.spec.js
@@ -135,23 +135,11 @@ test.each(getScoresByStrategyTests)(
const getScoresTotalTests = [
[example.proposal, example.votes, example.strategies, example.scoresTotal],
- [
- example.proposal,
- votesWithInvalidChoices(),
- example.strategies,
- example.scoresTotal
- ],
[
example2().proposal,
example2().votes,
example2().strategies,
example2().scoresTotal
- ],
- [
- example2().proposal,
- votesWithInvalidChoices2(),
- example2().strategies,
- example2().scoresTotal
]
];
diff --git a/src/voting/singleChoice.ts b/src/voting/singleChoice.ts
index 017e5f882..144ed6d1e 100644
--- a/src/voting/singleChoice.ts
+++ b/src/voting/singleChoice.ts
@@ -55,7 +55,7 @@ export default class SingleChoiceVoting {
}
getScoresTotal(): number {
- return this.getValidVotes().reduce((a, b) => a + b.balance, 0);
+ return this.votes.reduce((a, b) => a + b.balance, 0);
}
getChoiceString(): string {
diff --git a/src/voting/types.ts b/src/voting/types.ts
index 628876566..a06e571f9 100644
--- a/src/voting/types.ts
+++ b/src/voting/types.ts
@@ -22,8 +22,12 @@ export interface RankedChoiceVote {
scores: number[];
}
+export interface QuadraticChoice {
+ [key: string]: number;
+}
+
export interface QuadraticVote {
- choice: { [key: string]: number };
+ choice: QuadraticChoice;
balance: number;
scores: number[];
}
diff --git a/src/voting/weighted.spec.js b/src/voting/weighted.spec.js
index c56f6ec3a..542a0de8d 100644
--- a/src/voting/weighted.spec.js
+++ b/src/voting/weighted.spec.js
@@ -173,23 +173,11 @@ test.each(getScoresByStrategyTests)(
const getScoresTotalTests = [
[example.proposal, example.votes, example.strategies, example.scoresTotal],
- [
- example.proposal,
- votesWithInvalidChoices(),
- example.strategies,
- example.scoresTotal
- ],
[
example2().proposal,
example2().votes,
example2().strategies,
example2().scoresTotal
- ],
- [
- example2().proposal,
- votesWithInvalidChoices2(),
- example2().strategies,
- example2().scoresTotal
]
];
diff --git a/src/voting/weighted.ts b/src/voting/weighted.ts
index a0a8cacee..e00991005 100644
--- a/src/voting/weighted.ts
+++ b/src/voting/weighted.ts
@@ -68,9 +68,14 @@ export default class WeightedVoting {
.reduce((a, b: any) => a + b, 0)
);
+ const validScoresTotal = this.getValidVotes().reduce(
+ (a, b: any) => a + b.balance,
+ 0
+ );
+
return results
.map((res, i) => percentageOfTotal(i, results, results))
- .map((p) => (this.getScoresTotal() / 100) * p);
+ .map((p) => (validScoresTotal / 100) * p);
}
getScoresByStrategy(): number[][] {
@@ -84,18 +89,23 @@ export default class WeightedVoting {
)
.map((arr) => arr.map((pwr) => [pwr]));
+ const validScoresTotal = this.getValidVotes().reduce(
+ (a, b: any) => a + b.balance,
+ 0
+ );
+
return results.map((res, i) =>
this.strategies
.map((strategy, sI) =>
percentageOfTotal(0, results[i][sI], results.flat(2))
)
- .map((p) => [(this.getScoresTotal() / 100) * p])
+ .map((p) => [(validScoresTotal / 100) * p])
.flat()
);
}
getScoresTotal(): number {
- return this.getValidVotes().reduce((a, b: any) => a + b.balance, 0);
+ return this.votes.reduce((a, b: any) => a + b.balance, 0);
}
getChoiceString(): string {
diff --git a/test/examples/statement.json b/test/examples/statement.json
new file mode 100644
index 000000000..414e012a6
--- /dev/null
+++ b/test/examples/statement.json
@@ -0,0 +1,4 @@
+{
+ "about": "About me",
+ "statement": ""
+}
diff --git a/test/schema.spec.ts b/test/schema.spec.ts
new file mode 100644
index 000000000..d312d57a1
--- /dev/null
+++ b/test/schema.spec.ts
@@ -0,0 +1,22 @@
+import { test, expect, describe } from 'vitest';
+import { validateSchema } from '../src/utils';
+import space from './examples/space.json';
+import proposal from './examples/proposal.json';
+import vote from './examples/vote.json';
+import profile from './examples/profile.json';
+import statement from './examples/statement.json';
+import schemas from '../src/schemas';
+
+describe.each([
+ { schemaType: 'space', schema: schemas.space, example: space },
+ { schemaType: 'proposal', schema: schemas.proposal, example: proposal },
+ { schemaType: 'vote', schema: schemas.vote, example: vote },
+ { schemaType: 'profile', schema: schemas.profile, example: profile },
+ { schemaType: 'statement', schema: schemas.statement, example: statement },
+ { schemaType: 'zodiac', schema: schemas.zodiac, example: space }
+])(`Run validate for all schemas`, ({ schemaType, schema, example }) => {
+ test(`validating schema ${schemaType} should return true`, () => {
+ const isValid = validateSchema(schema, example);
+ expect(isValid).toBe(true);
+ });
+});
diff --git a/yarn.lock b/yarn.lock
index 0da63b076..18096102b 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,6 +2,14 @@
# yarn lockfile v1
+"@ampproject/remapping@^2.2.1":
+ version "2.2.1"
+ resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630"
+ integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==
+ dependencies:
+ "@jridgewell/gen-mapping" "^0.3.0"
+ "@jridgewell/trace-mapping" "^0.3.9"
+
"@babel/code-frame@^7.0.0":
version "7.8.3"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e"
@@ -51,15 +59,125 @@
dependencies:
regenerator-runtime "^0.13.4"
+"@bcoe/v8-coverage@^0.2.3":
+ version "0.2.3"
+ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
+ integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
+
"@ensdomains/eth-ens-namehash@^2.0.15":
version "2.0.15"
resolved "https://registry.yarnpkg.com/@ensdomains/eth-ens-namehash/-/eth-ens-namehash-2.0.15.tgz#5e5f2f24ba802aff8bc19edd822c9a11200cdf4a"
integrity sha512-JRDFP6+Hczb1E0/HhIg0PONgBYasfGfDheujmfxaZaAv/NAH4jE6Kf48WbqfRZdxt4IZI3jl3Ri7sZ1nP09lgw==
-"@esbuild/linux-loong64@0.14.54":
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.14.54.tgz#de2a4be678bd4d0d1ffbb86e6de779cde5999028"
- integrity sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==
+"@esbuild/android-arm64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz#bafb75234a5d3d1b690e7c2956a599345e84a2fd"
+ integrity sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==
+
+"@esbuild/android-arm@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.17.19.tgz#5898f7832c2298bc7d0ab53701c57beb74d78b4d"
+ integrity sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==
+
+"@esbuild/android-x64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.17.19.tgz#658368ef92067866d95fb268719f98f363d13ae1"
+ integrity sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==
+
+"@esbuild/darwin-arm64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz#584c34c5991b95d4d48d333300b1a4e2ff7be276"
+ integrity sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==
+
+"@esbuild/darwin-x64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz#7751d236dfe6ce136cce343dce69f52d76b7f6cb"
+ integrity sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==
+
+"@esbuild/freebsd-arm64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz#cacd171665dd1d500f45c167d50c6b7e539d5fd2"
+ integrity sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==
+
+"@esbuild/freebsd-x64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz#0769456eee2a08b8d925d7c00b79e861cb3162e4"
+ integrity sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==
+
+"@esbuild/linux-arm64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz#38e162ecb723862c6be1c27d6389f48960b68edb"
+ integrity sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==
+
+"@esbuild/linux-arm@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz#1a2cd399c50040184a805174a6d89097d9d1559a"
+ integrity sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==
+
+"@esbuild/linux-ia32@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz#e28c25266b036ce1cabca3c30155222841dc035a"
+ integrity sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==
+
+"@esbuild/linux-loong64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz#0f887b8bb3f90658d1a0117283e55dbd4c9dcf72"
+ integrity sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==
+
+"@esbuild/linux-mips64el@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz#f5d2a0b8047ea9a5d9f592a178ea054053a70289"
+ integrity sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==
+
+"@esbuild/linux-ppc64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz#876590e3acbd9fa7f57a2c7d86f83717dbbac8c7"
+ integrity sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==
+
+"@esbuild/linux-riscv64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz#7f49373df463cd9f41dc34f9b2262d771688bf09"
+ integrity sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==
+
+"@esbuild/linux-s390x@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz#e2afd1afcaf63afe2c7d9ceacd28ec57c77f8829"
+ integrity sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==
+
+"@esbuild/linux-x64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz#8a0e9738b1635f0c53389e515ae83826dec22aa4"
+ integrity sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==
+
+"@esbuild/netbsd-x64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz#c29fb2453c6b7ddef9a35e2c18b37bda1ae5c462"
+ integrity sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==
+
+"@esbuild/openbsd-x64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz#95e75a391403cb10297280d524d66ce04c920691"
+ integrity sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==
+
+"@esbuild/sunos-x64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz#722eaf057b83c2575937d3ffe5aeb16540da7273"
+ integrity sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==
+
+"@esbuild/win32-arm64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz#9aa9dc074399288bdcdd283443e9aeb6b9552b6f"
+ integrity sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==
+
+"@esbuild/win32-ia32@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz#95ad43c62ad62485e210f6299c7b2571e48d2b03"
+ integrity sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==
+
+"@esbuild/win32-x64@0.17.19":
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz#8cfaf2ff603e9aabb910e9c0558c26cf32744061"
+ integrity sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==
"@ethersproject/abi@^5.6.3", "@ethersproject/abi@^5.6.4":
version "5.6.4"
@@ -135,6 +253,15 @@
"@ethersproject/logger" "^5.6.0"
bn.js "^5.2.1"
+"@ethersproject/bignumber@^5.7.0":
+ version "5.7.0"
+ resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2"
+ integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==
+ dependencies:
+ "@ethersproject/bytes" "^5.7.0"
+ "@ethersproject/logger" "^5.7.0"
+ bn.js "^5.2.1"
+
"@ethersproject/bytes@^5.6.1":
version "5.6.1"
resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.6.1.tgz#24f916e411f82a8a60412344bf4a813b917eefe7"
@@ -142,6 +269,13 @@
dependencies:
"@ethersproject/logger" "^5.6.0"
+"@ethersproject/bytes@^5.7.0":
+ version "5.7.0"
+ resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d"
+ integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==
+ dependencies:
+ "@ethersproject/logger" "^5.7.0"
+
"@ethersproject/constants@^5.6.1":
version "5.6.1"
resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.6.1.tgz#e2e974cac160dd101cf79fdf879d7d18e8cb1370"
@@ -149,6 +283,13 @@
dependencies:
"@ethersproject/bignumber" "^5.6.2"
+"@ethersproject/constants@^5.7.0":
+ version "5.7.0"
+ resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e"
+ integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==
+ dependencies:
+ "@ethersproject/bignumber" "^5.7.0"
+
"@ethersproject/contracts@^5.6.2":
version "5.6.2"
resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.6.2.tgz#20b52e69ebc1b74274ff8e3d4e508de971c287bc"
@@ -229,6 +370,11 @@
resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.6.0.tgz#d7db1bfcc22fd2e4ab574cba0bb6ad779a9a3e7a"
integrity sha512-BiBWllUROH9w+P21RzoxJKzqoqpkyM1pRnEKG69bulE9TSQD8SAIvTQqIMZmmCO8pUNkgLP1wndX1gKghSpBmg==
+"@ethersproject/logger@^5.7.0":
+ version "5.7.0"
+ resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892"
+ integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==
+
"@ethersproject/networks@^5.6.3":
version "5.6.4"
resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.6.4.tgz#51296d8fec59e9627554f5a8a9c7791248c8dc07"
@@ -338,6 +484,15 @@
"@ethersproject/rlp" "^5.6.1"
"@ethersproject/signing-key" "^5.6.2"
+"@ethersproject/units@^5.7.0":
+ version "5.7.0"
+ resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1"
+ integrity sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==
+ dependencies:
+ "@ethersproject/bignumber" "^5.7.0"
+ "@ethersproject/constants" "^5.7.0"
+ "@ethersproject/logger" "^5.7.0"
+
"@ethersproject/wallet@^5.6.2":
version "5.6.2"
resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.6.2.tgz#cd61429d1e934681e413f4bc847a5f2f87e3a03c"
@@ -386,6 +541,11 @@
resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6"
integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==
+"@istanbuljs/schema@^0.1.2":
+ version "0.1.3"
+ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98"
+ integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==
+
"@jridgewell/gen-mapping@^0.3.0":
version "0.3.2"
resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9"
@@ -395,7 +555,7 @@
"@jridgewell/sourcemap-codec" "^1.4.10"
"@jridgewell/trace-mapping" "^0.3.9"
-"@jridgewell/resolve-uri@^3.0.3":
+"@jridgewell/resolve-uri@3.1.0", "@jridgewell/resolve-uri@^3.0.3":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78"
integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==
@@ -413,11 +573,24 @@
"@jridgewell/gen-mapping" "^0.3.0"
"@jridgewell/trace-mapping" "^0.3.9"
-"@jridgewell/sourcemap-codec@^1.4.10":
+"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10":
version "1.4.14"
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24"
integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==
+"@jridgewell/sourcemap-codec@^1.4.13":
+ version "1.4.15"
+ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
+ integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
+
+"@jridgewell/trace-mapping@^0.3.12":
+ version "0.3.18"
+ resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6"
+ integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==
+ dependencies:
+ "@jridgewell/resolve-uri" "3.1.0"
+ "@jridgewell/sourcemap-codec" "1.4.14"
+
"@jridgewell/trace-mapping@^0.3.9":
version "0.3.15"
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774"
@@ -552,10 +725,10 @@
dependencies:
"@types/chai" "*"
-"@types/chai@*", "@types/chai@^4.3.3":
- version "4.3.3"
- resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.3.tgz#3c90752792660c4b562ad73b3fbd68bf3bc7ae07"
- integrity sha512-hC7OMnszpxhZPduX+m+nrx+uFoLkWOMiR4oa/AZF3MuSETYTZmFfJAHqZEM8MVlvfG7BEUcgvtwoCTxBp6hm3g==
+"@types/chai@*", "@types/chai@^4.3.5":
+ version "4.3.5"
+ resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.5.tgz#ae69bcbb1bebb68c4ac0b11e9d8ed04526b3562b"
+ integrity sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==
"@types/color-name@^1.1.1":
version "1.1.1"
@@ -567,12 +740,22 @@
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
+"@types/istanbul-lib-coverage@^2.0.1":
+ version "2.0.4"
+ resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44"
+ integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==
+
"@types/json-schema@^7.0.7":
version "7.0.8"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.8.tgz#edf1bf1dbf4e04413ca8e5b17b3b7d7d54b59818"
integrity sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==
-"@types/node@*", "@types/node@^13.9.5":
+"@types/node@*":
+ version "20.3.3"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.3.tgz#329842940042d2b280897150e023e604d11657d6"
+ integrity sha512-wheIYdr4NYML61AjC8MKj/2jrR/kDQri/CIpVoZwldwhnIrD/j9jIU5bJ8yBKuB2VhpFV7Ab6G2XkBjv9r9Zzw==
+
+"@types/node@^13.9.5":
version "13.9.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.9.5.tgz#59738bf30b31aea1faa2df7f4a5f55613750cf00"
integrity sha512-hkzMMD3xu6BrJpGVLeQ3htQQNAcOrJjX7WFmtK8zWQpz2UJf13LCFF2ALA7c9OVdvc2vQJeDdjfR35M0sBCxvw==
@@ -687,6 +870,67 @@
"@typescript-eslint/types" "4.33.0"
eslint-visitor-keys "^2.0.0"
+"@vitest/coverage-v8@^0.32.2":
+ version "0.32.2"
+ resolved "https://registry.yarnpkg.com/@vitest/coverage-v8/-/coverage-v8-0.32.2.tgz#efb74efd47ccdea59874c700f93f8c30b5766ab9"
+ integrity sha512-/+V3nB3fyeuuSeKxCfi6XmWjDIxpky7AWSkGVfaMjAk7di8igBwRsThLjultwIZdTDH1RAxpjmCXEfSqsMFZOA==
+ dependencies:
+ "@ampproject/remapping" "^2.2.1"
+ "@bcoe/v8-coverage" "^0.2.3"
+ istanbul-lib-coverage "^3.2.0"
+ istanbul-lib-report "^3.0.0"
+ istanbul-lib-source-maps "^4.0.1"
+ istanbul-reports "^3.1.5"
+ magic-string "^0.30.0"
+ picocolors "^1.0.0"
+ std-env "^3.3.2"
+ test-exclude "^6.0.0"
+ v8-to-istanbul "^9.1.0"
+
+"@vitest/expect@0.32.2":
+ version "0.32.2"
+ resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-0.32.2.tgz#8111f6ab1ff3b203efbe3a25e8bb2d160ce4b720"
+ integrity sha512-6q5yzweLnyEv5Zz1fqK5u5E83LU+gOMVBDuxBl2d2Jfx1BAp5M+rZgc5mlyqdnxquyoiOXpXmFNkcGcfFnFH3Q==
+ dependencies:
+ "@vitest/spy" "0.32.2"
+ "@vitest/utils" "0.32.2"
+ chai "^4.3.7"
+
+"@vitest/runner@0.32.2":
+ version "0.32.2"
+ resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-0.32.2.tgz#18dd979ce4e8766bcc90948d11b4c8ae6ed90b89"
+ integrity sha512-06vEL0C1pomOEktGoLjzZw+1Fb+7RBRhmw/06WkDrd1akkT9i12su0ku+R/0QM69dfkIL/rAIDTG+CSuQVDcKw==
+ dependencies:
+ "@vitest/utils" "0.32.2"
+ concordance "^5.0.4"
+ p-limit "^4.0.0"
+ pathe "^1.1.0"
+
+"@vitest/snapshot@0.32.2":
+ version "0.32.2"
+ resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-0.32.2.tgz#500b6453e88e4c50a0aded39839352c16b519b9e"
+ integrity sha512-JwhpeH/PPc7GJX38vEfCy9LtRzf9F4er7i4OsAJyV7sjPwjj+AIR8cUgpMTWK4S3TiamzopcTyLsZDMuldoi5A==
+ dependencies:
+ magic-string "^0.30.0"
+ pathe "^1.1.0"
+ pretty-format "^27.5.1"
+
+"@vitest/spy@0.32.2":
+ version "0.32.2"
+ resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-0.32.2.tgz#f3ef7afe0d34e863b90df7c959fa5af540a6aaf9"
+ integrity sha512-Q/ZNILJ4ca/VzQbRM8ur3Si5Sardsh1HofatG9wsJY1RfEaw0XKP8IVax2lI1qnrk9YPuG9LA2LkZ0EI/3d4ug==
+ dependencies:
+ tinyspy "^2.1.0"
+
+"@vitest/utils@0.32.2":
+ version "0.32.2"
+ resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-0.32.2.tgz#809c720cafbf4b35ce651deb8570d57785e77819"
+ integrity sha512-lnJ0T5i03j0IJaeW73hxe2AuVnZ/y1BhhCOuIcl9LIzXnbpXJT9Lrt6brwKHXLOiA7MZ6N5hSJjt0xE1dGNCzQ==
+ dependencies:
+ diff-sequences "^29.4.3"
+ loupe "^2.3.6"
+ pretty-format "^27.5.1"
+
abbrev@1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8"
@@ -704,6 +948,11 @@ acorn-jsx@^5.2.0:
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe"
integrity sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==
+acorn-walk@^8.2.0:
+ version "8.2.0"
+ resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1"
+ integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==
+
acorn@^5.7.3:
version "5.7.4"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.4.tgz#3e8d8a9947d0599a1796d10225d7432f4a4acf5e"
@@ -719,6 +968,11 @@ acorn@^8.5.0:
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8"
integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==
+acorn@^8.8.2, acorn@^8.9.0:
+ version "8.9.0"
+ resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.9.0.tgz#78a16e3b2bcc198c10822786fa6679e245db5b59"
+ integrity sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==
+
aes-js@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d"
@@ -846,6 +1100,11 @@ ansi-styles@^4.1.0:
"@types/color-name" "^1.1.1"
color-convert "^2.0.1"
+ansi-styles@^5.0.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b"
+ integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==
+
aproba@^1.0.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
@@ -959,6 +1218,11 @@ bl@~0.8.1:
dependencies:
readable-stream "~1.0.26"
+blueimp-md5@^2.10.0:
+ version "2.19.0"
+ resolved "https://registry.yarnpkg.com/blueimp-md5/-/blueimp-md5-2.19.0.tgz#b53feea5498dcb53dc6ec4b823adb84b729c4af0"
+ integrity sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==
+
bn.js@^4.0.0, bn.js@^4.1.0:
version "4.11.9"
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828"
@@ -1108,6 +1372,11 @@ builtins@^1.0.3:
resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88"
integrity sha1-y5T662HIaWRR2zZTThQi+U8K7og=
+cac@^6.7.14:
+ version "6.7.14"
+ resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959"
+ integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==
+
cacache@^15.0.5:
version "15.0.5"
resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.0.5.tgz#69162833da29170d6732334643c60e005f5f17d0"
@@ -1170,14 +1439,14 @@ caseless@~0.12.0:
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=
-chai@^4.3.6:
- version "4.3.6"
- resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.6.tgz#ffe4ba2d9fa9d6680cc0b370adae709ec9011e9c"
- integrity sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==
+chai@^4.3.7:
+ version "4.3.7"
+ resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.7.tgz#ec63f6df01829088e8bf55fca839bcd464a8ec51"
+ integrity sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==
dependencies:
assertion-error "^1.1.0"
check-error "^1.0.2"
- deep-eql "^3.0.1"
+ deep-eql "^4.1.2"
get-func-name "^2.0.0"
loupe "^2.3.1"
pathval "^1.1.1"
@@ -1324,6 +1593,20 @@ concat-stream@^1.4.4:
readable-stream "^2.2.2"
typedarray "^0.0.6"
+concordance@^5.0.4:
+ version "5.0.4"
+ resolved "https://registry.yarnpkg.com/concordance/-/concordance-5.0.4.tgz#9896073261adced72f88d60e4d56f8efc4bbbbd2"
+ integrity sha512-OAcsnTEYu1ARJqWVGwf4zh4JDfHZEaSNlNccFmt8YjB2l/n19/PF2viLINHc57vO4FKIAFl2FWASIGZZWZ2Kxw==
+ dependencies:
+ date-time "^3.1.0"
+ esutils "^2.0.3"
+ fast-diff "^1.2.0"
+ js-string-escape "^1.0.1"
+ lodash "^4.17.15"
+ md5-hex "^3.0.1"
+ semver "^7.3.2"
+ well-known-symbols "^2.0.0"
+
confusing-browser-globals@^1.0.9:
version "1.0.9"
resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz#72bc13b483c0276801681871d4898516f8f54fdd"
@@ -1339,6 +1622,11 @@ contains-path@^0.1.0:
resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a"
integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=
+convert-source-map@^1.6.0:
+ version "1.9.0"
+ resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f"
+ integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==
+
core-util-is@1.0.2, core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -1375,12 +1663,12 @@ create-hmac@^1.1.0, create-hmac@^1.1.4, create-hmac@^1.1.7:
safe-buffer "^5.0.1"
sha.js "^2.4.8"
-cross-fetch@^3.1.5:
- version "3.1.5"
- resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.5.tgz#e1389f44d9e7ba767907f7af8454787952ab534f"
- integrity sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==
+cross-fetch@^3.1.6:
+ version "3.1.6"
+ resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.6.tgz#bae05aa31a4da760969756318feeee6e70f15d6c"
+ integrity sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==
dependencies:
- node-fetch "2.6.7"
+ node-fetch "^2.6.11"
cross-spawn@^6.0.5:
version "6.0.5"
@@ -1417,7 +1705,14 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"
-debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4:
+date-time@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/date-time/-/date-time-3.1.0.tgz#0d1e934d170579f481ed8df1e2b8ff70ee845e1e"
+ integrity sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==
+ dependencies:
+ time-zone "^1.0.0"
+
+debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.3, debug@^4.3.4:
version "4.3.4"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865"
integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==
@@ -1431,10 +1726,10 @@ debug@^2.6.9:
dependencies:
ms "2.0.0"
-deep-eql@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df"
- integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==
+deep-eql@^4.1.2:
+ version "4.1.3"
+ resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d"
+ integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==
dependencies:
type-detect "^4.0.0"
@@ -1485,6 +1780,11 @@ des.js@^1.0.0:
inherits "^2.0.1"
minimalistic-assert "^1.0.0"
+diff-sequences@^29.4.3:
+ version "29.4.3"
+ resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.3.tgz#9314bc1fabe09267ffeca9cbafc457d8499a13f2"
+ integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==
+
diffie-hellman@^5.0.0:
version "5.0.3"
resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875"
@@ -1614,132 +1914,33 @@ es-to-primitive@^1.2.1:
is-date-object "^1.0.1"
is-symbol "^1.0.2"
-esbuild-android-64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.14.54.tgz#505f41832884313bbaffb27704b8bcaa2d8616be"
- integrity sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ==
-
-esbuild-android-arm64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.14.54.tgz#8ce69d7caba49646e009968fe5754a21a9871771"
- integrity sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg==
-
-esbuild-darwin-64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.14.54.tgz#24ba67b9a8cb890a3c08d9018f887cc221cdda25"
- integrity sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug==
-
-esbuild-darwin-arm64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.54.tgz#3f7cdb78888ee05e488d250a2bdaab1fa671bf73"
- integrity sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw==
-
-esbuild-freebsd-64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.54.tgz#09250f997a56ed4650f3e1979c905ffc40bbe94d"
- integrity sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg==
-
-esbuild-freebsd-arm64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.54.tgz#bafb46ed04fc5f97cbdb016d86947a79579f8e48"
- integrity sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q==
-
-esbuild-linux-32@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.14.54.tgz#e2a8c4a8efdc355405325033fcebeb941f781fe5"
- integrity sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw==
-
-esbuild-linux-64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.14.54.tgz#de5fdba1c95666cf72369f52b40b03be71226652"
- integrity sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg==
-
-esbuild-linux-arm64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.54.tgz#dae4cd42ae9787468b6a5c158da4c84e83b0ce8b"
- integrity sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig==
-
-esbuild-linux-arm@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.14.54.tgz#a2c1dff6d0f21dbe8fc6998a122675533ddfcd59"
- integrity sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw==
-
-esbuild-linux-mips64le@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.54.tgz#d9918e9e4cb972f8d6dae8e8655bf9ee131eda34"
- integrity sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==
-
-esbuild-linux-ppc64le@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.54.tgz#3f9a0f6d41073fb1a640680845c7de52995f137e"
- integrity sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ==
-
-esbuild-linux-riscv64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.54.tgz#618853c028178a61837bc799d2013d4695e451c8"
- integrity sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg==
-
-esbuild-linux-s390x@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.54.tgz#d1885c4c5a76bbb5a0fe182e2c8c60eb9e29f2a6"
- integrity sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA==
-
-esbuild-netbsd-64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.54.tgz#69ae917a2ff241b7df1dbf22baf04bd330349e81"
- integrity sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w==
-
-esbuild-openbsd-64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.54.tgz#db4c8495287a350a6790de22edea247a57c5d47b"
- integrity sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw==
-
-esbuild-sunos-64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.14.54.tgz#54287ee3da73d3844b721c21bc80c1dc7e1bf7da"
- integrity sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw==
-
-esbuild-windows-32@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.14.54.tgz#f8aaf9a5667630b40f0fb3aa37bf01bbd340ce31"
- integrity sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w==
-
-esbuild-windows-64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.14.54.tgz#bf54b51bd3e9b0f1886ffdb224a4176031ea0af4"
- integrity sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ==
-
-esbuild-windows-arm64@0.14.54:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.54.tgz#937d15675a15e4b0e4fafdbaa3a01a776a2be982"
- integrity sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg==
-
-esbuild@^0.14.47:
- version "0.14.54"
- resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.14.54.tgz#8b44dcf2b0f1a66fc22459943dccf477535e9aa2"
- integrity sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==
+esbuild@^0.17.5:
+ version "0.17.19"
+ resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.17.19.tgz#087a727e98299f0462a3d0bcdd9cd7ff100bd955"
+ integrity sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==
optionalDependencies:
- "@esbuild/linux-loong64" "0.14.54"
- esbuild-android-64 "0.14.54"
- esbuild-android-arm64 "0.14.54"
- esbuild-darwin-64 "0.14.54"
- esbuild-darwin-arm64 "0.14.54"
- esbuild-freebsd-64 "0.14.54"
- esbuild-freebsd-arm64 "0.14.54"
- esbuild-linux-32 "0.14.54"
- esbuild-linux-64 "0.14.54"
- esbuild-linux-arm "0.14.54"
- esbuild-linux-arm64 "0.14.54"
- esbuild-linux-mips64le "0.14.54"
- esbuild-linux-ppc64le "0.14.54"
- esbuild-linux-riscv64 "0.14.54"
- esbuild-linux-s390x "0.14.54"
- esbuild-netbsd-64 "0.14.54"
- esbuild-openbsd-64 "0.14.54"
- esbuild-sunos-64 "0.14.54"
- esbuild-windows-32 "0.14.54"
- esbuild-windows-64 "0.14.54"
- esbuild-windows-arm64 "0.14.54"
+ "@esbuild/android-arm" "0.17.19"
+ "@esbuild/android-arm64" "0.17.19"
+ "@esbuild/android-x64" "0.17.19"
+ "@esbuild/darwin-arm64" "0.17.19"
+ "@esbuild/darwin-x64" "0.17.19"
+ "@esbuild/freebsd-arm64" "0.17.19"
+ "@esbuild/freebsd-x64" "0.17.19"
+ "@esbuild/linux-arm" "0.17.19"
+ "@esbuild/linux-arm64" "0.17.19"
+ "@esbuild/linux-ia32" "0.17.19"
+ "@esbuild/linux-loong64" "0.17.19"
+ "@esbuild/linux-mips64el" "0.17.19"
+ "@esbuild/linux-ppc64" "0.17.19"
+ "@esbuild/linux-riscv64" "0.17.19"
+ "@esbuild/linux-s390x" "0.17.19"
+ "@esbuild/linux-x64" "0.17.19"
+ "@esbuild/netbsd-x64" "0.17.19"
+ "@esbuild/openbsd-x64" "0.17.19"
+ "@esbuild/sunos-x64" "0.17.19"
+ "@esbuild/win32-arm64" "0.17.19"
+ "@esbuild/win32-ia32" "0.17.19"
+ "@esbuild/win32-x64" "0.17.19"
escape-string-regexp@^1.0.5:
version "1.0.5"
@@ -1949,7 +2150,7 @@ estree-walker@^2.0.1:
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
-esutils@^2.0.2:
+esutils@^2.0.2, esutils@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
@@ -1991,6 +2192,11 @@ fast-diff@^1.1.2:
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03"
integrity sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==
+fast-diff@^1.2.0:
+ version "1.3.0"
+ resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.3.0.tgz#ece407fa550a64d638536cd727e129c61616e0f0"
+ integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==
+
fast-glob@^3.1.1:
version "3.2.6"
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.6.tgz#434dd9529845176ea049acc9343e8282765c6e1a"
@@ -2311,6 +2517,11 @@ hosted-git-info@^4.0.1:
dependencies:
lru-cache "^6.0.0"
+html-escaper@^2.0.0:
+ version "2.0.2"
+ resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453"
+ integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==
+
http-cache-semantics@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
@@ -2460,7 +2671,7 @@ is-callable@^1.1.4, is-callable@^1.1.5:
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab"
integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==
-is-core-module@^2.2.0, is-core-module@^2.9.0:
+is-core-module@^2.2.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.9.0.tgz#e1c34429cd51c6dd9e09e0799e396e27b19a9c69"
integrity sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==
@@ -2587,6 +2798,37 @@ isstream@~0.1.2:
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
+istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3"
+ integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==
+
+istanbul-lib-report@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6"
+ integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==
+ dependencies:
+ istanbul-lib-coverage "^3.0.0"
+ make-dir "^3.0.0"
+ supports-color "^7.1.0"
+
+istanbul-lib-source-maps@^4.0.1:
+ version "4.0.1"
+ resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551"
+ integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==
+ dependencies:
+ debug "^4.1.1"
+ istanbul-lib-coverage "^3.0.0"
+ source-map "^0.6.1"
+
+istanbul-reports@^3.1.5:
+ version "3.1.5"
+ resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.5.tgz#cc9a6ab25cb25659810e4785ed9d9fb742578bae"
+ integrity sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==
+ dependencies:
+ html-escaper "^2.0.0"
+ istanbul-lib-report "^3.0.0"
+
jest-worker@^26.2.1:
version "26.3.0"
resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.3.0.tgz#7c8a97e4f4364b4f05ed8bca8ca0c24de091871f"
@@ -2601,6 +2843,11 @@ js-sha3@0.8.0:
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840"
integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==
+js-string-escape@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef"
+ integrity sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==
+
js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
@@ -2654,6 +2901,11 @@ json-to-graphql-query@^2.2.4:
resolved "https://registry.yarnpkg.com/json-to-graphql-query/-/json-to-graphql-query-2.2.4.tgz#ada9cfdbb9bf38589fd2661e1588d1edd0a882cc"
integrity sha512-vNvsOKDSlEqYCzejI1xHS9Hm738dSnG4Upy09LUGqyybZXSIIb7NydDphB/6WxW2EEVpPU4JeU/Yo63Nw9dEJg==
+jsonc-parser@^3.2.0:
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76"
+ integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==
+
jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
@@ -2779,10 +3031,10 @@ load-json-file@^2.0.0:
pify "^2.0.0"
strip-bom "^3.0.0"
-local-pkg@^0.4.2:
- version "0.4.2"
- resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.2.tgz#13107310b77e74a0e513147a131a2ba288176c2f"
- integrity sha512-mlERgSPrbxU3BP4qBqAvvwlgW4MTg78iwJdGGnv7kibKjWcJksrG3t6LB5lXI93wXRDvG4NpUgJFmTG4T6rdrg==
+local-pkg@^0.4.3:
+ version "0.4.3"
+ resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.3.tgz#0ff361ab3ae7f1c19113d9bb97b98b905dbc4963"
+ integrity sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==
locate-path@^2.0.0:
version "2.0.0"
@@ -2809,10 +3061,10 @@ lodash@^4.17.14, lodash@^4.17.15:
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
-loupe@^2.3.1:
- version "2.3.4"
- resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.4.tgz#7e0b9bffc76f148f9be769cb1321d3dcf3cb25f3"
- integrity sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==
+loupe@^2.3.1, loupe@^2.3.6:
+ version "2.3.6"
+ resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.6.tgz#76e4af498103c532d1ecc9be102036a21f787b53"
+ integrity sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==
dependencies:
get-func-name "^2.0.0"
@@ -2842,6 +3094,20 @@ magic-string@^0.25.7:
dependencies:
sourcemap-codec "^1.4.4"
+magic-string@^0.30.0:
+ version "0.30.0"
+ resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.0.tgz#fd58a4748c5c4547338a424e90fa5dd17f4de529"
+ integrity sha512-LA+31JYDJLs82r2ScLrlz1GjSgu66ZV518eyWT+S8VhyQn/JL0u9MeBOvQMGYiPk1DBiSN9DDMOcXvigJZaViQ==
+ dependencies:
+ "@jridgewell/sourcemap-codec" "^1.4.13"
+
+make-dir@^3.0.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f"
+ integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==
+ dependencies:
+ semver "^6.0.0"
+
make-dir@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.2.tgz#04a1acbf22221e1d6ef43559f43e05a90dbb4392"
@@ -2871,6 +3137,13 @@ make-fetch-happen@^9.0.1:
socks-proxy-agent "^6.0.0"
ssri "^8.0.0"
+md5-hex@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-3.0.1.tgz#be3741b510591434b2784d79e556eefc2c9a8e5c"
+ integrity sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==
+ dependencies:
+ blueimp-md5 "^2.10.0"
+
md5.js@^1.3.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f"
@@ -3019,6 +3292,16 @@ mkdirp@^1.0.3, mkdirp@^1.0.4:
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
+mlly@^1.2.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.4.0.tgz#830c10d63f1f97bd8785377b24dc2a15d972832b"
+ integrity sha512-ua8PAThnTwpprIaU47EPeZ/bPUVp2QYBbWMphUQpVdBI3Lgqzm5KZQ45Agm3YJedHXaIHl6pBGabaLSUPPSptg==
+ dependencies:
+ acorn "^8.9.0"
+ pathe "^1.1.1"
+ pkg-types "^1.0.3"
+ ufo "^1.1.2"
+
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
@@ -3034,10 +3317,10 @@ mute-stream@0.0.8:
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
-nanoid@^3.3.4:
- version "3.3.4"
- resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab"
- integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==
+nanoid@^3.3.6:
+ version "3.3.6"
+ resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c"
+ integrity sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==
natural-compare@^1.4.0:
version "1.4.0"
@@ -3054,10 +3337,10 @@ nice-try@^1.0.4:
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366"
integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==
-node-fetch@2.6.7:
- version "2.6.7"
- resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
- integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
+node-fetch@^2.6.11:
+ version "2.6.11"
+ resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.11.tgz#cde7fc71deef3131ef80a738919f999e6edfff25"
+ integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==
dependencies:
whatwg-url "^5.0.0"
@@ -3301,6 +3584,13 @@ p-limit@^2.2.0:
dependencies:
p-try "^2.0.0"
+p-limit@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-4.0.0.tgz#914af6544ed32bfa54670b061cafcbd04984b644"
+ integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==
+ dependencies:
+ yocto-queue "^1.0.0"
+
p-locate@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43"
@@ -3407,11 +3697,6 @@ path-parse@^1.0.6:
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c"
integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==
-path-parse@^1.0.7:
- version "1.0.7"
- resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
- integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
-
path-type@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
@@ -3424,6 +3709,11 @@ path-type@^4.0.0:
resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b"
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
+pathe@^1.1.0, pathe@^1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.1.tgz#1dd31d382b974ba69809adc9a7a347e65d84829a"
+ integrity sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==
+
pathval@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d"
@@ -3479,12 +3769,21 @@ pkg-dir@^4.1.0:
dependencies:
find-up "^4.0.0"
-postcss@^8.4.16:
- version "8.4.16"
- resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.16.tgz#33a1d675fac39941f5f445db0de4db2b6e01d43c"
- integrity sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ==
+pkg-types@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.0.3.tgz#988b42ab19254c01614d13f4f65a2cfc7880f868"
+ integrity sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==
+ dependencies:
+ jsonc-parser "^3.2.0"
+ mlly "^1.2.0"
+ pathe "^1.1.0"
+
+postcss@^8.4.23:
+ version "8.4.24"
+ resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.24.tgz#f714dba9b2284be3cc07dbd2fc57ee4dc972d2df"
+ integrity sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==
dependencies:
- nanoid "^3.3.4"
+ nanoid "^3.3.6"
picocolors "^1.0.0"
source-map-js "^1.0.2"
@@ -3505,6 +3804,15 @@ prettier@2.7.1:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==
+pretty-format@^27.5.1:
+ version "27.5.1"
+ resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e"
+ integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==
+ dependencies:
+ ansi-regex "^5.0.1"
+ ansi-styles "^5.0.0"
+ react-is "^17.0.1"
+
process-es6@^0.11.2, process-es6@^0.11.6:
version "0.11.6"
resolved "https://registry.yarnpkg.com/process-es6/-/process-es6-0.11.6.tgz#c6bb389f9a951f82bd4eb169600105bd2ff9c778"
@@ -3590,6 +3898,11 @@ randomfill@^1.0.3:
randombytes "^2.0.5"
safe-buffer "^5.1.0"
+react-is@^17.0.1:
+ version "17.0.2"
+ resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
+ integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==
+
read-package-json-fast@^2.0.1:
version "2.0.3"
resolved "https://registry.yarnpkg.com/read-package-json-fast/-/read-package-json-fast-2.0.3.tgz#323ca529630da82cb34b36cc0b996693c98c2b83"
@@ -3723,15 +4036,6 @@ resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.1
is-core-module "^2.2.0"
path-parse "^1.0.6"
-resolve@^1.22.1:
- version "1.22.1"
- resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177"
- integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==
- dependencies:
- is-core-module "^2.9.0"
- path-parse "^1.0.7"
- supports-preserve-symlinks-flag "^1.0.0"
-
restore-cursor@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e"
@@ -3850,13 +4154,6 @@ rollup-pluginutils@^2.3.1, rollup-pluginutils@^2.4.1, rollup-pluginutils@^2.5.0:
dependencies:
estree-walker "^0.6.1"
-"rollup@>=2.75.6 <2.77.0 || ~2.77.0":
- version "2.77.3"
- resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.77.3.tgz#8f00418d3a2740036e15deb653bed1a90ee0cc12"
- integrity sha512-/qxNTG7FbmefJWoeeYJFbHehJ2HNWnjkAFRKzWN/45eNBBF/r8lo992CwcJXEzyVxs5FmfId+vTSTQDb+bxA+g==
- optionalDependencies:
- fsevents "~2.3.2"
-
rollup@^2.35.1:
version "2.35.1"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.35.1.tgz#e6bc8d10893556a638066f89e8c97f422d03968c"
@@ -3864,6 +4161,13 @@ rollup@^2.35.1:
optionalDependencies:
fsevents "~2.1.2"
+rollup@^3.21.0:
+ version "3.26.0"
+ resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.26.0.tgz#9f2e0316a4ca641911cefd8515c562a9124e6130"
+ integrity sha512-YzJH0eunH2hr3knvF3i6IkLO/jTjAEwU4HoMUbQl4//Tnl3ou0e7P5SjxdDr8HQJdeUJShlbEHXrrnEHy1l7Yg==
+ optionalDependencies:
+ fsevents "~2.3.2"
+
run-async@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.0.tgz#e59054a5b86876cfae07f431d18cbaddc594f1e8"
@@ -3973,6 +4277,11 @@ shebang-regex@^1.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
+siginfo@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30"
+ integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==
+
signal-exit@^3.0.0, signal-exit@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c"
@@ -4027,7 +4336,7 @@ source-map-support@~0.5.20:
buffer-from "^1.0.0"
source-map "^0.6.0"
-source-map@^0.6.0:
+source-map@^0.6.0, source-map@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
@@ -4090,6 +4399,16 @@ ssri@^8.0.0, ssri@^8.0.1:
dependencies:
minipass "^3.1.1"
+stackback@0.0.2:
+ version "0.0.2"
+ resolved "https://registry.yarnpkg.com/stackback/-/stackback-0.0.2.tgz#1ac8a0d9483848d1695e418b6d031a3c3ce68e3b"
+ integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==
+
+std-env@^3.3.2:
+ version "3.3.3"
+ resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.3.3.tgz#a54f06eb245fdcfef53d56f3c0251f1d5c3d01fe"
+ integrity sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==
+
string-range@~1.2, string-range@~1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/string-range/-/string-range-1.2.2.tgz#a893ed347e72299bc83befbbf2a692a8d239d5dd"
@@ -4237,6 +4556,13 @@ strip-json-comments@^3.0.1:
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7"
integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==
+strip-literal@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/strip-literal/-/strip-literal-1.0.1.tgz#0115a332710c849b4e46497891fb8d585e404bd2"
+ integrity sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==
+ dependencies:
+ acorn "^8.8.2"
+
supports-color@^5.3.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
@@ -4251,11 +4577,6 @@ supports-color@^7.0.0, supports-color@^7.1.0:
dependencies:
has-flag "^4.0.0"
-supports-preserve-symlinks-flag@^1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
- integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
-
table@^5.2.3:
version "5.4.6"
resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e"
@@ -4300,6 +4621,15 @@ terser@^5.0.0, terser@^5.6.0:
commander "^2.20.0"
source-map-support "~0.5.20"
+test-exclude@^6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e"
+ integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==
+ dependencies:
+ "@istanbuljs/schema" "^0.1.2"
+ glob "^7.1.4"
+ minimatch "^3.0.4"
+
text-table@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
@@ -4310,15 +4640,25 @@ through@^2.3.6:
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
-tinypool@^0.2.4:
- version "0.2.4"
- resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.2.4.tgz#4d2598c4689d1a2ce267ddf3360a9c6b3925a20c"
- integrity sha512-Vs3rhkUH6Qq1t5bqtb816oT+HeJTXfwt2cbPH17sWHIYKTotQIFPk3tf2fgqRrVyMDVOc1EnPgzIxfIulXVzwQ==
+time-zone@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/time-zone/-/time-zone-1.0.0.tgz#99c5bf55958966af6d06d83bdf3800dc82faec5d"
+ integrity sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==
-tinyspy@^1.0.2:
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-1.0.2.tgz#6da0b3918bfd56170fb3cd3a2b5ef832ee1dff0d"
- integrity sha512-bSGlgwLBYf7PnUsQ6WOc6SJ3pGOcd+d8AA6EUnLDDM0kWEstC1JIlSZA3UNliDXhd9ABoS7hiRBDCu+XP/sf1Q==
+tinybench@^2.5.0:
+ version "2.5.0"
+ resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.5.0.tgz#4711c99bbf6f3e986f67eb722fed9cddb3a68ba5"
+ integrity sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==
+
+tinypool@^0.5.0:
+ version "0.5.0"
+ resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.5.0.tgz#3861c3069bf71e4f1f5aa2d2e6b3aaacc278961e"
+ integrity sha512-paHQtnrlS1QZYKF/GnLoOM/DN9fqaGOFbCbxzAhwniySnzl9Ebk8w73/dd34DAhe/obUbPAOldTyYXQZxnPBPQ==
+
+tinyspy@^2.1.0:
+ version "2.1.1"
+ resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-2.1.1.tgz#9e6371b00c259e5c5b301917ca18c01d40ae558c"
+ integrity sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==
tmp@^0.0.33:
version "0.0.33"
@@ -4413,6 +4753,11 @@ typescript@^3.8.3:
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061"
integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==
+ufo@^1.1.2:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.1.2.tgz#d0d9e0fa09dece0c31ffd57bd363f030a35cfe76"
+ integrity sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==
+
unique-filename@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230"
@@ -4454,6 +4799,15 @@ v8-compile-cache@^2.0.3:
resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e"
integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==
+v8-to-istanbul@^9.1.0:
+ version "9.1.0"
+ resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz#1b83ed4e397f58c85c266a570fc2558b5feb9265"
+ integrity sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==
+ dependencies:
+ "@jridgewell/trace-mapping" "^0.3.12"
+ "@types/istanbul-lib-coverage" "^2.0.1"
+ convert-source-map "^1.6.0"
+
validate-npm-package-license@^3.0.1:
version "3.0.4"
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
@@ -4478,32 +4832,59 @@ verror@1.10.0:
core-util-is "1.0.2"
extsprintf "^1.2.0"
-"vite@^2.9.12 || ^3.0.0-0":
- version "3.0.9"
- resolved "https://registry.yarnpkg.com/vite/-/vite-3.0.9.tgz#45fac22c2a5290a970f23d66c1aef56a04be8a30"
- integrity sha512-waYABTM+G6DBTCpYAxvevpG50UOlZuynR0ckTK5PawNVt7ebX6X7wNXHaGIO6wYYFXSM7/WcuFuO2QzhBB6aMw==
+vite-node@0.32.2:
+ version "0.32.2"
+ resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-0.32.2.tgz#bfccdfeb708b2309ea9e5fe424951c75bb9c0096"
+ integrity sha512-dTQ1DCLwl2aEseov7cfQ+kDMNJpM1ebpyMMMwWzBvLbis8Nla/6c9WQcqpPssTwS6Rp/+U6KwlIj8Eapw4bLdA==
+ dependencies:
+ cac "^6.7.14"
+ debug "^4.3.4"
+ mlly "^1.2.0"
+ pathe "^1.1.0"
+ picocolors "^1.0.0"
+ vite "^3.0.0 || ^4.0.0"
+
+"vite@^3.0.0 || ^4.0.0":
+ version "4.3.9"
+ resolved "https://registry.yarnpkg.com/vite/-/vite-4.3.9.tgz#db896200c0b1aa13b37cdc35c9e99ee2fdd5f96d"
+ integrity sha512-qsTNZjO9NoJNW7KnOrgYwczm0WctJ8m/yqYAMAK9Lxt4SoySUfS5S8ia9K7JHpa3KEeMfyF8LoJ3c5NeBJy6pg==
dependencies:
- esbuild "^0.14.47"
- postcss "^8.4.16"
- resolve "^1.22.1"
- rollup ">=2.75.6 <2.77.0 || ~2.77.0"
+ esbuild "^0.17.5"
+ postcss "^8.4.23"
+ rollup "^3.21.0"
optionalDependencies:
fsevents "~2.3.2"
-vitest@^0.22.1:
- version "0.22.1"
- resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.22.1.tgz#3122e6024bf782ee9aca53034017af7adb009c32"
- integrity sha512-+x28YTnSLth4KbXg7MCzoDAzPJlJex7YgiZbUh6YLp0/4PqVZ7q7/zyfdL0OaPtKTpNiQFPpMC8Y2MSzk8F7dw==
+vitest@^0.32.1:
+ version "0.32.2"
+ resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.32.2.tgz#758ce2220f609e240ac054eca7ad11a5140679ab"
+ integrity sha512-hU8GNNuQfwuQmqTLfiKcqEhZY72Zxb7nnN07koCUNmntNxbKQnVbeIS6sqUgR3eXSlbOpit8+/gr1KpqoMgWCQ==
dependencies:
- "@types/chai" "^4.3.3"
+ "@types/chai" "^4.3.5"
"@types/chai-subset" "^1.3.3"
"@types/node" "*"
- chai "^4.3.6"
+ "@vitest/expect" "0.32.2"
+ "@vitest/runner" "0.32.2"
+ "@vitest/snapshot" "0.32.2"
+ "@vitest/spy" "0.32.2"
+ "@vitest/utils" "0.32.2"
+ acorn "^8.8.2"
+ acorn-walk "^8.2.0"
+ cac "^6.7.14"
+ chai "^4.3.7"
+ concordance "^5.0.4"
debug "^4.3.4"
- local-pkg "^0.4.2"
- tinypool "^0.2.4"
- tinyspy "^1.0.2"
- vite "^2.9.12 || ^3.0.0-0"
+ local-pkg "^0.4.3"
+ magic-string "^0.30.0"
+ pathe "^1.1.0"
+ picocolors "^1.0.0"
+ std-env "^3.3.2"
+ strip-literal "^1.0.1"
+ tinybench "^2.5.0"
+ tinypool "^0.5.0"
+ vite "^3.0.0 || ^4.0.0"
+ vite-node "0.32.2"
+ why-is-node-running "^2.2.2"
vlq@^0.2.2:
version "0.2.3"
@@ -4515,6 +4896,11 @@ webidl-conversions@^3.0.0:
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==
+well-known-symbols@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/well-known-symbols/-/well-known-symbols-2.0.0.tgz#e9c7c07dbd132b7b84212c8174391ec1f9871ba5"
+ integrity sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==
+
whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
@@ -4537,6 +4923,14 @@ which@^2.0.2:
dependencies:
isexe "^2.0.0"
+why-is-node-running@^2.2.2:
+ version "2.2.2"
+ resolved "https://registry.yarnpkg.com/why-is-node-running/-/why-is-node-running-2.2.2.tgz#4185b2b4699117819e7154594271e7e344c9973e"
+ integrity sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==
+ dependencies:
+ siginfo "^2.0.0"
+ stackback "0.0.2"
+
wide-align@^1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
@@ -4611,3 +5005,8 @@ yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
+
+yocto-queue@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251"
+ integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==