From fcaa6ebb95949047d050fed4139d404d96d6e675 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Thu, 14 Sep 2023 11:55:15 -0700 Subject: [PATCH 01/31] - reorganization - start working on the financial statement - implement etl for the vault --- abi/erc20.json | 222 ++ abi/oeth.json | 674 +++++- db/migrations/1693432670893-Data.js | 41 - db/migrations/1694734538759-Data.js | 109 + .env => dev.env | 2 +- graphql.config.yml | 4 + package-lock.json | 2020 +++++++---------- package.json | 14 +- schema.graphql | 72 + src/abi/erc20.abi.ts | 218 ++ src/abi/erc20.ts | 71 + src/main.ts | 356 +-- src/model/generated/apy.model.ts | 6 +- src/model/generated/curve.model.ts | 30 + src/model/generated/dripper.model.ts | 27 + .../generated/financialStatement.model.ts | 48 + src/model/generated/fraxStaking.model.ts | 27 + src/model/generated/index.ts | 6 + src/model/generated/morphoAave.model.ts | 27 + src/model/generated/vault.model.ts | 39 + src/parser/index.ts | 1 + src/parser/parser.ts | 104 + src/processor.ts | 54 +- src/transform/index.ts | 1 + src/transform/transform.ts | 314 +++ src/utils/addresses.ts | 19 + types.graphql | 18 + 27 files changed, 2885 insertions(+), 1639 deletions(-) create mode 100644 abi/erc20.json delete mode 100644 db/migrations/1693432670893-Data.js create mode 100644 db/migrations/1694734538759-Data.js rename .env => dev.env (78%) create mode 100644 graphql.config.yml create mode 100644 src/abi/erc20.abi.ts create mode 100644 src/abi/erc20.ts create mode 100644 src/model/generated/curve.model.ts create mode 100644 src/model/generated/dripper.model.ts create mode 100644 src/model/generated/financialStatement.model.ts create mode 100644 src/model/generated/fraxStaking.model.ts create mode 100644 src/model/generated/morphoAave.model.ts create mode 100644 src/model/generated/vault.model.ts create mode 100644 src/parser/index.ts create mode 100644 src/parser/parser.ts create mode 100644 src/transform/index.ts create mode 100644 src/transform/transform.ts create mode 100644 src/utils/addresses.ts create mode 100644 types.graphql diff --git a/abi/erc20.json b/abi/erc20.json new file mode 100644 index 00000000..3b0ab2f1 --- /dev/null +++ b/abi/erc20.json @@ -0,0 +1,222 @@ +[ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "balance", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + } +] \ No newline at end of file diff --git a/abi/oeth.json b/abi/oeth.json index a7ce3a31..71856e11 100644 --- a/abi/oeth.json +++ b/abi/oeth.json @@ -1 +1,673 @@ -[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousGovernor","type":"address"},{"indexed":true,"internalType":"address","name":"newGovernor","type":"address"}],"name":"GovernorshipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousGovernor","type":"address"},{"indexed":true,"internalType":"address","name":"newGovernor","type":"address"}],"name":"PendingGovernorshipTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rebasingCredits","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rebasingCreditsPerToken","type":"uint256"}],"name":"TotalSupplyUpdatedHighres","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"_totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newTotalSupply","type":"uint256"}],"name":"changeSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"creditsBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"creditsBalanceOfHighres","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"governor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_nameArg","type":"string"},{"internalType":"string","name":"_symbolArg","type":"string"},{"internalType":"address","name":"_vaultAddress","type":"address"},{"internalType":"uint256","name":"_initialCreditsPerToken","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isGovernor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isUpgraded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonRebasingCreditsPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonRebasingSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebaseOptIn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rebaseOptOut","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"rebaseState","outputs":[{"internalType":"enum OUSD.RebaseOptions","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebasingCredits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebasingCreditsHighres","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebasingCreditsPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebasingCreditsPerTokenHighres","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newGovernor","type":"address"}],"name":"transferGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vaultAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}] \ No newline at end of file +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousGovernor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "GovernorshipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousGovernor", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newGovernor", + "type": "address" + } + ], + "name": "PendingGovernorshipTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "totalSupply", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rebasingCredits", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "rebasingCreditsPerToken", + "type": "uint256" + } + ], + "name": "TotalSupplyUpdatedHighres", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "_totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_owner", + "type": "address" + }, + { + "internalType": "address", + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_newTotalSupply", + "type": "uint256" + } + ], + "name": "changeSupply", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "claimGovernance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "creditsBalanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + } + ], + "name": "creditsBalanceOfHighres", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "governor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "_nameArg", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbolArg", + "type": "string" + }, + { + "internalType": "address", + "name": "_vaultAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_initialCreditsPerToken", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "isGovernor", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "isUpgraded", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonRebasingCreditsPerToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nonRebasingSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rebaseOptIn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rebaseOptOut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "rebaseState", + "outputs": [ + { + "internalType": "enum OUSD.RebaseOptions", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rebasingCredits", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rebasingCreditsHighres", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rebasingCreditsPerToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "rebasingCreditsPerTokenHighres", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_from", + "type": "address" + }, + { + "internalType": "address", + "name": "_to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newGovernor", + "type": "address" + } + ], + "name": "transferGovernance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "vaultAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/db/migrations/1693432670893-Data.js b/db/migrations/1693432670893-Data.js deleted file mode 100644 index a1ce9f13..00000000 --- a/db/migrations/1693432670893-Data.js +++ /dev/null @@ -1,41 +0,0 @@ -module.exports = class Data1693432670893 { - name = 'Data1693432670893' - - async up(db) { - await db.query(`CREATE TABLE "history" ("id" character varying NOT NULL, "value" numeric NOT NULL, "balance" numeric NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "type" text NOT NULL, "address_id" character varying, CONSTRAINT "PK_9384942edf4804b38ca0ee51416" PRIMARY KEY ("id"))`) - await db.query(`CREATE INDEX "IDX_59a55adcc59ddb69c297da693e" ON "history" ("address_id") `) - await db.query(`CREATE INDEX "IDX_7a259431108a22e8ca2f375fc7" ON "history" ("block_number") `) - await db.query(`CREATE INDEX "IDX_1b82c15d87635d95eaa4dd42ec" ON "history" ("tx_hash") `) - await db.query(`CREATE TABLE "address" ("id" character varying NOT NULL, "is_contract" boolean NOT NULL, "rebasing_option" text NOT NULL, "balance" numeric NOT NULL, "earned" numeric NOT NULL, "credits" numeric NOT NULL, "last_updated" TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT "PK_d92de1f82754668b5f5f5dd4fd5" PRIMARY KEY ("id"))`) - await db.query(`CREATE TABLE "apy" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "apr" numeric NOT NULL, "apy" numeric NOT NULL, "apy7_day_avg" numeric NOT NULL, "apy14_day_avg" numeric NOT NULL, "apy30_day_avg" numeric NOT NULL, "rebasing_credits_per_token" numeric NOT NULL, CONSTRAINT "PK_7826924ff9c029af7533753f6af" PRIMARY KEY ("id"))`) - await db.query(`CREATE INDEX "IDX_1f069a908b679be0b5fbc0b2e6" ON "apy" ("timestamp") `) - await db.query(`CREATE INDEX "IDX_7fb752652a983d6629a722ae7a" ON "apy" ("block_number") `) - await db.query(`CREATE INDEX "IDX_d1165411d71160d1230073d0fa" ON "apy" ("tx_hash") `) - await db.query(`CREATE TABLE "rebase" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "total_supply" numeric NOT NULL, "rebasing_credits" numeric NOT NULL, "rebasing_credits_per_token" numeric NOT NULL, "apy_id" character varying, CONSTRAINT "PK_cadd381a400a7e41b538c788d13" PRIMARY KEY ("id"))`) - await db.query(`CREATE INDEX "IDX_c308a9ecd3d05b0c45e7c60d10" ON "rebase" ("timestamp") `) - await db.query(`CREATE INDEX "IDX_a5955dbd9ac031314697cbd54f" ON "rebase" ("block_number") `) - await db.query(`CREATE INDEX "IDX_7cd793b6c4bc15b9082e0eb97a" ON "rebase" ("tx_hash") `) - await db.query(`CREATE INDEX "IDX_02d02f9022ef86e60f1a84b9dc" ON "rebase" ("apy_id") `) - await db.query(`ALTER TABLE "history" ADD CONSTRAINT "FK_59a55adcc59ddb69c297da693e5" FOREIGN KEY ("address_id") REFERENCES "address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) - await db.query(`ALTER TABLE "rebase" ADD CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2" FOREIGN KEY ("apy_id") REFERENCES "apy"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) - } - - async down(db) { - await db.query(`DROP TABLE "history"`) - await db.query(`DROP INDEX "public"."IDX_59a55adcc59ddb69c297da693e"`) - await db.query(`DROP INDEX "public"."IDX_7a259431108a22e8ca2f375fc7"`) - await db.query(`DROP INDEX "public"."IDX_1b82c15d87635d95eaa4dd42ec"`) - await db.query(`DROP TABLE "address"`) - await db.query(`DROP TABLE "apy"`) - await db.query(`DROP INDEX "public"."IDX_1f069a908b679be0b5fbc0b2e6"`) - await db.query(`DROP INDEX "public"."IDX_7fb752652a983d6629a722ae7a"`) - await db.query(`DROP INDEX "public"."IDX_d1165411d71160d1230073d0fa"`) - await db.query(`DROP TABLE "rebase"`) - await db.query(`DROP INDEX "public"."IDX_c308a9ecd3d05b0c45e7c60d10"`) - await db.query(`DROP INDEX "public"."IDX_a5955dbd9ac031314697cbd54f"`) - await db.query(`DROP INDEX "public"."IDX_7cd793b6c4bc15b9082e0eb97a"`) - await db.query(`DROP INDEX "public"."IDX_02d02f9022ef86e60f1a84b9dc"`) - await db.query(`ALTER TABLE "history" DROP CONSTRAINT "FK_59a55adcc59ddb69c297da693e5"`) - await db.query(`ALTER TABLE "rebase" DROP CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2"`) - } -} diff --git a/db/migrations/1694734538759-Data.js b/db/migrations/1694734538759-Data.js new file mode 100644 index 00000000..101c2efb --- /dev/null +++ b/db/migrations/1694734538759-Data.js @@ -0,0 +1,109 @@ +module.exports = class Data1694734538759 { + name = 'Data1694734538759' + + async up(db) { + await db.query(`CREATE TABLE "history" ("id" character varying NOT NULL, "value" numeric NOT NULL, "balance" numeric NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "type" text NOT NULL, "address_id" character varying, CONSTRAINT "PK_9384942edf4804b38ca0ee51416" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_59a55adcc59ddb69c297da693e" ON "history" ("address_id") `) + await db.query(`CREATE INDEX "IDX_7a259431108a22e8ca2f375fc7" ON "history" ("block_number") `) + await db.query(`CREATE INDEX "IDX_1b82c15d87635d95eaa4dd42ec" ON "history" ("tx_hash") `) + await db.query(`CREATE TABLE "address" ("id" character varying NOT NULL, "is_contract" boolean NOT NULL, "rebasing_option" text NOT NULL, "balance" numeric NOT NULL, "earned" numeric NOT NULL, "credits" numeric NOT NULL, "last_updated" TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT "PK_d92de1f82754668b5f5f5dd4fd5" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "apy" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "apr" numeric NOT NULL, "apy" numeric NOT NULL, "apy7_day_avg" numeric NOT NULL, "apy14_day_avg" numeric NOT NULL, "apy30_day_avg" numeric NOT NULL, "rebasing_credits_per_token" numeric NOT NULL, CONSTRAINT "PK_7826924ff9c029af7533753f6af" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_1f069a908b679be0b5fbc0b2e6" ON "apy" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_7fb752652a983d6629a722ae7a" ON "apy" ("block_number") `) + await db.query(`CREATE INDEX "IDX_d1165411d71160d1230073d0fa" ON "apy" ("tx_hash") `) + await db.query(`CREATE TABLE "rebase" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "total_supply" numeric NOT NULL, "rebasing_credits" numeric NOT NULL, "rebasing_credits_per_token" numeric NOT NULL, "apy_id" character varying, CONSTRAINT "PK_cadd381a400a7e41b538c788d13" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_c308a9ecd3d05b0c45e7c60d10" ON "rebase" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_a5955dbd9ac031314697cbd54f" ON "rebase" ("block_number") `) + await db.query(`CREATE INDEX "IDX_7cd793b6c4bc15b9082e0eb97a" ON "rebase" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_02d02f9022ef86e60f1a84b9dc" ON "rebase" ("apy_id") `) + await db.query(`CREATE TABLE "vault" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "eth" numeric NOT NULL, "weth" numeric NOT NULL, "st_eth" numeric NOT NULL, "r_eth" numeric NOT NULL, "frx_eth" numeric NOT NULL, CONSTRAINT "PK_dd0898234c77f9d97585171ac59" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_0f1a5b7e346813a4ec3a03010b" ON "vault" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_a9b314451a9001a7b0a222f68a" ON "vault" ("block_number") `) + await db.query(`CREATE INDEX "IDX_534a4b5cb80e57e6e7d138b869" ON "vault" ("tx_hash") `) + await db.query(`CREATE TABLE "curve" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "eth" numeric NOT NULL, "oeth" numeric NOT NULL, CONSTRAINT "PK_5aa8792c58dd9c0ae7e09d98611" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_46ef935a92d46f4c5e7be3d9a0" ON "curve" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_abec6d1835577bb9af8c8f3cd8" ON "curve" ("block_number") `) + await db.query(`CREATE INDEX "IDX_5b78300fa8fa16be40dd917f07" ON "curve" ("tx_hash") `) + await db.query(`CREATE TABLE "frax_staking" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "frx_eth" numeric NOT NULL, CONSTRAINT "PK_8e4f242a30dc9aa67ce89dd9011" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_c40e57574ecb23502fa6755b03" ON "frax_staking" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_ac105b3fae6f14114535b8d0e2" ON "frax_staking" ("block_number") `) + await db.query(`CREATE INDEX "IDX_a7ed335fc044ab5077cd1fa544" ON "frax_staking" ("tx_hash") `) + await db.query(`CREATE TABLE "morpho_aave" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "weth" numeric NOT NULL, CONSTRAINT "PK_8b9569518db5529db65205aaafe" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_3570ea91a91129f64a38665d39" ON "morpho_aave" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_1263cc804aa44983b8f146c2c4" ON "morpho_aave" ("block_number") `) + await db.query(`CREATE INDEX "IDX_f2dcb463ee37e7ea641de047df" ON "morpho_aave" ("tx_hash") `) + await db.query(`CREATE TABLE "dripper" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "weth" numeric NOT NULL, CONSTRAINT "PK_74fd102c8d1c60f4b1650a61ffc" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_88c58f8948c3294c2a9e2791dc" ON "dripper" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_06822c0a260797711acc9023d5" ON "dripper" ("block_number") `) + await db.query(`CREATE INDEX "IDX_00e3b19ec41de0785079baeca5" ON "dripper" ("tx_hash") `) + await db.query(`CREATE TABLE "financial_statement" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "vault_id" character varying, "curve_id" character varying, "frax_staking_id" character varying, "morpho_aave_id" character varying, "dripper_id" character varying, CONSTRAINT "PK_4e795d12a43006ece4788e13371" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_ef18e864908765e31b7232fe41" ON "financial_statement" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_0b50f0a8fca1f65659ce36feb4" ON "financial_statement" ("block_number") `) + await db.query(`CREATE INDEX "IDX_e1979157fdc9f59d396e8f8440" ON "financial_statement" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_9f37653694923d2b62c6c01190" ON "financial_statement" ("vault_id") `) + await db.query(`CREATE INDEX "IDX_f809f02abcc22d9ef50c97b42c" ON "financial_statement" ("curve_id") `) + await db.query(`CREATE INDEX "IDX_b5c2c4b2d43680e3c6470d7f9d" ON "financial_statement" ("frax_staking_id") `) + await db.query(`CREATE INDEX "IDX_a610e78431c0dd56724129f223" ON "financial_statement" ("morpho_aave_id") `) + await db.query(`CREATE INDEX "IDX_7a506ebb6c720f35607810b734" ON "financial_statement" ("dripper_id") `) + await db.query(`ALTER TABLE "history" ADD CONSTRAINT "FK_59a55adcc59ddb69c297da693e5" FOREIGN KEY ("address_id") REFERENCES "address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "rebase" ADD CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2" FOREIGN KEY ("apy_id") REFERENCES "apy"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_9f37653694923d2b62c6c01190b" FOREIGN KEY ("vault_id") REFERENCES "vault"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_f809f02abcc22d9ef50c97b42c8" FOREIGN KEY ("curve_id") REFERENCES "curve"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_b5c2c4b2d43680e3c6470d7f9df" FOREIGN KEY ("frax_staking_id") REFERENCES "frax_staking"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_a610e78431c0dd56724129f2236" FOREIGN KEY ("morpho_aave_id") REFERENCES "morpho_aave"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_7a506ebb6c720f35607810b7347" FOREIGN KEY ("dripper_id") REFERENCES "dripper"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + } + + async down(db) { + await db.query(`DROP TABLE "history"`) + await db.query(`DROP INDEX "public"."IDX_59a55adcc59ddb69c297da693e"`) + await db.query(`DROP INDEX "public"."IDX_7a259431108a22e8ca2f375fc7"`) + await db.query(`DROP INDEX "public"."IDX_1b82c15d87635d95eaa4dd42ec"`) + await db.query(`DROP TABLE "address"`) + await db.query(`DROP TABLE "apy"`) + await db.query(`DROP INDEX "public"."IDX_1f069a908b679be0b5fbc0b2e6"`) + await db.query(`DROP INDEX "public"."IDX_7fb752652a983d6629a722ae7a"`) + await db.query(`DROP INDEX "public"."IDX_d1165411d71160d1230073d0fa"`) + await db.query(`DROP TABLE "rebase"`) + await db.query(`DROP INDEX "public"."IDX_c308a9ecd3d05b0c45e7c60d10"`) + await db.query(`DROP INDEX "public"."IDX_a5955dbd9ac031314697cbd54f"`) + await db.query(`DROP INDEX "public"."IDX_7cd793b6c4bc15b9082e0eb97a"`) + await db.query(`DROP INDEX "public"."IDX_02d02f9022ef86e60f1a84b9dc"`) + await db.query(`DROP TABLE "vault"`) + await db.query(`DROP INDEX "public"."IDX_0f1a5b7e346813a4ec3a03010b"`) + await db.query(`DROP INDEX "public"."IDX_a9b314451a9001a7b0a222f68a"`) + await db.query(`DROP INDEX "public"."IDX_534a4b5cb80e57e6e7d138b869"`) + await db.query(`DROP TABLE "curve"`) + await db.query(`DROP INDEX "public"."IDX_46ef935a92d46f4c5e7be3d9a0"`) + await db.query(`DROP INDEX "public"."IDX_abec6d1835577bb9af8c8f3cd8"`) + await db.query(`DROP INDEX "public"."IDX_5b78300fa8fa16be40dd917f07"`) + await db.query(`DROP TABLE "frax_staking"`) + await db.query(`DROP INDEX "public"."IDX_c40e57574ecb23502fa6755b03"`) + await db.query(`DROP INDEX "public"."IDX_ac105b3fae6f14114535b8d0e2"`) + await db.query(`DROP INDEX "public"."IDX_a7ed335fc044ab5077cd1fa544"`) + await db.query(`DROP TABLE "morpho_aave"`) + await db.query(`DROP INDEX "public"."IDX_3570ea91a91129f64a38665d39"`) + await db.query(`DROP INDEX "public"."IDX_1263cc804aa44983b8f146c2c4"`) + await db.query(`DROP INDEX "public"."IDX_f2dcb463ee37e7ea641de047df"`) + await db.query(`DROP TABLE "dripper"`) + await db.query(`DROP INDEX "public"."IDX_88c58f8948c3294c2a9e2791dc"`) + await db.query(`DROP INDEX "public"."IDX_06822c0a260797711acc9023d5"`) + await db.query(`DROP INDEX "public"."IDX_00e3b19ec41de0785079baeca5"`) + await db.query(`DROP TABLE "financial_statement"`) + await db.query(`DROP INDEX "public"."IDX_ef18e864908765e31b7232fe41"`) + await db.query(`DROP INDEX "public"."IDX_0b50f0a8fca1f65659ce36feb4"`) + await db.query(`DROP INDEX "public"."IDX_e1979157fdc9f59d396e8f8440"`) + await db.query(`DROP INDEX "public"."IDX_9f37653694923d2b62c6c01190"`) + await db.query(`DROP INDEX "public"."IDX_f809f02abcc22d9ef50c97b42c"`) + await db.query(`DROP INDEX "public"."IDX_b5c2c4b2d43680e3c6470d7f9d"`) + await db.query(`DROP INDEX "public"."IDX_a610e78431c0dd56724129f223"`) + await db.query(`DROP INDEX "public"."IDX_7a506ebb6c720f35607810b734"`) + await db.query(`ALTER TABLE "history" DROP CONSTRAINT "FK_59a55adcc59ddb69c297da693e5"`) + await db.query(`ALTER TABLE "rebase" DROP CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2"`) + await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_9f37653694923d2b62c6c01190b"`) + await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_f809f02abcc22d9ef50c97b42c8"`) + await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_b5c2c4b2d43680e3c6470d7f9df"`) + await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_a610e78431c0dd56724129f2236"`) + await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_7a506ebb6c720f35607810b7347"`) + } +} diff --git a/.env b/dev.env similarity index 78% rename from .env rename to dev.env index c7a5aab2..d1201837 100644 --- a/.env +++ b/dev.env @@ -2,4 +2,4 @@ DB_NAME=squid DB_PORT=23798 GQL_PORT=4350 # JSON-RPC node endpoint, both wss and https endpoints are accepted -RPC_ENDPOINT= +RPC_ENDPOINT=## Fill me in! ## diff --git a/graphql.config.yml b/graphql.config.yml new file mode 100644 index 00000000..c4401a08 --- /dev/null +++ b/graphql.config.yml @@ -0,0 +1,4 @@ +schema: schema.graphql +documents: '**/*.graphql' +include: + - types.graphql \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 6fbe0393..4c800635 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,10 +7,10 @@ "name": "origin-squid", "dependencies": { "@subsquid/archive-registry": "^3.1.0", - "@subsquid/evm-processor": "^1.7.1", + "@subsquid/evm-processor": "^1.8.2", "@subsquid/graphql-server": "^4.2.0", "@subsquid/typeorm-migration": "^1.2.0", - "@subsquid/typeorm-store": "^1.2.1", + "@subsquid/typeorm-store": "^1.2.2", "dotenv": "^16.1.4", "ethers": "^6.5.1", "pg": "^8.11.0", @@ -23,20 +23,18 @@ "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@types/node": "^18.16.17", "@types/uuid": "^9.0.2", - "prettier": "^3.0.2", + "prettier": "^3.0.3", "typescript": "~5.1.3" } }, "node_modules/@adraffy/ens-normalize": { "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.9.2.tgz", - "integrity": "sha512-0h+FrQDqe2Wn+IIGFkTCd4aAwTJ+7834Ek1COohCyV26AXhwQ7WQaz+4F/nLOeVl/3BtWHOHLPsq46V8YB46Eg==" + "license": "MIT" }, "node_modules/@apollo/protobufjs": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.7.tgz", - "integrity": "sha512-Lahx5zntHPZia35myYDBRuF58tlwPskwHc5CWBZC/4bMKB6siTBWwtMrkqXcsNwQiFSzSx5hKdRPUmemrEp3Gg==", + "version": "1.2.6", "hasInstallScript": true, + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.2", "@protobufjs/base64": "^1.1.2", @@ -49,6 +47,7 @@ "@protobufjs/pool": "^1.1.0", "@protobufjs/utf8": "^1.1.0", "@types/long": "^4.0.0", + "@types/node": "^10.1.0", "long": "^4.0.0" }, "bin": { @@ -56,18 +55,43 @@ "apollo-pbts": "bin/pbts" } }, + "node_modules/@apollo/protobufjs/node_modules/@types/node": { + "version": "10.17.60", + "license": "MIT" + }, "node_modules/@apollo/usage-reporting-protobuf": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@apollo/usage-reporting-protobuf/-/usage-reporting-protobuf-4.1.1.tgz", - "integrity": "sha512-u40dIUePHaSKVshcedO7Wp+mPiZsaU6xjv9J+VyxpoU/zL6Jle+9zWeG98tr/+SZ0nZ4OXhrbb8SNr0rAPpIDA==", + "license": "MIT", "dependencies": { "@apollo/protobufjs": "1.2.7" } }, + "node_modules/@apollo/usage-reporting-protobuf/node_modules/@apollo/protobufjs": { + "version": "1.2.7", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "long": "^4.0.0" + }, + "bin": { + "apollo-pbjs": "bin/pbjs", + "apollo-pbts": "bin/pbts" + } + }, "node_modules/@apollo/utils.dropunuseddefinitions": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@apollo/utils.dropunuseddefinitions/-/utils.dropunuseddefinitions-1.1.0.tgz", - "integrity": "sha512-jU1XjMr6ec9pPoL+BFWzEPW7VHHulVdGKMkPAMiCigpVIT11VmCbnij0bWob8uS3ODJ65tZLYKAh/55vLw2rbg==", + "license": "MIT", "engines": { "node": ">=12.13.0" }, @@ -77,8 +101,7 @@ }, "node_modules/@apollo/utils.keyvadapter": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@apollo/utils.keyvadapter/-/utils.keyvadapter-1.1.2.tgz", - "integrity": "sha512-vPC5e97uwHuZ2iMHVrEeRsV4dLw0lNx2UY9APhb7StC/RMR3BdnuPwS/+5yR9tUF5IUut+iJZocHkS4y6mR9aA==", + "license": "MIT", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", "dataloader": "^2.1.0", @@ -87,8 +110,7 @@ }, "node_modules/@apollo/utils.keyvaluecache": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-1.0.2.tgz", - "integrity": "sha512-p7PVdLPMnPzmXSQVEsy27cYEjVON+SH/Wb7COyW3rQN8+wJgT1nv9jZouYtztWW8ZgTkii5T6tC9qfoDREd4mg==", + "license": "MIT", "dependencies": { "@apollo/utils.logger": "^1.0.0", "lru-cache": "7.10.1 - 7.13.1" @@ -96,13 +118,11 @@ }, "node_modules/@apollo/utils.logger": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-1.0.1.tgz", - "integrity": "sha512-XdlzoY7fYNK4OIcvMD2G94RoFZbzTQaNP0jozmqqMudmaGo2I/2Jx71xlDJ801mWA/mbYRihyaw6KJii7k5RVA==" + "license": "MIT" }, "node_modules/@apollo/utils.printwithreducedwhitespace": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@apollo/utils.printwithreducedwhitespace/-/utils.printwithreducedwhitespace-1.1.0.tgz", - "integrity": "sha512-GfFSkAv3n1toDZ4V6u2d7L4xMwLA+lv+6hqXicMN9KELSJ9yy9RzuEXaX73c/Ry+GzRsBy/fdSUGayGqdHfT2Q==", + "license": "MIT", "engines": { "node": ">=12.13.0" }, @@ -112,8 +132,7 @@ }, "node_modules/@apollo/utils.removealiases": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@apollo/utils.removealiases/-/utils.removealiases-1.0.0.tgz", - "integrity": "sha512-6cM8sEOJW2LaGjL/0vHV0GtRaSekrPQR4DiywaApQlL9EdROASZU5PsQibe2MWeZCOhNrPRuHh4wDMwPsWTn8A==", + "license": "MIT", "engines": { "node": ">=12.13.0" }, @@ -123,8 +142,7 @@ }, "node_modules/@apollo/utils.sortast": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@apollo/utils.sortast/-/utils.sortast-1.1.0.tgz", - "integrity": "sha512-VPlTsmUnOwzPK5yGZENN069y6uUHgeiSlpEhRnLFYwYNoJHsuJq2vXVwIaSmts015WTPa2fpz1inkLYByeuRQA==", + "license": "MIT", "dependencies": { "lodash.sortby": "^4.7.0" }, @@ -137,8 +155,7 @@ }, "node_modules/@apollo/utils.stripsensitiveliterals": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@apollo/utils.stripsensitiveliterals/-/utils.stripsensitiveliterals-1.2.0.tgz", - "integrity": "sha512-E41rDUzkz/cdikM5147d8nfCFVKovXxKBcjvLEQ7bjZm/cg9zEcXvS6vFY8ugTubI3fn6zoqo0CyU8zT+BGP9w==", + "license": "MIT", "engines": { "node": ">=12.13.0" }, @@ -148,8 +165,7 @@ }, "node_modules/@apollo/utils.usagereporting": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.usagereporting/-/utils.usagereporting-1.0.1.tgz", - "integrity": "sha512-6dk+0hZlnDbahDBB2mP/PZ5ybrtCJdLMbeNJD+TJpKyZmSY6bA3SjI8Cr2EM9QA+AdziywuWg+SgbWUF3/zQqQ==", + "license": "MIT", "dependencies": { "@apollo/usage-reporting-protobuf": "^4.0.0", "@apollo/utils.dropunuseddefinitions": "^1.1.0", @@ -167,8 +183,7 @@ }, "node_modules/@apollographql/apollo-tools": { "version": "0.5.4", - "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.5.4.tgz", - "integrity": "sha512-shM3q7rUbNyXVVRkQJQseXv6bnYM3BUma/eZhwXR4xsuM+bqWnJKvW7SAfRjP7LuSCocrexa5AXhjjawNHrIlw==", + "license": "MIT", "engines": { "node": ">=8", "npm": ">=6" @@ -179,17 +194,15 @@ }, "node_modules/@apollographql/graphql-playground-html": { "version": "1.6.29", - "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.29.tgz", - "integrity": "sha512-xCcXpoz52rI4ksJSdOCxeOCn2DLocxwHf9dVT/Q90Pte1LX+LY+91SFtJF3KXVHH8kEin+g1KKCQPKBjZJfWNA==", + "license": "MIT", "dependencies": { "xss": "^1.0.8" } }, "node_modules/@babel/code-frame": { "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, + "license": "MIT", "dependencies": { "@babel/highlight": "^7.22.13", "chalk": "^2.4.2" @@ -200,9 +213,8 @@ }, "node_modules/@babel/generator": { "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.17.0", "jsesc": "^2.5.1", @@ -214,18 +226,16 @@ }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", - "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/template": "^7.22.5", "@babel/types": "^7.22.5" @@ -234,25 +244,10 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-function-name/node_modules/@babel/types": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.15.tgz", - "integrity": "sha512-X+NLXr0N8XXmN5ZsaQdm9U2SSC3UbIYq/doL++sueHOTisgZHoKaQtZxGuV2cUPQHMfjKEfg/g6oy7Hm6SKFtA==", - "dev": true, - "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.15", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-hoist-variables": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5" }, @@ -260,25 +255,10 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-hoist-variables/node_modules/@babel/types": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.15.tgz", - "integrity": "sha512-X+NLXr0N8XXmN5ZsaQdm9U2SSC3UbIYq/doL++sueHOTisgZHoKaQtZxGuV2cUPQHMfjKEfg/g6oy7Hm6SKFtA==", - "dev": true, - "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.15", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-split-export-declaration": { "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, + "license": "MIT", "dependencies": { "@babel/types": "^7.22.5" }, @@ -286,43 +266,26 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/helper-split-export-declaration/node_modules/@babel/types": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.15.tgz", - "integrity": "sha512-X+NLXr0N8XXmN5ZsaQdm9U2SSC3UbIYq/doL++sueHOTisgZHoKaQtZxGuV2cUPQHMfjKEfg/g6oy7Hm6SKFtA==", - "dev": true, - "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.15", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/helper-string-parser": { "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz", - "integrity": "sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==", + "version": "7.22.19", "dev": true, + "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", - "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.4.2", @@ -334,9 +297,8 @@ }, "node_modules/@babel/parser": { "version": "7.22.16", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", - "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", "dev": true, + "license": "MIT", "bin": { "parser": "bin/babel-parser.js" }, @@ -346,8 +308,7 @@ }, "node_modules/@babel/runtime": { "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", - "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", + "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -357,9 +318,8 @@ }, "node_modules/@babel/template": { "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.22.13", "@babel/parser": "^7.22.15", @@ -369,25 +329,10 @@ "node": ">=6.9.0" } }, - "node_modules/@babel/template/node_modules/@babel/types": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.15.tgz", - "integrity": "sha512-X+NLXr0N8XXmN5ZsaQdm9U2SSC3UbIYq/doL++sueHOTisgZHoKaQtZxGuV2cUPQHMfjKEfg/g6oy7Hm6SKFtA==", - "dev": true, - "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.15", - "to-fast-properties": "^2.0.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/traverse": { "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", "dev": true, + "license": "MIT", "dependencies": { "@babel/code-frame": "^7.16.7", "@babel/generator": "^7.17.3", @@ -404,13 +349,48 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/@babel/generator": { + "version": "7.22.15", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.22.15", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/traverse/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, "node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "version": "7.22.19", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.19", "to-fast-properties": "^2.0.0" }, "engines": { @@ -419,8 +399,7 @@ }, "node_modules/@graphql-tools/merge": { "version": "8.4.2", - "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.2.tgz", - "integrity": "sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==", + "license": "MIT", "dependencies": { "@graphql-tools/utils": "^9.2.1", "tslib": "^2.4.0" @@ -429,22 +408,9 @@ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, - "node_modules/@graphql-tools/merge/node_modules/@graphql-tools/utils": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz", - "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==", - "dependencies": { - "@graphql-typed-document-node/core": "^3.1.1", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, "node_modules/@graphql-tools/mock": { "version": "8.7.20", - "resolved": "https://registry.npmjs.org/@graphql-tools/mock/-/mock-8.7.20.tgz", - "integrity": "sha512-ljcHSJWjC/ZyzpXd5cfNhPI7YljRVvabKHPzKjEs5ElxWu2cdlLGvyNYepApXDsM/OJG/2xuhGM+9GWu5gEAPQ==", + "license": "MIT", "dependencies": { "@graphql-tools/schema": "^9.0.18", "@graphql-tools/utils": "^9.2.1", @@ -457,8 +423,7 @@ }, "node_modules/@graphql-tools/mock/node_modules/@graphql-tools/schema": { "version": "9.0.19", - "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.19.tgz", - "integrity": "sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==", + "license": "MIT", "dependencies": { "@graphql-tools/merge": "^8.4.1", "@graphql-tools/utils": "^9.2.1", @@ -469,30 +434,16 @@ "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, - "node_modules/@graphql-tools/mock/node_modules/@graphql-tools/utils": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz", - "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==", - "dependencies": { - "@graphql-typed-document-node/core": "^3.1.1", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, "node_modules/@graphql-tools/mock/node_modules/value-or-promise": { "version": "1.0.12", - "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", - "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==", + "license": "MIT", "engines": { "node": ">=12" } }, "node_modules/@graphql-tools/schema": { "version": "8.5.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-8.5.1.tgz", - "integrity": "sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg==", + "license": "MIT", "dependencies": { "@graphql-tools/merge": "8.3.1", "@graphql-tools/utils": "8.9.0", @@ -505,8 +456,7 @@ }, "node_modules/@graphql-tools/schema/node_modules/@graphql-tools/merge": { "version": "8.3.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.1.tgz", - "integrity": "sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==", + "license": "MIT", "dependencies": { "@graphql-tools/utils": "8.9.0", "tslib": "^2.4.0" @@ -517,8 +467,7 @@ }, "node_modules/@graphql-tools/schema/node_modules/@graphql-tools/utils": { "version": "8.9.0", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.9.0.tgz", - "integrity": "sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==", + "license": "MIT", "dependencies": { "tslib": "^2.4.0" }, @@ -527,10 +476,10 @@ } }, "node_modules/@graphql-tools/utils": { - "version": "8.13.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.13.1.tgz", - "integrity": "sha512-qIh9yYpdUFmctVqovwMdheVNJqFh+DQNWIhX87FJStfXYnmweBUDATok9fWPleKeFwxnW8IapKmY8m8toJEkAw==", + "version": "9.2.1", + "license": "MIT", "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", "tslib": "^2.4.0" }, "peerDependencies": { @@ -539,26 +488,65 @@ }, "node_modules/@graphql-typed-document-node/core": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", - "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", + "license": "MIT", "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "node_modules/@ioredis/commands": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", - "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==" + "license": "MIT" }, "node_modules/@josephg/resolvable": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@josephg/resolvable/-/resolvable-1.0.1.tgz", - "integrity": "sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg==" + "license": "ISC" + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.19", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } }, "node_modules/@keyv/redis": { "version": "2.5.8", - "resolved": "https://registry.npmjs.org/@keyv/redis/-/redis-2.5.8.tgz", - "integrity": "sha512-WweuUZqZN2ETcseV6r1AEum1qG6eR5poNhkZ4CIpWBOjMasT2ArTKWyIPxxYllKUS2A8wKv1l8+AqH6Jpzk7Ug==", + "license": "MIT", "dependencies": { "ioredis": "^5.3.2" }, @@ -568,50 +556,43 @@ }, "node_modules/@noble/hashes": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz", - "integrity": "sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==", "funding": [ { "type": "individual", "url": "https://paulmillr.com/funding/" } - ] + ], + "license": "MIT" }, "node_modules/@noble/secp256k1": { "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", - "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", "funding": [ { "type": "individual", "url": "https://paulmillr.com/funding/" } - ] + ], + "license": "MIT" }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.1", "@protobufjs/inquire": "^1.1.0" @@ -619,38 +600,31 @@ }, "node_modules/@protobufjs/float": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + "license": "BSD-3-Clause" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + "license": "BSD-3-Clause" }, "node_modules/@sqltools/formatter": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", - "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" + "license": "MIT" }, "node_modules/@subsquid/archive-registry": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@subsquid/archive-registry/-/archive-registry-3.2.0.tgz", - "integrity": "sha512-qEzFODDVwEx+3cdmk4LPAKoLzjcBcqvhhLovEWOUKxN+S9SZaOWYHf7yq1pi48X6nUSVLmK7rofBx+pS4hIU7Q==", + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/util-internal": "^1.0.0", "commander": "^10.0.0", @@ -661,29 +635,34 @@ "squid-archive-registry": "bin/run.js" } }, + "node_modules/@subsquid/archive-registry/node_modules/@subsquid/util-internal": { + "version": "1.1.0", + "license": "GPL-3.0-or-later" + }, + "node_modules/@subsquid/archive-registry/node_modules/commander": { + "version": "10.0.1", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, "node_modules/@subsquid/evm-processor": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@subsquid/evm-processor/-/evm-processor-1.8.1.tgz", - "integrity": "sha512-Q94nS/PCrYCMQt/UG325DlVRtf9EpXz2CPs/tpKPf45RR6r/18eT/Ifyxu3zGsUiNFfX7fk+W5UG7n8ziiRn0Q==", + "version": "1.8.2", + "license": "GPL-3.0-or-later", "dependencies": { - "@subsquid/http-client": "^1.2.1", + "@subsquid/http-client": "^1.3.0", "@subsquid/logger": "^1.3.0", "@subsquid/rpc-client": "^4.4.1", - "@subsquid/util-internal": "^2.5.0", + "@subsquid/util-internal": "^2.5.1", + "@subsquid/util-internal-archive-client": "^0.0.0", "@subsquid/util-internal-hex": "^1.2.0", "@subsquid/util-internal-processor-tools": "^2.0.0" } }, - "node_modules/@subsquid/evm-processor/node_modules/@subsquid/util-internal": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.0.tgz", - "integrity": "sha512-uewLh2aZheCmMGXqJQwDSlQ5ZTCpkzEG3LAsSqzSwrE7fpTz+XzXTyv1E7wmDRy0CuAYuuILhS6sG+PVgEAK3Q==" - }, "node_modules/@subsquid/evm-typegen": { "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@subsquid/evm-typegen/-/evm-typegen-3.2.2.tgz", - "integrity": "sha512-DzjzUwjJNJM74skZCuYPMKYhvDg2KLRdt1ooiOpgH91zEmcS8wx70dtdOtQxDIDm1Bbt/pfS3Yntq7CjbeI2/g==", "dev": true, + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/http-client": "^1.2.0", "@subsquid/logger": "^1.3.0", @@ -699,39 +678,12 @@ "ethers": "^6.6.5" } }, - "node_modules/@subsquid/evm-typegen/node_modules/@subsquid/util-internal": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.0.tgz", - "integrity": "sha512-uewLh2aZheCmMGXqJQwDSlQ5ZTCpkzEG3LAsSqzSwrE7fpTz+XzXTyv1E7wmDRy0CuAYuuILhS6sG+PVgEAK3Q==", - "dev": true - }, - "node_modules/@subsquid/evm-typegen/node_modules/@subsquid/util-internal-commander": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-1.3.0.tgz", - "integrity": "sha512-ZSPzYjNZ/k/6qDa7xdrCgXkq/whYnVPLF8nX+35aAgrM+ShX7XUg/Dq6u0rW3u3sfWcKzsNFHbFB8SzjWN5StA==", - "dev": true, - "peerDependencies": { - "commander": "^11.0.0" - } - }, - "node_modules/@subsquid/evm-typegen/node_modules/commander": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", - "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", - "dev": true, - "engines": { - "node": ">=16" - } - }, "node_modules/@subsquid/graphiql-console": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@subsquid/graphiql-console/-/graphiql-console-0.3.0.tgz", - "integrity": "sha512-C89mus6IXnNi0xMQrZqUFBZwLj8tbuq9lye8Gq/lHmmERAUpi6UsWEyLdJLx2mneZzF3JtY8eNiiZ16jmjtvfw==" + "version": "0.3.0" }, "node_modules/@subsquid/graphql-server": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@subsquid/graphql-server/-/graphql-server-4.3.0.tgz", - "integrity": "sha512-Ws2uHJyhgNgo3uJZQ4XYKAPvnOGJ3wXq/XhcX/b3z2OeiCv89daB+V6Lzf6nBsVBg9D2Ev0vNWIVRKJQbEn+mA==", + "license": "GPL-3.0-or-later", "dependencies": { "@apollo/utils.keyvadapter": "~1.1.2", "@apollo/utils.keyvaluecache": "~1.0.2", @@ -781,46 +733,44 @@ } } }, - "node_modules/@subsquid/graphql-server/node_modules/@subsquid/util-internal": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.0.tgz", - "integrity": "sha512-uewLh2aZheCmMGXqJQwDSlQ5ZTCpkzEG3LAsSqzSwrE7fpTz+XzXTyv1E7wmDRy0CuAYuuILhS6sG+PVgEAK3Q==" - }, - "node_modules/@subsquid/graphql-server/node_modules/@subsquid/util-internal-commander": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-1.3.0.tgz", - "integrity": "sha512-ZSPzYjNZ/k/6qDa7xdrCgXkq/whYnVPLF8nX+35aAgrM+ShX7XUg/Dq6u0rW3u3sfWcKzsNFHbFB8SzjWN5StA==", + "node_modules/@subsquid/graphql-server/node_modules/@graphql-tools/utils": { + "version": "8.13.1", + "license": "MIT", + "dependencies": { + "tslib": "^2.4.0" + }, "peerDependencies": { - "commander": "^11.0.0" - } - }, - "node_modules/@subsquid/graphql-server/node_modules/commander": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", - "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", - "engines": { - "node": ">=16" + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "node_modules/@subsquid/http-client": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@subsquid/http-client/-/http-client-1.2.1.tgz", - "integrity": "sha512-zREmt/3I8HXwR+u9DPqSHy7ym8MBSVXVgV7Y4I8HOXlSkPbBdZPTtGfagvCFfNmOCRQrYOlJnJhzkYyQ4bcuhQ==", + "version": "1.3.0", + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/logger": "^1.3.0", - "@subsquid/util-internal": "^2.5.0", + "@subsquid/util-internal": "^2.5.1", "node-fetch": "^3.3.1" } }, - "node_modules/@subsquid/http-client/node_modules/@subsquid/util-internal": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.0.tgz", - "integrity": "sha512-uewLh2aZheCmMGXqJQwDSlQ5ZTCpkzEG3LAsSqzSwrE7fpTz+XzXTyv1E7wmDRy0CuAYuuILhS6sG+PVgEAK3Q==" + "node_modules/@subsquid/http-client/node_modules/node-fetch": { + "version": "3.3.2", + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } }, "node_modules/@subsquid/logger": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@subsquid/logger/-/logger-1.3.0.tgz", - "integrity": "sha512-1aCaFzGXrzW4bioiv6hPX+vsKO2EsiqFKcWedRW9G+0nnelAfhw5lGsyCvMzfkuk2xUCRA6vWwOReVK3BPW0Zg==", + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/util-internal-hex": "^1.2.0", "@subsquid/util-internal-json": "^1.2.0", @@ -829,8 +779,7 @@ }, "node_modules/@subsquid/openreader": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@subsquid/openreader/-/openreader-4.4.0.tgz", - "integrity": "sha512-MiHu+PQH4frnF8RPd4F1WwdPzaaA3trBM1VuzN5cTEPPt8vBF4A1BIL78Qq1HH/HH+yLriNjmA7/IVaAFjsfgw==", + "license": "GPL-3.0-or-later", "dependencies": { "@graphql-tools/merge": "^8", "@subsquid/graphiql-console": "^0.3.0", @@ -863,31 +812,9 @@ } } }, - "node_modules/@subsquid/openreader/node_modules/@subsquid/util-internal": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.0.tgz", - "integrity": "sha512-uewLh2aZheCmMGXqJQwDSlQ5ZTCpkzEG3LAsSqzSwrE7fpTz+XzXTyv1E7wmDRy0CuAYuuILhS6sG+PVgEAK3Q==" - }, - "node_modules/@subsquid/openreader/node_modules/@subsquid/util-internal-commander": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-1.3.0.tgz", - "integrity": "sha512-ZSPzYjNZ/k/6qDa7xdrCgXkq/whYnVPLF8nX+35aAgrM+ShX7XUg/Dq6u0rW3u3sfWcKzsNFHbFB8SzjWN5StA==", - "peerDependencies": { - "commander": "^11.0.0" - } - }, - "node_modules/@subsquid/openreader/node_modules/commander": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", - "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", - "engines": { - "node": ">=16" - } - }, "node_modules/@subsquid/rpc-client": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@subsquid/rpc-client/-/rpc-client-4.4.1.tgz", - "integrity": "sha512-ZnqmJUDdj4OsZZLVHAqXhPF4vijut54PwNdLg8MlfCU4gX99oYwB/wvtulVuJckNLiXDQ3ka+CDLe/MWV2svIA==", + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/http-client": "^1.2.1", "@subsquid/logger": "^1.3.0", @@ -897,16 +824,14 @@ "websocket": "^1.0.34" } }, - "node_modules/@subsquid/rpc-client/node_modules/@subsquid/util-internal": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.0.tgz", - "integrity": "sha512-uewLh2aZheCmMGXqJQwDSlQ5ZTCpkzEG3LAsSqzSwrE7fpTz+XzXTyv1E7wmDRy0CuAYuuILhS6sG+PVgEAK3Q==" + "node_modules/@subsquid/rpc-client/node_modules/@subsquid/util-internal-counters": { + "version": "1.3.0", + "license": "GPL-3.0-or-later" }, "node_modules/@subsquid/typeorm-codegen": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-codegen/-/typeorm-codegen-1.3.1.tgz", - "integrity": "sha512-hHMbJvYZ9wJFnsK+NgOAC9jv1bawsss1eCrUBI3NMoCJ9xeEZOdx13eQAI+8OAPXedqCx4v0PLFZZOlAKc1/7w==", "dev": true, + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/openreader": "^4.3.1", "@subsquid/util-internal": "^2.4.0", @@ -918,25 +843,9 @@ "squid-typeorm-codegen": "bin/run.js" } }, - "node_modules/@subsquid/typeorm-codegen/node_modules/@subsquid/util-internal": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.0.tgz", - "integrity": "sha512-uewLh2aZheCmMGXqJQwDSlQ5ZTCpkzEG3LAsSqzSwrE7fpTz+XzXTyv1E7wmDRy0CuAYuuILhS6sG+PVgEAK3Q==", - "dev": true - }, - "node_modules/@subsquid/typeorm-codegen/node_modules/commander": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", - "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", - "dev": true, - "engines": { - "node": ">=16" - } - }, "node_modules/@subsquid/typeorm-config": { "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-config/-/typeorm-config-3.3.0.tgz", - "integrity": "sha512-DJXoAQnVooEdEU3vxL33I5WRJRRPy9t+15rP17kGMkXGLuPAc0hpelJGSO5Ze9csn/IytwrZUWG6y2I2Q81nyQ==", + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/util-naming": "^1.2.0" }, @@ -951,8 +860,7 @@ }, "node_modules/@subsquid/typeorm-migration": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-migration/-/typeorm-migration-1.2.1.tgz", - "integrity": "sha512-aMo4hmqzwmFHLrdu1PXm3bGiRSodyjgmnETmnYiI11g+FbVWwTuJ3P1jBY9hrRFEr6iGb2+pYVRMme75XoNzTw==", + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/typeorm-config": "^3.2.0", "@subsquid/util-internal": "^2.4.0", @@ -971,23 +879,9 @@ "typeorm": "^0.3.16" } }, - "node_modules/@subsquid/typeorm-migration/node_modules/@subsquid/util-internal": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.0.tgz", - "integrity": "sha512-uewLh2aZheCmMGXqJQwDSlQ5ZTCpkzEG3LAsSqzSwrE7fpTz+XzXTyv1E7wmDRy0CuAYuuILhS6sG+PVgEAK3Q==" - }, - "node_modules/@subsquid/typeorm-migration/node_modules/commander": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", - "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", - "engines": { - "node": ">=16" - } - }, "node_modules/@subsquid/typeorm-store": { "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@subsquid/typeorm-store/-/typeorm-store-1.2.2.tgz", - "integrity": "sha512-pp2PvmK51KzpWlGQxDzqoxNnAr5vcMYlA0NLRUM3xHnqlkxwgIrJLRqwmAOYlOiQp0YHqqdFbjtraJXjftCiHA==", + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/typeorm-config": "^3.3.0", "@subsquid/util-internal": "^2.5.0" @@ -996,30 +890,41 @@ "typeorm": "^0.3.16" } }, - "node_modules/@subsquid/typeorm-store/node_modules/@subsquid/util-internal": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.0.tgz", - "integrity": "sha512-uewLh2aZheCmMGXqJQwDSlQ5ZTCpkzEG3LAsSqzSwrE7fpTz+XzXTyv1E7wmDRy0CuAYuuILhS6sG+PVgEAK3Q==" - }, "node_modules/@subsquid/util-internal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-1.1.0.tgz", - "integrity": "sha512-O6m666RDcWEw4vb3bmeNZKlAa1rGOHQvS0nhZFTBXnxZpqK/pU5N0jrQ7X/3is0pY2RKxFoxTurZjhv4QdxtqA==" + "version": "2.5.1", + "license": "GPL-3.0-or-later" + }, + "node_modules/@subsquid/util-internal-archive-client": { + "version": "0.0.0", + "license": "GPL-3.0-or-later", + "dependencies": { + "@subsquid/http-client": "^1.3.0", + "@subsquid/util-internal": "^2.5.1", + "@subsquid/util-internal-range": "^0.0.0" + }, + "peerDependencies": { + "@subsquid/logger": "^1.3.0" + }, + "peerDependenciesMeta": { + "@subsquid/logger": { + "optional": true + } + } }, "node_modules/@subsquid/util-internal-binary-heap": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-binary-heap/-/util-internal-binary-heap-1.0.0.tgz", - "integrity": "sha512-88auuc8yNFmCZugmJSTYzS7WM/nN2obKGQCgrl8Jty5rJUFbqazGSi8icqftKhv6MPtUMJ3PSTRLiTFXAUGnAA==" + "license": "GPL-3.0-or-later" }, "node_modules/@subsquid/util-internal-code-printer": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-code-printer/-/util-internal-code-printer-1.2.0.tgz", - "integrity": "sha512-UZgNiYs5C/aSBYXXi9LgWyjJ2Uy/0uYowNq8Hx4OhraJq8OoqS5Ef0K/RMf7+4tpgvuArocJUcpvtRCKWewvbA==" + "license": "GPL-3.0-or-later" }, - "node_modules/@subsquid/util-internal-counters": { + "node_modules/@subsquid/util-internal-commander": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-counters/-/util-internal-counters-1.3.0.tgz", - "integrity": "sha512-/Eeu9d3gW50nFSp49PDYrioIJdczR+wPlXBCe8EIMTUFEySIhhxFPB7y4JqL2pnUrK2UqAgyKoTx0diqP6fdxA==" + "license": "GPL-3.0-or-later", + "peerDependencies": { + "commander": "^11.0.0" + } }, "node_modules/@subsquid/util-internal-hex": { "version": "1.2.0", @@ -1028,8 +933,7 @@ }, "node_modules/@subsquid/util-internal-http-server": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-http-server/-/util-internal-http-server-1.2.0.tgz", - "integrity": "sha512-eaOreTdStkB405Lg07CNmoi7BmUVYyHLsNiMcvH+CUyiqI4dwkGd5JwXJek+GbEvaixiKF3t7Km/SX8bH2BJEA==", + "license": "GPL-3.0-or-later", "dependencies": { "stoppable": "^1.1.0" } @@ -1044,8 +948,7 @@ }, "node_modules/@subsquid/util-internal-processor-tools": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-2.0.0.tgz", - "integrity": "sha512-QEeCoXZ9/OvLKytVW9tGTxOb2h1NxW4o9UFteWEEMhsDh11cHQ2TVn+kynQ5OPLIq1cXZZD0NmYGN1pRD11y/Q==", + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/logger": "^1.3.0", "@subsquid/util-internal": "^2.4.0", @@ -1055,15 +958,13 @@ "prom-client": "^14.2.0" } }, - "node_modules/@subsquid/util-internal-processor-tools/node_modules/@subsquid/util-internal": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.0.tgz", - "integrity": "sha512-uewLh2aZheCmMGXqJQwDSlQ5ZTCpkzEG3LAsSqzSwrE7fpTz+XzXTyv1E7wmDRy0CuAYuuILhS6sG+PVgEAK3Q==" + "node_modules/@subsquid/util-internal-processor-tools/node_modules/@subsquid/util-internal-counters": { + "version": "1.3.0", + "license": "GPL-3.0-or-later" }, - "node_modules/@subsquid/util-internal-prometheus-server": { + "node_modules/@subsquid/util-internal-processor-tools/node_modules/@subsquid/util-internal-prometheus-server": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-prometheus-server/-/util-internal-prometheus-server-1.2.0.tgz", - "integrity": "sha512-VvYAg1qUK3aDmPNMNsjjXFgSt8iOZ4B6A+QTLAdkZO9r+aOU5rSAe6r03BpxKSwgBqGH40RNhi8pn2w5zShQ0g==", + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/util-internal-http-server": "^1.2.0" }, @@ -1073,22 +974,15 @@ }, "node_modules/@subsquid/util-internal-range": { "version": "0.0.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal-range/-/util-internal-range-0.0.0.tgz", - "integrity": "sha512-faj70/0jk/of0VFIbrVUlzRPEGNWZTApwetBF0EP1UfW09349Q5LowqCtbuC0TYHQtnm7Qvz5rBG5K0bFGI8Lw==", + "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/util-internal": "^2.4.0", "@subsquid/util-internal-binary-heap": "^1.0.0" } }, - "node_modules/@subsquid/util-internal-range/node_modules/@subsquid/util-internal": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.0.tgz", - "integrity": "sha512-uewLh2aZheCmMGXqJQwDSlQ5ZTCpkzEG3LAsSqzSwrE7fpTz+XzXTyv1E7wmDRy0CuAYuuILhS6sG+PVgEAK3Q==" - }, "node_modules/@subsquid/util-naming": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@subsquid/util-naming/-/util-naming-1.2.0.tgz", - "integrity": "sha512-mFFFh3CLd4IOm5OIl0tyhGvL6s+LQqtGgq8mD4oCZuzC2IhRNJ7D1KAv8JTZsxzOhHfLeibF2xvdN5jBwSLEyg==", + "license": "GPL-3.0-or-later", "dependencies": { "camelcase": "^6.3.0", "inflected": "^2.1.0" @@ -1096,9 +990,8 @@ }, "node_modules/@trivago/prettier-plugin-sort-imports": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.2.0.tgz", - "integrity": "sha512-YBepjbt+ZNBVmN3ev1amQH3lWCmHyt5qTbLCp/syXJRu/Kw2koXh44qayB1gMRxcL/gV8egmjN5xWSrYyfUtyw==", "dev": true, + "license": "Apache-2.0", "dependencies": { "@babel/generator": "7.17.7", "@babel/parser": "^7.20.5", @@ -1117,40 +1010,59 @@ } } }, + "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/types": { + "version": "7.17.0", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.16.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@types/accepts": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", - "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", + "license": "MIT", "dependencies": { "@types/node": "*" } }, + "node_modules/@types/accepts/node_modules/@types/node": { + "version": "20.6.0", + "license": "MIT" + }, "node_modules/@types/body-parser": { "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "license": "MIT", "dependencies": { "@types/connect": "*", "@types/node": "*" } }, + "node_modules/@types/body-parser/node_modules/@types/node": { + "version": "20.6.0", + "license": "MIT" + }, "node_modules/@types/connect": { "version": "3.4.36", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", - "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", + "license": "MIT", "dependencies": { "@types/node": "*" } }, + "node_modules/@types/connect/node_modules/@types/node": { + "version": "20.6.0", + "license": "MIT" + }, "node_modules/@types/cors": { "version": "2.8.12", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" + "license": "MIT" }, "node_modules/@types/express": { "version": "4.17.14", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", - "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", + "license": "MIT", "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.18", @@ -1160,64 +1072,93 @@ }, "node_modules/@types/express-serve-static-core": { "version": "4.17.31", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", - "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", + "license": "MIT", "dependencies": { "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*" } }, + "node_modules/@types/express-serve-static-core/node_modules/@types/node": { + "version": "20.6.0", + "license": "MIT" + }, + "node_modules/@types/express/node_modules/@types/express-serve-static-core": { + "version": "4.17.36", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/express/node_modules/@types/node": { + "version": "20.6.0", + "license": "MIT" + }, "node_modules/@types/http-errors": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.1.tgz", - "integrity": "sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==" + "license": "MIT" }, "node_modules/@types/long": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + "license": "MIT" }, "node_modules/@types/mime": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", - "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" + "license": "MIT" }, "node_modules/@types/node": { - "version": "18.17.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.14.tgz", - "integrity": "sha512-ZE/5aB73CyGqgQULkLG87N9GnyGe5TcQjv34pwS8tfBs1IkCh0ASM69mydb2znqd6v0eX+9Ytvk6oQRqu8T1Vw==" + "version": "18.17.15", + "dev": true, + "license": "MIT" }, "node_modules/@types/qs": { "version": "6.9.8", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.8.tgz", - "integrity": "sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg==" + "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "0.17.1", + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/send/node_modules/@types/mime": { + "version": "1.3.2", + "license": "MIT" + }, + "node_modules/@types/send/node_modules/@types/node": { + "version": "20.6.0", + "license": "MIT" }, "node_modules/@types/serve-static": { "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.2.tgz", - "integrity": "sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==", + "license": "MIT", "dependencies": { "@types/http-errors": "*", "@types/mime": "*", "@types/node": "*" } }, + "node_modules/@types/serve-static/node_modules/@types/node": { + "version": "20.6.0", + "license": "MIT" + }, "node_modules/@types/uuid": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.3.tgz", - "integrity": "sha512-taHQQH/3ZyI3zP8M/puluDEIEvtQHVYcC6y3N8ijFtAd28+Ey/G4sg1u2gB01S8MwybLOKAp9/yCMu/uR5l3Ug==", - "dev": true + "version": "9.0.4", + "dev": true, + "license": "MIT" }, "node_modules/accepts": { "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" @@ -1228,39 +1169,35 @@ }, "node_modules/aes-js": { "version": "4.0.0-beta.5", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", - "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" + "license": "MIT" }, "node_modules/ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, + "version": "4.3.0", + "license": "MIT", "dependencies": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/any-promise": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" + "license": "MIT" }, "node_modules/apollo-datasource": { "version": "3.3.2", - "resolved": "https://registry.npmjs.org/apollo-datasource/-/apollo-datasource-3.3.2.tgz", - "integrity": "sha512-L5TiS8E2Hn/Yz7SSnWIVbZw0ZfEIXZCa5VUiVxD9P53JvSrf4aStvsFDlGWPvpIdCR+aly2CfoB79B9/JjKFqg==", - "deprecated": "The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "license": "MIT", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", "apollo-server-env": "^4.2.1" @@ -1271,48 +1208,14 @@ }, "node_modules/apollo-reporting-protobuf": { "version": "3.4.0", - "resolved": "https://registry.npmjs.org/apollo-reporting-protobuf/-/apollo-reporting-protobuf-3.4.0.tgz", - "integrity": "sha512-h0u3EbC/9RpihWOmcSsvTW2O6RXVaD/mPEjfrPkxRPTEPWqncsgOoRJw+wih4OqfH3PvTJvoEIf4LwKrUaqWog==", - "deprecated": "The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "license": "MIT", "dependencies": { "@apollo/protobufjs": "1.2.6" } }, - "node_modules/apollo-reporting-protobuf/node_modules/@apollo/protobufjs": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.6.tgz", - "integrity": "sha512-Wqo1oSHNUj/jxmsVp4iR3I480p6qdqHikn38lKrFhfzcDJ7lwd7Ck7cHRl4JE81tWNArl77xhnG/OkZhxKBYOw==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.0", - "@types/node": "^10.1.0", - "long": "^4.0.0" - }, - "bin": { - "apollo-pbjs": "bin/pbjs", - "apollo-pbts": "bin/pbts" - } - }, - "node_modules/apollo-reporting-protobuf/node_modules/@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" - }, "node_modules/apollo-server-core": { "version": "3.12.1", - "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.12.1.tgz", - "integrity": "sha512-9SF5WAkkV0FZQ2HVUWI9Jada1U0jg7e8NCN9EklbtvaCeUlOLyXyM+KCWuZ7+dqHxjshbtcwylPHutt3uzoNkw==", - "deprecated": "The `apollo-server-core` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "license": "MIT", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", "@apollo/utils.logger": "^1.0.0", @@ -1347,8 +1250,7 @@ }, "node_modules/apollo-server-core/node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -1358,9 +1260,7 @@ }, "node_modules/apollo-server-env": { "version": "4.2.1", - "resolved": "https://registry.npmjs.org/apollo-server-env/-/apollo-server-env-4.2.1.tgz", - "integrity": "sha512-vm/7c7ld+zFMxibzqZ7SSa5tBENc4B0uye9LTfjJwGoQFY5xsUPH5FpO5j0bMUDZ8YYNbrF9SNtzc5Cngcr90g==", - "deprecated": "The `apollo-server-env` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/utils.fetcher` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "license": "MIT", "dependencies": { "node-fetch": "^2.6.7" }, @@ -1368,30 +1268,9 @@ "node": ">=12.0" } }, - "node_modules/apollo-server-env/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/apollo-server-errors": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/apollo-server-errors/-/apollo-server-errors-3.3.1.tgz", - "integrity": "sha512-xnZJ5QWs6FixHICXHxUfm+ZWqqxrNuPlQ+kj5m6RtEgIpekOPssH/SD9gf2B4HuWV0QozorrygwZnux8POvyPA==", - "deprecated": "The `apollo-server-errors` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "license": "MIT", "engines": { "node": ">=12.0" }, @@ -1401,9 +1280,7 @@ }, "node_modules/apollo-server-express": { "version": "3.12.1", - "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.12.1.tgz", - "integrity": "sha512-5A9efrhEXqDx08BnORWf0zPYCABENqur47VZZW8osQpSSnMINqzJiV5RMrzz8wIznecRRhEcz+BqLdiexqZdgg==", - "deprecated": "The `apollo-server-express` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "license": "MIT", "dependencies": { "@types/accepts": "^1.3.5", "@types/body-parser": "1.19.2", @@ -1425,11 +1302,44 @@ "graphql": "^15.3.0 || ^16.0.0" } }, + "node_modules/apollo-server-express/node_modules/body-parser": { + "version": "1.20.2", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/apollo-server-express/node_modules/raw-body": { + "version": "2.5.2", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/apollo-server-plugin-base": { "version": "3.7.2", - "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-3.7.2.tgz", - "integrity": "sha512-wE8dwGDvBOGehSsPTRZ8P/33Jan6/PmL0y0aN/1Z5a5GcbFhDaaJCjK5cav6npbbGL2DPKK0r6MPXi3k3N45aw==", - "deprecated": "The `apollo-server-plugin-base` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "license": "MIT", "dependencies": { "apollo-server-types": "^3.8.0" }, @@ -1442,9 +1352,7 @@ }, "node_modules/apollo-server-plugin-response-cache": { "version": "3.7.1", - "resolved": "https://registry.npmjs.org/apollo-server-plugin-response-cache/-/apollo-server-plugin-response-cache-3.7.1.tgz", - "integrity": "sha512-3FHwwySf1kQl8dGC+2E08LtDeFGUOeqckLchAD1REYx1vwMZbGhmEIwaNezjXwxkTM5Y7l38n0vQTka6YoQN7w==", - "deprecated": "The `apollo-server-plugin-response-cache` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server-plugin-response-cache` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "license": "MIT", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", "apollo-server-plugin-base": "^3.6.3", @@ -1459,9 +1367,7 @@ }, "node_modules/apollo-server-types": { "version": "3.8.0", - "resolved": "https://registry.npmjs.org/apollo-server-types/-/apollo-server-types-3.8.0.tgz", - "integrity": "sha512-ZI/8rTE4ww8BHktsVpb91Sdq7Cb71rdSkXELSwdSR0eXu600/sY+1UXhTWdiJvk+Eq5ljqoHLwLbY2+Clq2b9A==", - "deprecated": "The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "license": "MIT", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", "@apollo/utils.logger": "^1.0.0", @@ -1477,16 +1383,14 @@ }, "node_modules/app-root-path": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", - "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", + "license": "MIT", "engines": { "node": ">= 6.0.0" } }, "node_modules/array-buffer-byte-length": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "is-array-buffer": "^3.0.1" @@ -1497,21 +1401,18 @@ }, "node_modules/array-flatten": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" + "license": "MIT" }, "node_modules/async-retry": { "version": "1.3.3", - "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", - "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", + "license": "MIT", "dependencies": { "retry": "0.13.1" } }, "node_modules/available-typed-arrays": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -1521,13 +1422,10 @@ }, "node_modules/balanced-match": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + "license": "MIT" }, "node_modules/base64-js": { "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "funding": [ { "type": "github", @@ -1541,20 +1439,19 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/bintrees": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", - "integrity": "sha512-VOMgTMwjAaUG580SXn3LacVgjurrbMme7ZZNYGSSV7mmtY6QQRh0Eg3pwIcntQ77DErK1L0NxkbetjcoXzVwKw==" + "license": "MIT" }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.1", + "license": "MIT", "dependencies": { "bytes": "3.1.2", - "content-type": "~1.0.5", + "content-type": "~1.0.4", "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", @@ -1562,7 +1459,7 @@ "iconv-lite": "0.4.24", "on-finished": "2.4.1", "qs": "6.11.0", - "raw-body": "2.5.2", + "raw-body": "2.5.1", "type-is": "~1.6.18", "unpipe": "1.0.0" }, @@ -1571,31 +1468,15 @@ "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "node_modules/brace-expansion": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, "node_modules/buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -1610,6 +1491,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -1617,17 +1499,15 @@ }, "node_modules/buffer-writer": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", - "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/bufferutil": { "version": "4.0.7", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", - "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", "hasInstallScript": true, + "license": "MIT", "dependencies": { "node-gyp-build": "^4.3.0" }, @@ -1637,16 +1517,14 @@ }, "node_modules/bytes": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/call-bind": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -1657,8 +1535,7 @@ }, "node_modules/camelcase": { "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -1668,9 +1545,8 @@ }, "node_modules/chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -1680,20 +1556,42 @@ "node": ">=4" } }, + "node_modules/chalk/node_modules/ansi-styles": { + "version": "3.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/color-convert": { + "version": "1.9.3", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/chalk/node_modules/color-name": { + "version": "1.1.3", + "dev": true, + "license": "MIT" + }, "node_modules/chalk/node_modules/has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/chalk/node_modules/supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -1703,8 +1601,7 @@ }, "node_modules/cli-highlight": { "version": "2.1.11", - "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", - "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "license": "ISC", "dependencies": { "chalk": "^4.0.0", "highlight.js": "^10.7.1", @@ -1721,24 +1618,9 @@ "npm": ">=5.0.0" } }, - "node_modules/cli-highlight/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/cli-highlight/node_modules/chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1752,34 +1634,16 @@ }, "node_modules/cli-highlight/node_modules/cliui": { "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, - "node_modules/cli-highlight/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/cli-highlight/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, "node_modules/cli-highlight/node_modules/supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -1789,8 +1653,7 @@ }, "node_modules/cli-highlight/node_modules/yargs": { "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "license": "MIT", "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -1806,16 +1669,14 @@ }, "node_modules/cli-highlight/node_modules/yargs-parser": { "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/cliui": { "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -1827,8 +1688,7 @@ }, "node_modules/clone": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "license": "MIT", "optional": true, "engines": { "node": ">=0.8" @@ -1836,39 +1696,35 @@ }, "node_modules/cluster-key-slot": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", - "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", + "license": "Apache-2.0", "engines": { "node": ">=0.10.0" } }, "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, + "version": "2.0.1", + "license": "MIT", "dependencies": { - "color-name": "1.1.3" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "version": "1.1.4", + "license": "MIT" }, "node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "version": "11.0.0", + "license": "MIT", "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/content-disposition": { "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", "dependencies": { "safe-buffer": "5.2.1" }, @@ -1878,29 +1734,25 @@ }, "node_modules/content-type": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/cookie": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/cookie-signature": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" + "license": "MIT" }, "node_modules/cors": { "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "license": "MIT", "dependencies": { "object-assign": "^4", "vary": "^1" @@ -1911,13 +1763,11 @@ }, "node_modules/cssfilter": { "version": "0.0.10", - "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", - "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" + "license": "MIT" }, "node_modules/d": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", + "license": "ISC", "dependencies": { "es5-ext": "^0.10.50", "type": "^1.0.1" @@ -1925,21 +1775,18 @@ }, "node_modules/data-uri-to-buffer": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "license": "MIT", "engines": { "node": ">= 12" } }, "node_modules/dataloader": { "version": "2.2.2", - "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-2.2.2.tgz", - "integrity": "sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g==" + "license": "MIT" }, "node_modules/date-fns": { "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.21.0" }, @@ -1952,25 +1799,15 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "2.6.9", + "license": "MIT", "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "ms": "2.0.0" } }, "node_modules/deep-equal": { "version": "2.2.2", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.2.tgz", - "integrity": "sha512-xjVyBf0w5vH0I42jdAZzOKVldmPgSulmiyPRywoyq7HXC9qdgo17kxJE+rdnif5Tz6+pIrpJI8dCpMNLIGkUiA==", + "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.0", "call-bind": "^1.0.2", @@ -1997,8 +1834,7 @@ }, "node_modules/defaults": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", - "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "license": "MIT", "optional": true, "dependencies": { "clone": "^1.0.2" @@ -2007,11 +1843,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/define-data-property": { + "version": "1.1.0", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/define-properties": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", - "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "version": "1.2.1", + "license": "MIT", "dependencies": { + "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" }, @@ -2024,24 +1872,21 @@ }, "node_modules/denque": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", - "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", + "license": "Apache-2.0", "engines": { "node": ">=0.10" } }, "node_modules/depd": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/destroy": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", "engines": { "node": ">= 0.8", "npm": "1.2.8000 || >= 1.4.16" @@ -2049,8 +1894,7 @@ }, "node_modules/dotenv": { "version": "16.3.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", - "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", + "license": "BSD-2-Clause", "engines": { "node": ">=12" }, @@ -2060,8 +1904,7 @@ }, "node_modules/easy-table": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.2.0.tgz", - "integrity": "sha512-OFzVOv03YpvtcWGe5AayU5G2hgybsg3iqA6drU8UaoZyB9jLGMTrz9+asnLp/E+6qPh88yEI1gvyZFZ41dmgww==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -2071,26 +1914,22 @@ }, "node_modules/ee-first": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + "license": "MIT" }, "node_modules/emoji-regex": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "license": "MIT" }, "node_modules/encodeurl": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/es-get-iterator": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", - "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.3", @@ -2108,9 +1947,8 @@ }, "node_modules/es5-ext": { "version": "0.10.62", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz", - "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==", "hasInstallScript": true, + "license": "ISC", "dependencies": { "es6-iterator": "^2.0.3", "es6-symbol": "^3.1.3", @@ -2122,8 +1960,7 @@ }, "node_modules/es6-iterator": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", + "license": "MIT", "dependencies": { "d": "1", "es5-ext": "^0.10.35", @@ -2132,8 +1969,7 @@ }, "node_modules/es6-symbol": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", + "license": "ISC", "dependencies": { "d": "^1.0.1", "ext": "^1.1.2" @@ -2141,38 +1977,32 @@ }, "node_modules/escalade": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/escape-html": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + "license": "MIT" }, "node_modules/escape-string-regexp": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.8.0" } }, "node_modules/etag": { "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/ethers": { "version": "6.7.1", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.7.1.tgz", - "integrity": "sha512-qX5kxIFMfg1i+epfgb0xF4WM7IqapIIu50pOJ17aebkxxa4BacW5jFrQRmCJpDEg2ZK2oNtR5QjrQ1WDBF29dA==", "funding": [ { "type": "individual", @@ -2183,6 +2013,7 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], + "license": "MIT", "dependencies": { "@adraffy/ens-normalize": "1.9.2", "@noble/hashes": "1.1.2", @@ -2198,18 +2029,15 @@ }, "node_modules/ethers/node_modules/@types/node": { "version": "18.15.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", - "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" + "license": "MIT" }, "node_modules/ethers/node_modules/tslib": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + "license": "0BSD" }, "node_modules/ethers/node_modules/ws": { "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -2228,8 +2056,7 @@ }, "node_modules/express": { "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", + "license": "MIT", "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", @@ -2267,78 +2094,23 @@ "node": ">= 0.10.0" } }, - "node_modules/express/node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/express/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/express/node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/ext": { "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", + "license": "ISC", "dependencies": { "type": "^2.7.2" } }, "node_modules/ext/node_modules/type": { "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" + "license": "ISC" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "license": "MIT" }, "node_modules/fetch-blob": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", "funding": [ { "type": "github", @@ -2349,6 +2121,7 @@ "url": "https://paypal.me/jimmywarting" } ], + "license": "MIT", "dependencies": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" @@ -2359,8 +2132,7 @@ }, "node_modules/finalhandler": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "license": "MIT", "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", @@ -2374,31 +2146,16 @@ "node": ">= 0.8" } }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "node_modules/for-each": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "license": "MIT", "dependencies": { "is-callable": "^1.1.3" } }, "node_modules/formdata-polyfill": { "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "license": "MIT", "dependencies": { "fetch-blob": "^3.1.2" }, @@ -2408,50 +2165,43 @@ }, "node_modules/forwarded": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/fresh": { "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + "license": "ISC" }, "node_modules/function-bind": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "license": "MIT" }, "node_modules/functions-have-names": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/get-caller-file": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } }, "node_modules/get-intrinsic": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -2464,8 +2214,7 @@ }, "node_modules/glob": { "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -2482,17 +2231,15 @@ }, "node_modules/globals": { "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/gopd": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -2502,16 +2249,14 @@ }, "node_modules/graphql": { "version": "15.8.0", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", - "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==", + "license": "MIT", "engines": { "node": ">= 10.x" } }, "node_modules/graphql-parse-resolve-info": { "version": "4.13.0", - "resolved": "https://registry.npmjs.org/graphql-parse-resolve-info/-/graphql-parse-resolve-info-4.13.0.tgz", - "integrity": "sha512-VVJ1DdHYcR7hwOGQKNH+QTzuNgsLA8l/y436HtP9YHoX6nmwXRWq3xWthU3autMysXdm0fQUbhTZCx0W9ICozw==", + "license": "MIT", "dependencies": { "debug": "^4.1.1", "tslib": "^2.0.1" @@ -2523,10 +2268,28 @@ "graphql": ">=0.9 <0.14 || ^14.0.2 || ^15.4.0 || ^16.3.0" } }, + "node_modules/graphql-parse-resolve-info/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/graphql-parse-resolve-info/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, "node_modules/graphql-tag": { "version": "2.12.6", - "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz", - "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==", + "license": "MIT", "dependencies": { "tslib": "^2.1.0" }, @@ -2539,8 +2302,10 @@ }, "node_modules/graphql-ws": { "version": "5.14.0", - "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.14.0.tgz", - "integrity": "sha512-itrUTQZP/TgswR4GSSYuwWUzrE/w5GhbwM2GX3ic2U7aw33jgEsayfIlvaj7/GcIvZgNMzsPTrE5hqPuFUiE5g==", + "license": "MIT", + "workspaces": [ + "website" + ], "engines": { "node": ">=10" }, @@ -2550,8 +2315,7 @@ }, "node_modules/has": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "license": "MIT", "dependencies": { "function-bind": "^1.1.1" }, @@ -2561,24 +2325,21 @@ }, "node_modules/has-bigints": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/has-property-descriptors": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.1" }, @@ -2588,8 +2349,7 @@ }, "node_modules/has-proto": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -2599,8 +2359,7 @@ }, "node_modules/has-symbols": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -2610,8 +2369,7 @@ }, "node_modules/has-tostringtag": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" }, @@ -2624,16 +2382,14 @@ }, "node_modules/highlight.js": { "version": "10.7.3", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", - "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "license": "BSD-3-Clause", "engines": { "node": "*" } }, "node_modules/http-errors": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", @@ -2647,8 +2403,7 @@ }, "node_modules/iconv-lite": { "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" }, @@ -2658,8 +2413,6 @@ }, "node_modules/ieee754": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "funding": [ { "type": "github", @@ -2673,17 +2426,16 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "BSD-3-Clause" }, "node_modules/inflected": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/inflected/-/inflected-2.1.0.tgz", - "integrity": "sha512-hAEKNxvHf2Iq3H60oMBHkB4wl5jn3TPF3+fXek/sRwAB5gP9xWs4r7aweSF95f99HFoz69pnZTcu8f0SIHV18w==" + "license": "MIT" }, "node_modules/inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "license": "ISC", "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -2691,13 +2443,11 @@ }, "node_modules/inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "license": "ISC" }, "node_modules/internal-slot": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", - "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", + "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.0", "has": "^1.0.3", @@ -2709,8 +2459,7 @@ }, "node_modules/ioredis": { "version": "5.3.2", - "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", - "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", + "license": "MIT", "dependencies": { "@ioredis/commands": "^1.1.1", "cluster-key-slot": "^1.1.0", @@ -2730,18 +2479,35 @@ "url": "https://opencollective.com/ioredis" } }, + "node_modules/ioredis/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/ioredis/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" + }, "node_modules/ipaddr.js": { "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", "engines": { "node": ">= 0.10" } }, "node_modules/is-arguments": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -2755,8 +2521,7 @@ }, "node_modules/is-array-buffer": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.2.0", @@ -2768,8 +2533,7 @@ }, "node_modules/is-bigint": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "license": "MIT", "dependencies": { "has-bigints": "^1.0.1" }, @@ -2779,8 +2543,7 @@ }, "node_modules/is-boolean-object": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -2794,8 +2557,7 @@ }, "node_modules/is-callable": { "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -2805,8 +2567,7 @@ }, "node_modules/is-date-object": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -2819,24 +2580,21 @@ }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/is-map": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", - "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-number-object": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -2849,8 +2607,7 @@ }, "node_modules/is-regex": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -2864,16 +2621,14 @@ }, "node_modules/is-set": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", - "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-shared-array-buffer": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", - "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2" }, @@ -2883,8 +2638,7 @@ }, "node_modules/is-string": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -2897,8 +2651,7 @@ }, "node_modules/is-symbol": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" }, @@ -2911,8 +2664,7 @@ }, "node_modules/is-typed-array": { "version": "1.1.12", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", - "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "license": "MIT", "dependencies": { "which-typed-array": "^1.1.11" }, @@ -2925,21 +2677,18 @@ }, "node_modules/is-typedarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" + "license": "MIT" }, "node_modules/is-weakmap": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", - "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/is-weakset": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", - "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "get-intrinsic": "^1.1.1" @@ -2950,26 +2699,22 @@ }, "node_modules/isarray": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==" + "license": "MIT" }, "node_modules/javascript-natural-sort": { "version": "0.7.1", - "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", - "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/js-tokens": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/jsesc": { "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, + "license": "MIT", "bin": { "jsesc": "bin/jsesc" }, @@ -2979,42 +2724,35 @@ }, "node_modules/json-buffer": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + "license": "MIT" }, "node_modules/keyv": { "version": "4.5.3", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", - "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", + "license": "MIT", "dependencies": { "json-buffer": "3.0.1" } }, "node_modules/lodash": { "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/lodash.defaults": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==" + "license": "MIT" }, "node_modules/lodash.isarguments": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==" + "license": "MIT" }, "node_modules/lodash.sortby": { "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" + "license": "MIT" }, "node_modules/loglevel": { "version": "1.8.1", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.1.tgz", - "integrity": "sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==", + "license": "MIT", "engines": { "node": ">= 0.6.0" }, @@ -3025,42 +2763,36 @@ }, "node_modules/long": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + "license": "Apache-2.0" }, "node_modules/lru-cache": { "version": "7.13.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.1.tgz", - "integrity": "sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ==", + "license": "ISC", "engines": { "node": ">=12" } }, "node_modules/media-typer": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/merge-descriptors": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "license": "MIT" }, "node_modules/methods": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/mime": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", "bin": { "mime": "cli.js" }, @@ -3070,16 +2802,14 @@ }, "node_modules/mime-db": { "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/mime-types": { "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -3089,8 +2819,7 @@ }, "node_modules/minimatch": { "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -3100,8 +2829,7 @@ }, "node_modules/mkdirp": { "version": "2.1.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", - "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", + "license": "MIT", "bin": { "mkdirp": "dist/cjs/src/bin.js" }, @@ -3113,14 +2841,12 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.0.0", + "license": "MIT" }, "node_modules/mz": { "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "license": "MIT", "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", @@ -3129,26 +2855,21 @@ }, "node_modules/negotiator": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/next-tick": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" + "license": "ISC" }, "node_modules/node-abort-controller": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", - "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==" + "license": "MIT" }, "node_modules/node-domexception": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", "funding": [ { "type": "github", @@ -3159,31 +2880,32 @@ "url": "https://paypal.me/jimmywarting" } ], + "license": "MIT", "engines": { "node": ">=10.5.0" } }, "node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "version": "2.7.0", + "license": "MIT", "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" + "whatwg-url": "^5.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": "4.x || >=6.0.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, "node_modules/node-gyp-build": { "version": "4.6.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", - "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==", + "license": "MIT", "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -3192,24 +2914,21 @@ }, "node_modules/object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/object-inspect": { "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/object-is": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", - "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" @@ -3223,16 +2942,14 @@ }, "node_modules/object-keys": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "license": "MIT", "engines": { "node": ">= 0.4" } }, "node_modules/object.assign": { "version": "4.1.4", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", - "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.4", @@ -3248,8 +2965,7 @@ }, "node_modules/on-finished": { "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", "dependencies": { "ee-first": "1.1.1" }, @@ -3259,52 +2975,44 @@ }, "node_modules/once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", "dependencies": { "wrappy": "1" } }, "node_modules/packet-reader": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", - "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" + "license": "MIT" }, "node_modules/parse5": { "version": "5.1.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + "license": "MIT" }, "node_modules/parse5-htmlparser2-tree-adapter": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", - "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "license": "MIT", "dependencies": { "parse5": "^6.0.1" } }, "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + "license": "MIT" }, "node_modules/parseurl": { "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/path-to-regexp": { "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" + "license": "MIT" }, "node_modules/pg": { "version": "8.11.3", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz", - "integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==", + "license": "MIT", "dependencies": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", @@ -3331,40 +3039,34 @@ }, "node_modules/pg-cloudflare": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", - "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", + "license": "MIT", "optional": true }, "node_modules/pg-connection-string": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", - "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==" + "license": "MIT" }, "node_modules/pg-int8": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", + "license": "ISC", "engines": { "node": ">=4.0.0" } }, "node_modules/pg-pool": { "version": "3.6.1", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz", - "integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==", + "license": "MIT", "peerDependencies": { "pg": ">=8.0" } }, "node_modules/pg-protocol": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", - "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==" + "license": "MIT" }, "node_modules/pg-types": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", + "license": "MIT", "dependencies": { "pg-int8": "1.0.1", "postgres-array": "~2.0.0", @@ -3378,40 +3080,35 @@ }, "node_modules/pgpass": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", - "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", + "license": "MIT", "dependencies": { "split2": "^4.1.0" } }, "node_modules/postgres-array": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/postgres-bytea": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/postgres-date": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/postgres-interval": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", + "license": "MIT", "dependencies": { "xtend": "^4.0.0" }, @@ -3421,9 +3118,8 @@ }, "node_modules/prettier": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", - "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -3436,8 +3132,7 @@ }, "node_modules/prom-client": { "version": "14.2.0", - "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.2.0.tgz", - "integrity": "sha512-sF308EhTenb/pDRPakm+WgiN+VdM/T1RaHj1x+MvAuT8UiQP8JmOEbxVqtkbfR4LrvOg5n7ic01kRBDGXjYikA==", + "license": "Apache-2.0", "dependencies": { "tdigest": "^0.1.1" }, @@ -3447,8 +3142,7 @@ }, "node_modules/proxy-addr": { "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" @@ -3459,8 +3153,7 @@ }, "node_modules/qs": { "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.0.4" }, @@ -3473,16 +3166,14 @@ }, "node_modules/range-parser": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "version": "2.5.1", + "license": "MIT", "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", @@ -3495,16 +3186,14 @@ }, "node_modules/redis-errors": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", - "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/redis-parser": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", - "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", + "license": "MIT", "dependencies": { "redis-errors": "^1.0.0" }, @@ -3514,22 +3203,19 @@ }, "node_modules/reflect-metadata": { "version": "0.1.13", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" + "license": "Apache-2.0" }, "node_modules/regenerator-runtime": { "version": "0.14.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + "license": "MIT" }, "node_modules/regexp.prototype.flags": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", - "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "version": "1.5.1", + "license": "MIT", "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.2.0", - "functions-have-names": "^1.2.3" + "set-function-name": "^2.0.0" }, "engines": { "node": ">= 0.4" @@ -3540,24 +3226,20 @@ }, "node_modules/require-directory": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/retry": { "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "license": "MIT", "engines": { "node": ">= 4" } }, "node_modules/safe-buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -3571,17 +3253,16 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "license": "MIT" }, "node_modules/send": { "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "license": "MIT", "dependencies": { "debug": "2.6.9", "depd": "2.0.0", @@ -3601,28 +3282,13 @@ "node": ">= 0.8.0" } }, - "node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "node_modules/send/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "license": "MIT" }, "node_modules/serve-static": { "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "license": "MIT", "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", @@ -3633,15 +3299,25 @@ "node": ">= 0.8.0" } }, + "node_modules/set-function-name": { + "version": "2.0.1", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setprototypeof": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + "license": "ISC" }, "node_modules/sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "license": "(MIT AND BSD-3-Clause)", "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -3652,8 +3328,7 @@ }, "node_modules/side-channel": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "license": "MIT", "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -3665,38 +3340,33 @@ }, "node_modules/source-map": { "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } }, "node_modules/split2": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", "engines": { "node": ">= 10.x" } }, "node_modules/standard-as-callback": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", - "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==" + "license": "MIT" }, "node_modules/statuses": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/stop-iteration-iterator": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", - "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", + "license": "MIT", "dependencies": { "internal-slot": "^1.0.4" }, @@ -3706,8 +3376,7 @@ }, "node_modules/stoppable": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", - "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", + "license": "MIT", "engines": { "node": ">=4", "npm": ">=6" @@ -3715,8 +3384,7 @@ }, "node_modules/string-width": { "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -3728,8 +3396,7 @@ }, "node_modules/strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -3739,8 +3406,7 @@ }, "node_modules/supports-color": { "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -3753,8 +3419,7 @@ }, "node_modules/sync-fetch": { "version": "0.5.2", - "resolved": "https://registry.npmjs.org/sync-fetch/-/sync-fetch-0.5.2.tgz", - "integrity": "sha512-6gBqqkHrYvkH65WI2bzrDwrIKmt3U10s4Exnz3dYuE5Ah62FIfNv/F63inrNhu2Nyh3GH5f42GKU3RrSJoaUyQ==", + "license": "MIT", "dependencies": { "node-fetch": "^2.6.1" }, @@ -3762,45 +3427,23 @@ "node": ">=14" } }, - "node_modules/sync-fetch/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, "node_modules/tdigest": { "version": "0.1.2", - "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", - "integrity": "sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==", + "license": "MIT", "dependencies": { "bintrees": "1.0.2" } }, "node_modules/thenify": { "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "license": "MIT", "dependencies": { "any-promise": "^1.0.0" } }, "node_modules/thenify-all": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "license": "MIT", "dependencies": { "thenify": ">= 3.1.0 < 4" }, @@ -3810,40 +3453,34 @@ }, "node_modules/to-fast-properties": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/toidentifier": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", "engines": { "node": ">=0.6" } }, "node_modules/tr46": { "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + "license": "MIT" }, "node_modules/tslib": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "license": "0BSD" }, "node_modules/type": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" + "license": "ISC" }, "node_modules/type-is": { "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" @@ -3854,16 +3491,14 @@ }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "license": "MIT", "dependencies": { "is-typedarray": "^1.0.0" } }, "node_modules/typeorm": { "version": "0.3.17", - "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.17.tgz", - "integrity": "sha512-UDjUEwIQalO9tWw9O2A4GU+sT3oyoUXheHJy4ft+RFdnRdQctdQ34L9SqE2p7LdwzafHx1maxT+bqXON+Qnmig==", + "license": "MIT", "dependencies": { "@sqltools/formatter": "^1.2.5", "app-root-path": "^3.1.0", @@ -3965,24 +3600,9 @@ } } }, - "node_modules/typeorm/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/typeorm/node_modules/chalk": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -3994,26 +3614,28 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/typeorm/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/typeorm/node_modules/debug": { + "version": "4.3.4", + "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "ms": "2.1.2" }, "engines": { - "node": ">=7.0.0" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/typeorm/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "node_modules/typeorm/node_modules/ms": { + "version": "2.1.2", + "license": "MIT" }, "node_modules/typeorm/node_modules/supports-color": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -4023,9 +3645,8 @@ }, "node_modules/typescript": { "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -4036,17 +3657,15 @@ }, "node_modules/unpipe": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/utf-8-validate": { "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", "hasInstallScript": true, + "license": "MIT", "dependencies": { "node-gyp-build": "^4.3.0" }, @@ -4056,40 +3675,39 @@ }, "node_modules/utils-merge": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", "engines": { "node": ">= 0.4.0" } }, "node_modules/uuid": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", - "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "version": "9.0.1", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", "bin": { "uuid": "dist/bin/uuid" } }, "node_modules/value-or-promise": { "version": "1.0.11", - "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.11.tgz", - "integrity": "sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==", + "license": "MIT", "engines": { "node": ">=12" } }, "node_modules/vary": { "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", "engines": { "node": ">= 0.8" } }, "node_modules/wcwidth": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "license": "MIT", "optional": true, "dependencies": { "defaults": "^1.0.3" @@ -4097,21 +3715,18 @@ }, "node_modules/web-streams-polyfill": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", - "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", + "license": "MIT", "engines": { "node": ">= 8" } }, "node_modules/webidl-conversions": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + "license": "BSD-2-Clause" }, "node_modules/websocket": { "version": "1.0.34", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", - "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", + "license": "Apache-2.0", "dependencies": { "bufferutil": "^4.0.1", "debug": "^2.2.0", @@ -4124,31 +3739,16 @@ "node": ">=4.0.0" } }, - "node_modules/websocket/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/websocket/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "node_modules/whatwg-mimetype": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "license": "MIT", "engines": { "node": ">=12" } }, "node_modules/whatwg-url": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -4156,8 +3756,7 @@ }, "node_modules/which-boxed-primitive": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", "is-boolean-object": "^1.1.0", @@ -4171,8 +3770,7 @@ }, "node_modules/which-collection": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", - "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", + "license": "MIT", "dependencies": { "is-map": "^2.0.1", "is-set": "^2.0.1", @@ -4185,8 +3783,7 @@ }, "node_modules/which-typed-array": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", - "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -4203,8 +3800,7 @@ }, "node_modules/wrap-ansi": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -4217,45 +3813,13 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, "node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + "license": "ISC" }, "node_modules/ws": { - "version": "8.14.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.0.tgz", - "integrity": "sha512-WR0RJE9Ehsio6U4TuM+LmunEsjQ5ncHlw4sn9ihD6RoJKZrVyH9FWV3dmnwu8B2aNib1OvG2X6adUCyFpQyWcg==", + "version": "8.14.1", + "license": "MIT", "engines": { "node": ">=10.0.0" }, @@ -4274,8 +3838,7 @@ }, "node_modules/xss": { "version": "1.0.14", - "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz", - "integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==", + "license": "MIT", "dependencies": { "commander": "^2.20.3", "cssfilter": "0.0.10" @@ -4289,42 +3852,36 @@ }, "node_modules/xss/node_modules/commander": { "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + "license": "MIT" }, "node_modules/xtend": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", "engines": { "node": ">=0.4" } }, "node_modules/y18n": { "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", "engines": { "node": ">=10" } }, "node_modules/yaeti": { "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", + "license": "MIT", "engines": { "node": ">=0.10.32" } }, "node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "license": "ISC" }, "node_modules/yargs": { "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -4340,8 +3897,7 @@ }, "node_modules/yargs-parser": { "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", "engines": { "node": ">=12" } diff --git a/package.json b/package.json index 98c3d8c8..d705612a 100644 --- a/package.json +++ b/package.json @@ -6,15 +6,16 @@ }, "dependencies": { "@subsquid/archive-registry": "^3.1.0", - "@subsquid/evm-processor": "^1.7.1", + "@subsquid/evm-processor": "^1.8.2", "@subsquid/graphql-server": "^4.2.0", "@subsquid/typeorm-migration": "^1.2.0", - "@subsquid/typeorm-store": "^1.2.1", + "@subsquid/typeorm-store": "^1.2.2", "dotenv": "^16.1.4", "ethers": "^6.5.1", "pg": "^8.11.0", "typeorm": "^0.3.16", - "uuid": "^9.0.0" + "uuid": "^9.0.0", + "viem": "^1.10.13" }, "devDependencies": { "@subsquid/evm-typegen": "^3.2.0", @@ -22,7 +23,12 @@ "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@types/node": "^18.16.17", "@types/uuid": "^9.0.2", - "prettier": "^3.0.2", + "prettier": "^3.0.3", "typescript": "~5.1.3" + }, + "prettier": { + "semi": false, + "singleQuote": true, + "trailingComma": "all" } } diff --git a/schema.graphql b/schema.graphql index 84420717..09fa57cf 100644 --- a/schema.graphql +++ b/schema.graphql @@ -31,6 +31,14 @@ type Rebase @entity { apy: APY! } +# type RebaseOption @entity { +# id: ID! +# timestamp: DateTime! @index +# blockNumber: Int! @index +# txHash: String! @index +# status: Boolean! +# } + type APY @entity { id: ID! timestamp: DateTime! @index @@ -43,3 +51,67 @@ type APY @entity { apy30DayAvg: Float! rebasingCreditsPerToken: BigInt! } + +type FinancialStatement @entity { + id: ID! + timestamp: DateTime! @index + blockNumber: Int! @index + txHash: String! @index + vault: Vault! + curve: Curve! + fraxStaking: FraxStaking! + morphoAave: MorphoAave! + dripper: Dripper! +} + +# OETH Vault: 0x39254033945AA2E4809Cc2977E7087BEE48bd7Ab +type Vault @entity { + id: ID! + timestamp: DateTime! @index + blockNumber: Int! @index + txHash: String! @index + eth: BigInt! + weth: BigInt! + stETH: BigInt! + rETH: BigInt! + frxETH: BigInt! +} + +# OETH Convex: 0x1827F9eA98E0bf96550b2FC20F7233277FcD7E63 +# Curve LP Token: 0x94B17476A93b3262d87B9a326965D1E91f9c13E7 +# Convex Deposit: 0xF403C135812408BFbE8713b5A23a04b3D48AAE31 +type Curve @entity { + id: ID! + timestamp: DateTime! @index + blockNumber: Int! @index + txHash: String! @index + eth: BigInt! + oeth: BigInt! +} + +# OETH Frax Staking: 0x3fF8654D633D4Ea0faE24c52Aec73B4A20D0d0e5 +type FraxStaking @entity { + id: ID! + timestamp: DateTime! @index + blockNumber: Int! @index + txHash: String! @index + frxETH: BigInt! +} + +# OETH Morpho Aave: 0xc1fc9E5eC3058921eA5025D703CBE31764756319 +type MorphoAave @entity { + id: ID! + timestamp: DateTime! @index + blockNumber: Int! @index + txHash: String! @index + weth: BigInt! +} + +# OETH Dripper: 0xc0F42F73b8f01849a2DD99753524d4ba14317EB3 +type Dripper @entity { + id: ID! + timestamp: DateTime! @index + blockNumber: Int! @index + txHash: String! @index + weth: BigInt! +} diff --git a/src/abi/erc20.abi.ts b/src/abi/erc20.abi.ts new file mode 100644 index 00000000..ecf073da --- /dev/null +++ b/src/abi/erc20.abi.ts @@ -0,0 +1,218 @@ +export const ABI_JSON = [ + { + "type": "function", + "name": "name", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "approve", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_spender" + }, + { + "type": "uint256", + "name": "_value" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "totalSupply", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "transferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_from" + }, + { + "type": "address", + "name": "_to" + }, + { + "type": "uint256", + "name": "_value" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "decimals", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint8", + "name": "" + } + ] + }, + { + "type": "function", + "name": "balanceOf", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_owner" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "balance" + } + ] + }, + { + "type": "function", + "name": "symbol", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "transfer", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_to" + }, + { + "type": "uint256", + "name": "_value" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "allowance", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_owner" + }, + { + "type": "address", + "name": "_spender" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "fallback", + "stateMutability": "payable" + }, + { + "type": "event", + "anonymous": false, + "name": "Approval", + "inputs": [ + { + "type": "address", + "name": "owner", + "indexed": true + }, + { + "type": "address", + "name": "spender", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Transfer", + "inputs": [ + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "address", + "name": "to", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ] + } +] diff --git a/src/abi/erc20.ts b/src/abi/erc20.ts new file mode 100644 index 00000000..674cfb88 --- /dev/null +++ b/src/abi/erc20.ts @@ -0,0 +1,71 @@ +import * as ethers from 'ethers' +import {LogEvent, Func, ContractBase} from './abi.support' +import {ABI_JSON} from './erc20.abi' + +export const abi = new ethers.Interface(ABI_JSON); + +export const events = { + Approval: new LogEvent<([owner: string, spender: string, value: bigint] & {owner: string, spender: string, value: bigint})>( + abi, '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925' + ), + Transfer: new LogEvent<([from: string, to: string, value: bigint] & {from: string, to: string, value: bigint})>( + abi, '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' + ), +} + +export const functions = { + name: new Func<[], {}, string>( + abi, '0x06fdde03' + ), + approve: new Func<[_spender: string, _value: bigint], {_spender: string, _value: bigint}, boolean>( + abi, '0x095ea7b3' + ), + totalSupply: new Func<[], {}, bigint>( + abi, '0x18160ddd' + ), + transferFrom: new Func<[_from: string, _to: string, _value: bigint], {_from: string, _to: string, _value: bigint}, boolean>( + abi, '0x23b872dd' + ), + decimals: new Func<[], {}, number>( + abi, '0x313ce567' + ), + balanceOf: new Func<[_owner: string], {_owner: string}, bigint>( + abi, '0x70a08231' + ), + symbol: new Func<[], {}, string>( + abi, '0x95d89b41' + ), + transfer: new Func<[_to: string, _value: bigint], {_to: string, _value: bigint}, boolean>( + abi, '0xa9059cbb' + ), + allowance: new Func<[_owner: string, _spender: string], {_owner: string, _spender: string}, bigint>( + abi, '0xdd62ed3e' + ), +} + +export class Contract extends ContractBase { + + name(): Promise { + return this.eth_call(functions.name, []) + } + + totalSupply(): Promise { + return this.eth_call(functions.totalSupply, []) + } + + decimals(): Promise { + return this.eth_call(functions.decimals, []) + } + + balanceOf(_owner: string): Promise { + return this.eth_call(functions.balanceOf, [_owner]) + } + + symbol(): Promise { + return this.eth_call(functions.symbol, []) + } + + allowance(_owner: string, _spender: string): Promise { + return this.eth_call(functions.allowance, [_owner, _spender]) + } +} diff --git a/src/main.ts b/src/main.ts index a2f9747c..6ed79508 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,342 +1,18 @@ -import { BlockData } from '@subsquid/evm-processor'; -import { TypeormDatabase } from '@subsquid/typeorm-store'; -import { LessThan, LessThanOrEqual, MoreThanOrEqual } from 'typeorm'; -import { v4 as uuidv4 } from 'uuid'; +import { TypeormDatabase } from '@subsquid/typeorm-store' +import { processor } from './processor' +import { parse } from './parser' +import { transform } from './transform' -import * as oeth from './abi/oeth'; -import { APY, Address, History, Rebase } from './model'; -import { Context, OETH_ADDRESS, processor } from './processor'; - -const addressZero = "0x0000000000000000000000000000000000000000" - -interface RawTransfer { - id: string; - value: bigint; - from: string; - to: string; - timestamp: Date; - blockNumber: number; - txHash: string; -} - -interface RawRebase { - id: string; - totalSupply: bigint; - rebasingCredits: bigint; - rebasingCreditsPerToken: bigint; - timestamp: Date; - blockNumber: number; - txHash: string; -} - -type RawLog = RawTransfer | RawRebase; - -/** - * Aggregate Transfer and Rebase events from the logs - * - * @param {Context} ctx subsquid context - * @returns {(RawLog)[]} array of Transfer and Rebase events - */ -function getRawLogs(ctx: Context): (RawLog)[] { - let logs: (RawLog)[] = []; - for (let block of ctx.blocks) { - for (let log of block.logs) { - if ( - log.address === OETH_ADDRESS && - log.topics[0] === oeth.events.Transfer.topic - ) { - // Trasnfer events - let { from, to, value } = oeth.events.Transfer.decode(log); - logs.push({ - id: log.id, - value, - from: from.toLowerCase(), - to: to.toLowerCase(), - timestamp: new Date(block.header.timestamp), - blockNumber: block.header.height, - txHash: log.transactionHash, - }); - } else if ( - log.address === OETH_ADDRESS && - log.topics[0] === oeth.events.TotalSupplyUpdatedHighres.topic - ) { - // Rebase events - let { totalSupply, rebasingCredits, rebasingCreditsPerToken } = - oeth.events.TotalSupplyUpdatedHighres.decode(log); - logs.push({ - id: log.id, - totalSupply, - rebasingCredits, - rebasingCreditsPerToken, - timestamp: new Date(block.header.timestamp), - blockNumber: block.header.height, - txHash: log.transactionHash, - }); - } - } - } - - return logs; -} - -/** - * Verify if the log is a Transfer event - * - * @param {(RawLog)} log - * @returns {boolean} true if the log is a Transfer event - */ -function isRawTransfer(log: RawLog): log is RawTransfer { - return ( - (log as RawTransfer).value !== undefined && - (log as RawTransfer).from !== undefined && - (log as RawTransfer).to !== undefined - ); -} - -/** - * Verify if the log is a Rebase event - * - * @param {(RawLog)} log - * @returns {boolean} true if the log is a Rebase event - */ -function isRawRebase(log: RawLog): log is RawRebase { - return ( - (log as RawRebase).totalSupply !== undefined && - (log as RawRebase).rebasingCredits !== undefined && - (log as RawRebase).rebasingCreditsPerToken !== undefined - ); -} - -/** - * Create a new Address entity - * - * @param {Context} ctx subsquid context - * @param {string} addr - * @returns {Promise
} new Address entity - */ -async function createAddress(ctx: Context, addr: string): Promise
{ - let isContract: boolean = false; - if (addr !== '0x0000000000000000000000000000000000000000') { - isContract = - (await ctx._chain.client.call('eth_getCode', [addr, 'latest'])) !== '0x'; - } - - // ctx.log.info(`New address ${rawAddress}`); - return new Address({ - id: addr, - balance: 0, - earned: 0, - isContract, - rebasingOption: isContract ? 'OptOut' : 'OptIn', - }); -} - -/** - * Create Rebase entity and set APY - * - * @param {Context} ctx subsquid context - * @param {RawRebase} rebaseEvent rebase event - * @returns {Promise} Rebase entity - */ -async function createRebaseAPY( - ctx: Context, - rebaseEvent: RawRebase, -): Promise { - const r = new Rebase({ ...rebaseEvent }); - - // use date as id for APY - const date = new Date(rebaseEvent.timestamp); - const dateId = date.toISOString().substring(0, 10); - date.setDate(date.getDate() - 1); - const lastDateId = date.toISOString().substring(0, 10); - - // use date as id for APY - date.setDate(date.getDate() - 6); - const last7daysDateId = { - key: 'apy7DayAvg', - value: date.toISOString().substring(0, 10), - }; - date.setDate(date.getDate() - 14); - const last14daysDateId = { - key: 'apy14DayAvg', - value: date.toISOString().substring(0, 10), - }; - date.setDate(date.getDate() - 16); - const last30daysDateId = { - key: 'apy30DayAvg', - value: date.toISOString().substring(0, 10), - }; - - // get last APY to compare with current one - let lastApy = await ctx.store.findOne(APY, { - where: { id: LessThan(dateId) }, - order: { id: 'DESC' }, - }); - - // check if there is already an APY for the current date - let apy = await ctx.store.findOne(APY, { where: { id: dateId } }); - ctx.log.info(`APY: ${dateId} ${apy}, ${lastDateId} ${lastApy}`); - // create a new APY if it doesn't exist - if (!apy) { - apy = new APY({ - id: dateId, - blockNumber: rebaseEvent.blockNumber, - timestamp: rebaseEvent.timestamp, - txHash: rebaseEvent.txHash, - rebasingCreditsPerToken: rebaseEvent.rebasingCreditsPerToken, - }); - } - // should only happen for the first rebase event - if (!lastApy) { - apy.apr = 0; - apy.apy = 0; - apy.apy7DayAvg = 0; - apy.apy14DayAvg = 0; - apy.apy30DayAvg = 0; - - await ctx.store.upsert(apy); - return r; - } - - // update APY with the new rebase event - apy.blockNumber = rebaseEvent.blockNumber; - apy.timestamp = rebaseEvent.timestamp; - apy.txHash = rebaseEvent.txHash; - apy.rebasingCreditsPerToken = rebaseEvent.rebasingCreditsPerToken; - - // this should normally be 1 day but more secure to calculate it - const diffTime = Math.abs( - new Date(apy.id).getTime() - new Date(lastApy.id).getTime(), - ); - const dayDiff = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); - - apy.apr = - ((Number(lastApy.rebasingCreditsPerToken) / - Number(apy.rebasingCreditsPerToken) - - 1) * - 100 * - 365.25) / - dayDiff; - const periods_per_year = 365.25 / dayDiff; - apy.apy = - ((1 + apy.apr / periods_per_year / 100) ** periods_per_year - 1) * 100; - - // calculate average APY for the last 7, 14 and 30 days - for (const i of [last7daysDateId, last14daysDateId, last30daysDateId]) { - let pastAPYs = await ctx.store.findBy(APY, { - id: MoreThanOrEqual(i.value), - }); - // @ts-ignore - apy[i.key] = - pastAPYs.reduce((acc: number, cur: APY) => acc + cur.apy, apy.apy) / - (pastAPYs.length + 1); - } - - await ctx.store.upsert(apy); - return r; -} - -/** - * Process on-chain data - * - */ processor.run(new TypeormDatabase({ supportHotBlocks: true }), async (ctx) => { - const rawLogs = getRawLogs(ctx); - const history: History[] = []; - const rebases: Rebase[] = []; - - // get all addresses from the database. - // we need this because we increase their balance based on rebase events - const owners: Map = await ctx.store - .find(Address) - .then((q) => new Map(q.map((i) => [i.id, i]))); - - for (let t of rawLogs) { - // let rebase = await ctx.store.findOne(History, { - // where: { blockNumber: LessThanOrEqual(t.blockNumber), type: 'Rebase' }, - // order: { blockNumber: 'DESC' }, - // }); - - // Bind the token contract to the block number - const block = ctx.blocks.find( - (b) => b.header.height === t.blockNumber, - ) as BlockData; - const token = new oeth.Contract(ctx, block.header, OETH_ADDRESS); - - if (isRawTransfer(t)) { - // Trasnfer events - let addressSub = owners.get(t.from); - let addressAdd = owners.get(t.to); - - if (addressSub == null) { - addressSub = await createAddress(ctx, t.from); - owners.set(addressSub.id, addressSub); - } - if (addressAdd == null) { - addressAdd = await createAddress(ctx, t.to); - owners.set(addressAdd.id, addressAdd); - } - - addressSub.lastUpdated = t.timestamp; - addressAdd.lastUpdated = t.timestamp; - - const isSwap = [t.from, t.to].includes(addressZero); - - // update the address balance - await Promise.all( - [addressSub, addressAdd].map(async (address) => { - const credits = await token.creditsBalanceOfHighres(address.id); - const newBalance = Number(credits[0]) / Number(credits[1]); - history.push( - new History({ - // we can't use {t.id} because it's not unique - id: uuidv4(), - address: address, - value: newBalance - address.balance, - balance: newBalance, - timestamp: t.timestamp, - blockNumber: t.blockNumber, - txHash: t.txHash, - type: isSwap ? 'Swap' : (addressSub === address ? 'Sent' : 'Received'), - }), - ); - address.credits = BigInt(credits[0]); // token credits - address.balance = Number(credits[0]) / Number(credits[1]); // token balance - }), - ); - } else if (isRawRebase(t)) { - // Rebase events - let rebase = createRebaseAPY(ctx, t); - for (const address of owners.values()) { - if (address.rebasingOption === 'OptOut') { - continue; - } - const newBalance = - Number(address.credits) / Number(t.rebasingCreditsPerToken); - const earned = newBalance - address.balance; - - history.push( - new History({ - id: uuidv4(), - // we can't use {t.id} because it's not unique - address: address, - value: earned, - balance: newBalance, - timestamp: t.timestamp, - blockNumber: t.blockNumber, - txHash: t.txHash, - type: 'Yield', - }), - ); - - address.balance = newBalance; - address.earned += earned; - } - rebases.push(await rebase); - } - } - - await ctx.store.upsert([...owners.values()]); - await ctx.store.insert(history); - await ctx.store.insert(rebases); -}); + const logs = parse(ctx) + const { history, rebases, owners, vaults } = await transform(ctx, logs) + + const ownerValues = [...owners.values()] + ctx.log.info( + `Storing: ${ownerValues.length} owners, ${history.length} histories, ${rebases.length} rebases, ${vaults.length} vaults`, + ) + await ctx.store.upsert(ownerValues) + await ctx.store.insert(history) + await ctx.store.insert(rebases) + await ctx.store.insert(vaults) +}) diff --git a/src/model/generated/apy.model.ts b/src/model/generated/apy.model.ts index c07b869a..98f5a243 100644 --- a/src/model/generated/apy.model.ts +++ b/src/model/generated/apy.model.ts @@ -1,6 +1,5 @@ -import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_, OneToMany as OneToMany_} from "typeorm" +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm" import * as marshal from "./marshal" -import {Rebase} from "./rebase.model" @Entity_() export class APY { @@ -40,7 +39,4 @@ export class APY { @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) rebasingCreditsPerToken!: bigint - - @OneToMany_(() => Rebase, e => e.apy) - rebase!: Rebase[] } diff --git a/src/model/generated/curve.model.ts b/src/model/generated/curve.model.ts new file mode 100644 index 00000000..ac9c91fd --- /dev/null +++ b/src/model/generated/curve.model.ts @@ -0,0 +1,30 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm" +import * as marshal from "./marshal" + +@Entity_() +export class Curve { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @Index_() + @Column_("timestamp with time zone", {nullable: false}) + timestamp!: Date + + @Index_() + @Column_("int4", {nullable: false}) + blockNumber!: number + + @Index_() + @Column_("text", {nullable: false}) + txHash!: string + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + eth!: bigint + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + oeth!: bigint +} diff --git a/src/model/generated/dripper.model.ts b/src/model/generated/dripper.model.ts new file mode 100644 index 00000000..08f04e1e --- /dev/null +++ b/src/model/generated/dripper.model.ts @@ -0,0 +1,27 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm" +import * as marshal from "./marshal" + +@Entity_() +export class Dripper { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @Index_() + @Column_("timestamp with time zone", {nullable: false}) + timestamp!: Date + + @Index_() + @Column_("int4", {nullable: false}) + blockNumber!: number + + @Index_() + @Column_("text", {nullable: false}) + txHash!: string + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + weth!: bigint +} diff --git a/src/model/generated/financialStatement.model.ts b/src/model/generated/financialStatement.model.ts new file mode 100644 index 00000000..eb7f7abf --- /dev/null +++ b/src/model/generated/financialStatement.model.ts @@ -0,0 +1,48 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_, ManyToOne as ManyToOne_} from "typeorm" +import {Vault} from "./vault.model" +import {Curve} from "./curve.model" +import {FraxStaking} from "./fraxStaking.model" +import {MorphoAave} from "./morphoAave.model" +import {Dripper} from "./dripper.model" + +@Entity_() +export class FinancialStatement { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @Index_() + @Column_("timestamp with time zone", {nullable: false}) + timestamp!: Date + + @Index_() + @Column_("int4", {nullable: false}) + blockNumber!: number + + @Index_() + @Column_("text", {nullable: false}) + txHash!: string + + @Index_() + @ManyToOne_(() => Vault, {nullable: true}) + vault!: Vault + + @Index_() + @ManyToOne_(() => Curve, {nullable: true}) + curve!: Curve + + @Index_() + @ManyToOne_(() => FraxStaking, {nullable: true}) + fraxStaking!: FraxStaking + + @Index_() + @ManyToOne_(() => MorphoAave, {nullable: true}) + morphoAave!: MorphoAave + + @Index_() + @ManyToOne_(() => Dripper, {nullable: true}) + dripper!: Dripper +} diff --git a/src/model/generated/fraxStaking.model.ts b/src/model/generated/fraxStaking.model.ts new file mode 100644 index 00000000..51d1f748 --- /dev/null +++ b/src/model/generated/fraxStaking.model.ts @@ -0,0 +1,27 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm" +import * as marshal from "./marshal" + +@Entity_() +export class FraxStaking { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @Index_() + @Column_("timestamp with time zone", {nullable: false}) + timestamp!: Date + + @Index_() + @Column_("int4", {nullable: false}) + blockNumber!: number + + @Index_() + @Column_("text", {nullable: false}) + txHash!: string + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + frxETH!: bigint +} diff --git a/src/model/generated/index.ts b/src/model/generated/index.ts index bf4c90c2..973e52ae 100644 --- a/src/model/generated/index.ts +++ b/src/model/generated/index.ts @@ -2,3 +2,9 @@ export * from "./address.model" export * from "./history.model" export * from "./rebase.model" export * from "./apy.model" +export * from "./financialStatement.model" +export * from "./vault.model" +export * from "./curve.model" +export * from "./fraxStaking.model" +export * from "./morphoAave.model" +export * from "./dripper.model" diff --git a/src/model/generated/morphoAave.model.ts b/src/model/generated/morphoAave.model.ts new file mode 100644 index 00000000..0dc150aa --- /dev/null +++ b/src/model/generated/morphoAave.model.ts @@ -0,0 +1,27 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm" +import * as marshal from "./marshal" + +@Entity_() +export class MorphoAave { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @Index_() + @Column_("timestamp with time zone", {nullable: false}) + timestamp!: Date + + @Index_() + @Column_("int4", {nullable: false}) + blockNumber!: number + + @Index_() + @Column_("text", {nullable: false}) + txHash!: string + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + weth!: bigint +} diff --git a/src/model/generated/vault.model.ts b/src/model/generated/vault.model.ts new file mode 100644 index 00000000..8eb594a2 --- /dev/null +++ b/src/model/generated/vault.model.ts @@ -0,0 +1,39 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm" +import * as marshal from "./marshal" + +@Entity_() +export class Vault { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @Index_() + @Column_("timestamp with time zone", {nullable: false}) + timestamp!: Date + + @Index_() + @Column_("int4", {nullable: false}) + blockNumber!: number + + @Index_() + @Column_("text", {nullable: false}) + txHash!: string + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + eth!: bigint + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + weth!: bigint + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + stETH!: bigint + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + rETH!: bigint + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + frxETH!: bigint +} diff --git a/src/parser/index.ts b/src/parser/index.ts new file mode 100644 index 00000000..e9312eb3 --- /dev/null +++ b/src/parser/index.ts @@ -0,0 +1 @@ +export * from './parser' diff --git a/src/parser/parser.ts b/src/parser/parser.ts new file mode 100644 index 00000000..9f3d5906 --- /dev/null +++ b/src/parser/parser.ts @@ -0,0 +1,104 @@ +import { Context } from '../processor' +import * as oeth from '../abi/oeth' +import * as erc20 from '../abi/oeth' +import { OETH_ADDRESS, OETH_VAULT_ADDRESS } from '../utils/addresses' +import { Bytes20 } from '@subsquid/evm-processor/lib/interfaces/evm' +import { pad } from 'viem' + +type ContextBlocks = Context['blocks'] +type ContextBlock = ContextBlocks['0'] +type ContextLog = ContextBlocks['0']['logs']['0'] + +export interface BaseLog { + block: ContextBlock + id: string + address: Bytes20 + timestamp: Date + blockNumber: number + txHash: string +} + +export interface RawTransfer extends BaseLog { + type: 'transfer' + value: bigint + from: string + to: string +} + +export interface RawRebase extends BaseLog { + type: 'rebase' + totalSupply: bigint + rebasingCredits: bigint + rebasingCreditsPerToken: bigint +} + +export type RawLog = RawTransfer | RawRebase + +/** + * Aggregate Transfer and Rebase events from the logs + */ +export function parse(ctx: Context): RawLog[] { + let logs: RawLog[] = [] + const createBaseLog = (block: ContextBlock, log: ContextLog): BaseLog => { + return { + block, + id: log.id, + timestamp: new Date(block.header.timestamp), + blockNumber: block.header.height, + txHash: log.transactionHash, + address: log.address, + } + } + const createTransfer = (block: ContextBlock, log: ContextLog) => { + let { from, to, value } = oeth.events.Transfer.decode(log) + logs.push({ + ...createBaseLog(block, log), + type: 'transfer', + value, + from: from.toLowerCase(), + to: to.toLowerCase(), + }) + } + const createRebase = (block: ContextBlock, log: ContextLog) => { + let { totalSupply, rebasingCredits, rebasingCreditsPerToken } = + oeth.events.TotalSupplyUpdatedHighres.decode(log) + logs.push({ + ...createBaseLog(block, log), + type: 'rebase', + totalSupply, + rebasingCredits, + rebasingCreditsPerToken, + }) + } + + const mapping: Record< + Bytes20, // EVM Address + | undefined + | Record< + string, // Topic0 + (block: ContextBlock, log: ContextLog) => void + > + > = { + [OETH_ADDRESS]: { + [oeth.events.Transfer.topic]: createTransfer, + [oeth.events.TotalSupplyUpdatedHighres.topic]: createRebase, + }, + default: { + [erc20.events.Transfer.topic]: (block, log) => { + if (log.topics[1] === pad(OETH_VAULT_ADDRESS)) + createTransfer(block, log) + else if (log.topics[2] === pad(OETH_VAULT_ADDRESS)) + createTransfer(block, log) + }, + }, + } + + for (let block of ctx.blocks) { + for (let log of block.logs) { + mapping[log.address]?.[log.topics[0]]?.(block, log) + mapping['default']?.[log.topics[0]]?.(block, log) + } + } + + return logs +} diff --git a/src/processor.ts b/src/processor.ts index d8983016..35c834d7 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -1,4 +1,4 @@ -import { lookupArchive } from '@subsquid/archive-registry'; +import { lookupArchive } from '@subsquid/archive-registry' import { BlockHeader, DataHandlerContext, @@ -6,13 +6,17 @@ import { EvmBatchProcessorFields, Log as _Log, Transaction as _Transaction, -} from '@subsquid/evm-processor'; -import { Store } from '@subsquid/typeorm-store'; +} from '@subsquid/evm-processor' +import { Store } from '@subsquid/typeorm-store' -import * as oeth from './abi/oeth'; - -export const OETH_ADDRESS = - '0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3'.toLowerCase(); +import * as oeth from './abi/oeth' +import * as erc20 from './abi/erc20' +import { + OETH_ADDRESS, + OETH_VAULT_ADDRESS, + VAULT_HOLDINGS_ADDRESSES, +} from './utils/addresses' +import { pad } from 'viem' export const processor = new EvmBatchProcessor() .setDataSource({ @@ -49,8 +53,18 @@ export const processor = new EvmBatchProcessor() }, }) .setBlockRange({ - from: 16933090, // https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 + from: Math.min( + 16933090, // OETH Deploy: https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 + 17067001, // OETH Vault: https://etherscan.io/tx/0x0b81a0e2b7d824ce493465221218b9c79b4a9478c0bb7760b386be240f5985b8 + ), }) + // .addTransaction({ + // to: [OETH_ADDRESS], + // sighash: [ + // oeth.functions.rebaseOptIn.sighash, + // oeth.functions.rebaseOptOut.sighash, + // ], + // }) .addLog({ address: [OETH_ADDRESS], topic0: [ @@ -58,11 +72,21 @@ export const processor = new EvmBatchProcessor() oeth.events.TotalSupplyUpdatedHighres.topic, ], transaction: true, - }); + }) + .addLog({ + address: VAULT_HOLDINGS_ADDRESSES, + topic0: [erc20.events.Transfer.topic], + topic1: [pad(OETH_VAULT_ADDRESS)], + }) + .addLog({ + address: VAULT_HOLDINGS_ADDRESSES, + topic0: [erc20.events.Transfer.topic], + topic2: [pad(OETH_VAULT_ADDRESS)], + }) -export type Fields = EvmBatchProcessorFields; -export type Context = DataHandlerContext; -export type Block = BlockHeader; -export type Log = _Log; -export type Transaction = _Transaction; -export type ProcessorContext = DataHandlerContext; +export type Fields = EvmBatchProcessorFields +export type Context = DataHandlerContext +export type Block = BlockHeader +export type Log = _Log +export type Transaction = _Transaction +export type ProcessorContext = DataHandlerContext diff --git a/src/transform/index.ts b/src/transform/index.ts new file mode 100644 index 00000000..d551975c --- /dev/null +++ b/src/transform/index.ts @@ -0,0 +1 @@ +export * from './transform' diff --git a/src/transform/transform.ts b/src/transform/transform.ts new file mode 100644 index 00000000..9cc7cbae --- /dev/null +++ b/src/transform/transform.ts @@ -0,0 +1,314 @@ +import { RawLog, RawRebase } from '../parser' +import { Address, APY, History, Rebase, Vault } from '../model' +import { BlockData } from '@subsquid/evm-processor' +import * as oeth from '../abi/oeth' +import { Context } from '../processor' +import { v4 as uuidv4 } from 'uuid' +import { LessThan, LessThanOrEqual, MoreThanOrEqual } from 'typeorm' +import { + ADDRESS_ZERO, + FRXETH_ADDRESS, + OETH_ADDRESS, + OETH_VAULT_ADDRESS, + RETH_ADDRESS, + STETH_ADDRESS, + VAULT_HOLDINGS_ADDRESSES, + WETH_ADDRESS, +} from '../utils/addresses' + +const addressZero = '0x0000000000000000000000000000000000000000' + +interface TransformResult { + history: History[] + rebases: Rebase[] + vaults: Vault[] + owners: Map +} + +export const transform = async (ctx: Context, logs: RawLog[]) => { + const result: TransformResult = { + history: [], + rebases: [], + vaults: [], + owners: new Map(), + } + + // get all addresses from the database. + // we need this because we increase their balance based on rebase events + result.owners = await ctx.store + .find(Address) + .then((q) => new Map(q.map((i) => [i.id, i]))) + + for (let log of logs) { + // let rebase = await ctx.store.findOne(History, { + // where: { blockNumber: LessThanOrEqual(t.blockNumber), type: 'Rebase' }, + // order: { blockNumber: 'DESC' }, + // }); + + if (log.address === OETH_ADDRESS) { + if (log.type === 'transfer') { + // Bind the token contract to the block number + const token = new oeth.Contract(ctx, log.block.header, OETH_ADDRESS) + // Transfer events + let addressSub = result.owners.get(log.from) + let addressAdd = result.owners.get(log.to) + + if (addressSub == null) { + addressSub = await createAddress(ctx, log.from) + result.owners.set(addressSub.id, addressSub) + } + if (addressAdd == null) { + addressAdd = await createAddress(ctx, log.to) + result.owners.set(addressAdd.id, addressAdd) + } + + addressSub.lastUpdated = log.timestamp + addressAdd.lastUpdated = log.timestamp + + const isSwap = [log.from, log.to].includes(addressZero) + + // update the address balance + await Promise.all( + [addressSub, addressAdd].map(async (address) => { + const credits = await token.creditsBalanceOfHighres(address.id) + const newBalance = Number(credits[0]) / Number(credits[1]) + result.history.push( + new History({ + // we can't use {t.id} because it's not unique + id: uuidv4(), + address: address, + value: newBalance - address.balance, + balance: newBalance, + timestamp: log.timestamp, + blockNumber: log.blockNumber, + txHash: log.txHash, + type: isSwap + ? 'Swap' + : addressSub === address + ? 'Sent' + : 'Received', + }), + ) + address.credits = BigInt(credits[0]) // token credits + address.balance = Number(credits[0]) / Number(credits[1]) // token balance + }), + ) + } else if (log.type === 'rebase') { + // Rebase events + let rebase = createRebaseAPY(ctx, log) + for (const address of result.owners.values()) { + if (address.rebasingOption === 'OptOut') { + continue + } + const newBalance = + Number(address.credits) / Number(log.rebasingCreditsPerToken) + const earned = newBalance - address.balance + + result.history.push( + new History({ + id: uuidv4(), + // we can't use {t.id} because it's not unique + address: address, + value: earned, + balance: newBalance, + timestamp: log.timestamp, + blockNumber: log.blockNumber, + txHash: log.txHash, + type: 'Yield', + }), + ) + + address.balance = newBalance + address.earned += earned + } + const entity = await rebase + result.rebases.push(entity) + } + } else if (VAULT_HOLDINGS_ADDRESSES.includes(log.address)) { + if ( + log.type === 'transfer' && + log.value > 0n && + (log.from === OETH_VAULT_ADDRESS || log.to === OETH_VAULT_ADDRESS) + ) { + const dateId = log.timestamp.toISOString() + + // Multiple transfers in a single block will lead us to modify ourselves. + let vault = result.vaults + .slice(result.vaults.length - 1) + .find((v) => v.id === dateId) + + if (!vault) { + let last = + result.vaults[result.vaults.length - 1] ?? + (await ctx.store.findOne(Vault, { + where: { id: LessThanOrEqual(dateId) }, + order: { id: 'desc' }, + })) + vault = + last?.id === dateId + ? last + : new Vault({ + id: dateId, + timestamp: log.timestamp, + blockNumber: log.blockNumber, + txHash: log.txHash, + eth: last?.eth ?? 0n, + weth: last?.weth ?? 0n, + rETH: last?.rETH ?? 0n, + stETH: last?.stETH ?? 0n, + frxETH: last?.frxETH ?? 0n, + }) + result.vaults.push(vault) + } else { + ctx.log.info(`existing: ${vault}`) + } + + const change = log.from === OETH_VAULT_ADDRESS ? -log.value : log.value + if (log.address === ADDRESS_ZERO) { + vault.eth += change + } else if (log.address === WETH_ADDRESS) { + vault.weth += change + } else if (log.address === RETH_ADDRESS) { + vault.rETH += change + } else if (log.address === STETH_ADDRESS) { + vault.stETH += change + } else if (log.address === FRXETH_ADDRESS) { + vault.frxETH += change + } + + // ctx.log.info( + // `Transfer: ${log.address} : ${log.from} > ${log.to} : ${log.value}`, + // ) + + // if (log.address === FRXETH_ADDRESS) { + // ctx.log.info( + // `${log.address} frxETH ${change} ${vault.frxETH} ${log.txHash}`, + // ) + // } + } + } + } + + return result +} + +/** + * Create a new Address entity + */ +async function createAddress(ctx: Context, addr: string): Promise
{ + let isContract: boolean = false + if (addr !== '0x0000000000000000000000000000000000000000') { + isContract = + (await ctx._chain.client.call('eth_getCode', [addr, 'latest'])) !== '0x' + } + + // ctx.log.info(`New address ${rawAddress}`); + return new Address({ + id: addr, + balance: 0, + earned: 0, + isContract, + rebasingOption: isContract ? 'OptOut' : 'OptIn', + }) +} + +/** + * Create Rebase entity and set APY + */ +async function createRebaseAPY( + ctx: Context, + rebaseEvent: RawRebase, +): Promise { + const r = new Rebase({ ...rebaseEvent }) + + // use date as id for APY + const date = new Date(rebaseEvent.timestamp) + const dateId = date.toISOString().substring(0, 10) + date.setDate(date.getDate() - 1) + const lastDateId = date.toISOString().substring(0, 10) + + // use date as id for APY + date.setDate(date.getDate() - 6) + const last7daysDateId = { + key: 'apy7DayAvg', + value: date.toISOString().substring(0, 10), + } + date.setDate(date.getDate() - 14) + const last14daysDateId = { + key: 'apy14DayAvg', + value: date.toISOString().substring(0, 10), + } + date.setDate(date.getDate() - 16) + const last30daysDateId = { + key: 'apy30DayAvg', + value: date.toISOString().substring(0, 10), + } + + // get last APY to compare with current one + let lastApy = await ctx.store.findOne(APY, { + where: { id: LessThan(dateId) }, + order: { id: 'DESC' }, + }) + + // check if there is already an APY for the current date + let apy = await ctx.store.findOne(APY, { where: { id: dateId } }) + // ctx.log.info(`APY: ${dateId} ${apy}, ${lastDateId} ${lastApy}`); + // create a new APY if it doesn't exist + if (!apy) { + apy = new APY({ + id: dateId, + blockNumber: rebaseEvent.blockNumber, + timestamp: rebaseEvent.timestamp, + txHash: rebaseEvent.txHash, + rebasingCreditsPerToken: rebaseEvent.rebasingCreditsPerToken, + }) + } + // should only happen for the first rebase event + if (!lastApy) { + apy.apr = 0 + apy.apy = 0 + apy.apy7DayAvg = 0 + apy.apy14DayAvg = 0 + apy.apy30DayAvg = 0 + + await ctx.store.upsert(apy) + return r + } + + // update APY with the new rebase event + apy.blockNumber = rebaseEvent.blockNumber + apy.timestamp = rebaseEvent.timestamp + apy.txHash = rebaseEvent.txHash + apy.rebasingCreditsPerToken = rebaseEvent.rebasingCreditsPerToken + + // this should normally be 1 day but more secure to calculate it + const diffTime = Math.abs( + new Date(apy.id).getTime() - new Date(lastApy.id).getTime(), + ) + const dayDiff = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + + apy.apr = + ((Number(lastApy.rebasingCreditsPerToken) / + Number(apy.rebasingCreditsPerToken) - + 1) * + 100 * + 365.25) / + dayDiff + const periods_per_year = 365.25 / dayDiff + apy.apy = + ((1 + apy.apr / periods_per_year / 100) ** periods_per_year - 1) * 100 + + // calculate average APY for the last 7, 14 and 30 days + for (const i of [last7daysDateId, last14daysDateId, last30daysDateId]) { + let pastAPYs = await ctx.store.findBy(APY, { + id: MoreThanOrEqual(i.value), + }) + // @ts-ignore + apy[i.key] = + pastAPYs.reduce((acc: number, cur: APY) => acc + cur.apy, apy.apy) / + (pastAPYs.length + 1) + } + + await ctx.store.upsert(apy) + return r +} diff --git a/src/utils/addresses.ts b/src/utils/addresses.ts new file mode 100644 index 00000000..2a9721dc --- /dev/null +++ b/src/utils/addresses.ts @@ -0,0 +1,19 @@ +// Lowercase Addresses + +export const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000' + +export const OETH_ADDRESS = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3' +export const OETH_VAULT_ADDRESS = '0x39254033945aa2e4809cc2977e7087bee48bd7ab' + +export const WETH_ADDRESS = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' +export const STETH_ADDRESS = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' +export const RETH_ADDRESS = '0xae78736cd615f374d3085123a210448e74fc6393' +export const FRXETH_ADDRESS = '0x5e8422345238f34275888049021821e8e08caa1f' + +export const VAULT_HOLDINGS_ADDRESSES = [ + ADDRESS_ZERO, + WETH_ADDRESS, + STETH_ADDRESS, + RETH_ADDRESS, + FRXETH_ADDRESS, +] diff --git a/types.graphql b/types.graphql new file mode 100644 index 00000000..bc5b64fc --- /dev/null +++ b/types.graphql @@ -0,0 +1,18 @@ +# node_modules/@subsquid/openreader/src/model.schema.ts:26 + +directive @entity on OBJECT +directive @query on INTERFACE +directive @derivedFrom(field: String!) on FIELD_DEFINITION +directive @unique on FIELD_DEFINITION +directive @index(fields: [String!] unique: Boolean) repeatable on OBJECT | FIELD_DEFINITION +directive @fulltext(query: String!) on FIELD_DEFINITION +directive @cardinality(value: Int!) on OBJECT | FIELD_DEFINITION +directive @byteWeight(value: Float!) on FIELD_DEFINITION +directive @variant on OBJECT # legacy +directive @jsonField on OBJECT # legacy +# scalar ID +scalar BigInt +scalar BigDecimal +scalar Bytes +scalar DateTime +scalar JSON \ No newline at end of file From 1bc2895e6906dcb3e91c3f92452813d172e5e41a Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Thu, 14 Sep 2023 23:33:58 -0700 Subject: [PATCH 02/31] work on tracking token balances --- src/transform/transform.ts | 181 ++++++++++++++++++++++++------------- src/utils/addresses.ts | 7 ++ 2 files changed, 126 insertions(+), 62 deletions(-) diff --git a/src/transform/transform.ts b/src/transform/transform.ts index 9cc7cbae..4c3d6d9c 100644 --- a/src/transform/transform.ts +++ b/src/transform/transform.ts @@ -1,6 +1,5 @@ -import { RawLog, RawRebase } from '../parser' -import { Address, APY, History, Rebase, Vault } from '../model' -import { BlockData } from '@subsquid/evm-processor' +import { RawLog, RawRebase, RawTransfer } from '../parser' +import { Address, APY, FraxStaking, History, Rebase, Vault } from '../model' import * as oeth from '../abi/oeth' import { Context } from '../processor' import { v4 as uuidv4 } from 'uuid' @@ -9,12 +8,14 @@ import { ADDRESS_ZERO, FRXETH_ADDRESS, OETH_ADDRESS, + OETH_FRAX_STAKING_ADDRESS, OETH_VAULT_ADDRESS, RETH_ADDRESS, STETH_ADDRESS, VAULT_HOLDINGS_ADDRESSES, WETH_ADDRESS, } from '../utils/addresses' +import { Entity, EntityClass } from '@subsquid/typeorm-store' const addressZero = '0x0000000000000000000000000000000000000000' @@ -22,6 +23,7 @@ interface TransformResult { history: History[] rebases: Rebase[] vaults: Vault[] + fraxStakings: FraxStaking[] owners: Map } @@ -30,6 +32,7 @@ export const transform = async (ctx: Context, logs: RawLog[]) => { history: [], rebases: [], vaults: [], + fraxStakings: [], owners: new Map(), } @@ -124,74 +127,128 @@ export const transform = async (ctx: Context, logs: RawLog[]) => { const entity = await rebase result.rebases.push(entity) } - } else if (VAULT_HOLDINGS_ADDRESSES.includes(log.address)) { - if ( - log.type === 'transfer' && - log.value > 0n && - (log.from === OETH_VAULT_ADDRESS || log.to === OETH_VAULT_ADDRESS) - ) { - const dateId = log.timestamp.toISOString() - - // Multiple transfers in a single block will lead us to modify ourselves. - let vault = result.vaults - .slice(result.vaults.length - 1) - .find((v) => v.id === dateId) - - if (!vault) { - let last = - result.vaults[result.vaults.length - 1] ?? - (await ctx.store.findOne(Vault, { - where: { id: LessThanOrEqual(dateId) }, - order: { id: 'desc' }, - })) - vault = - last?.id === dateId - ? last - : new Vault({ - id: dateId, - timestamp: log.timestamp, - blockNumber: log.blockNumber, - txHash: log.txHash, - eth: last?.eth ?? 0n, - weth: last?.weth ?? 0n, - rETH: last?.rETH ?? 0n, - stETH: last?.stETH ?? 0n, - frxETH: last?.frxETH ?? 0n, - }) - result.vaults.push(vault) - } else { - ctx.log.info(`existing: ${vault}`) - } + } else if (log.type === 'transfer') { + await trackAddressBalances({ + address: OETH_VAULT_ADDRESS, + tokens: VAULT_HOLDINGS_ADDRESSES, + log, + fn: async ({ log, token, change }) => { + const dateId = log.timestamp.toISOString() + const { latest, current } = await getLatest( + ctx, + Vault, + result.vaults, + dateId, + ) - const change = log.from === OETH_VAULT_ADDRESS ? -log.value : log.value - if (log.address === ADDRESS_ZERO) { - vault.eth += change - } else if (log.address === WETH_ADDRESS) { - vault.weth += change - } else if (log.address === RETH_ADDRESS) { - vault.rETH += change - } else if (log.address === STETH_ADDRESS) { - vault.stETH += change - } else if (log.address === FRXETH_ADDRESS) { - vault.frxETH += change - } + let vault = current + if (!vault) { + vault = new Vault({ + id: dateId, + timestamp: log.timestamp, + blockNumber: log.blockNumber, + txHash: log.txHash, + eth: latest?.eth ?? 0n, + weth: latest?.weth ?? 0n, + rETH: latest?.rETH ?? 0n, + stETH: latest?.stETH ?? 0n, + frxETH: latest?.frxETH ?? 0n, + }) + result.vaults.push(vault) + } - // ctx.log.info( - // `Transfer: ${log.address} : ${log.from} > ${log.to} : ${log.value}`, - // ) + if (token === ADDRESS_ZERO) { + vault.eth += change + } else if (token === WETH_ADDRESS) { + vault.weth += change + } else if (token === RETH_ADDRESS) { + vault.rETH += change + } else if (token === STETH_ADDRESS) { + vault.stETH += change + } else if (token === FRXETH_ADDRESS) { + vault.frxETH += change + } + }, + }) + await trackAddressBalances({ + address: OETH_FRAX_STAKING_ADDRESS, // TODO: Check this, probably wrong + tokens: [FRXETH_ADDRESS], // TODO: Check this, probably wrong + log, + fn: async ({ log, token, change }) => { + const dateId = log.timestamp.toISOString() + const { latest, current } = await getLatest( + ctx, + FraxStaking, + result.fraxStakings, + dateId, + ) - // if (log.address === FRXETH_ADDRESS) { - // ctx.log.info( - // `${log.address} frxETH ${change} ${vault.frxETH} ${log.txHash}`, - // ) - // } - } + let fraxStaking = current + if (!fraxStaking) { + fraxStaking = new FraxStaking({ + id: dateId, + timestamp: log.timestamp, + blockNumber: log.blockNumber, + txHash: log.txHash, + frxETH: latest?.frxETH ?? 0n, + }) + result.fraxStakings.push(fraxStaking) + } + + // TODO: Werk on me pweeze + if (token === FRXETH_ADDRESS) { + fraxStaking.frxETH += change + } + }, + }) } } return result } +const getLatest = async ( + ctx: Context, + entity: EntityClass, + store: T[], + id: string, +) => { + const current = store.slice(store.length - 1).find((v) => v.id === id) + const latest = + store[store.length - 1] ?? + (await ctx.store.findOne(entity as EntityClass, { + where: { id: LessThanOrEqual(id) }, + order: { id: 'desc' }, + })) + return { current, latest } +} + +const trackAddressBalances = async ({ + log, + address, + tokens, + fn, +}: { + log: RawTransfer + address: string + tokens: string[] + fn: (params: { + address: string + token: string + change: bigint + log: RawTransfer + }) => Promise +}) => { + if ( + log.value > 0n && + (log.from === address || log.to === address) && + tokens.includes(log.address) + ) { + const change = log.from === address ? -log.value : log.value + await fn({ address, token: log.address, change, log }) + } +} + /** * Create a new Address entity */ diff --git a/src/utils/addresses.ts b/src/utils/addresses.ts index 2a9721dc..d410d55d 100644 --- a/src/utils/addresses.ts +++ b/src/utils/addresses.ts @@ -17,3 +17,10 @@ export const VAULT_HOLDINGS_ADDRESSES = [ RETH_ADDRESS, FRXETH_ADDRESS, ] + +export const OETH_CONVEX_ADDRESS = '0x1827f9ea98e0bf96550b2fc20f7233277fcd7e63' +export const CURVE_LP_ADDRESS = '0x94b17476a93b3262d87b9a326965d1e91f9c13e7' +export const CONVEX_DEPOSIT = '0xf403c135812408bfbe8713b5a23a04b3d48aae31' + +export const OETH_FRAX_STAKING_ADDRESS = + '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5' From 8e011bc4748c0097d616cc5acd76f9d688aaee61 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Fri, 15 Sep 2023 14:57:25 -0700 Subject: [PATCH 03/31] handle rebaseOptIn and rebaseOptOut --- ...34538759-Data.js => 1694808555614-Data.js} | 16 +- package-lock.json | 976 +++++++++++++++++- schema.graphql | 15 +- src/main.ts | 9 +- src/model/generated/index.ts | 1 + src/model/generated/rebaseOption.model.ts | 31 + src/parser/parser.ts | 41 +- src/processor.ts | 27 +- src/transform/transform.ts | 118 ++- tsconfig.json | 4 +- 10 files changed, 1178 insertions(+), 60 deletions(-) rename db/migrations/{1694734538759-Data.js => 1694808555614-Data.js} (89%) create mode 100644 src/model/generated/rebaseOption.model.ts diff --git a/db/migrations/1694734538759-Data.js b/db/migrations/1694808555614-Data.js similarity index 89% rename from db/migrations/1694734538759-Data.js rename to db/migrations/1694808555614-Data.js index 101c2efb..774f4525 100644 --- a/db/migrations/1694734538759-Data.js +++ b/db/migrations/1694808555614-Data.js @@ -1,5 +1,5 @@ -module.exports = class Data1694734538759 { - name = 'Data1694734538759' +module.exports = class Data1694808555614 { + name = 'Data1694808555614' async up(db) { await db.query(`CREATE TABLE "history" ("id" character varying NOT NULL, "value" numeric NOT NULL, "balance" numeric NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "type" text NOT NULL, "address_id" character varying, CONSTRAINT "PK_9384942edf4804b38ca0ee51416" PRIMARY KEY ("id"))`) @@ -16,6 +16,11 @@ module.exports = class Data1694734538759 { await db.query(`CREATE INDEX "IDX_a5955dbd9ac031314697cbd54f" ON "rebase" ("block_number") `) await db.query(`CREATE INDEX "IDX_7cd793b6c4bc15b9082e0eb97a" ON "rebase" ("tx_hash") `) await db.query(`CREATE INDEX "IDX_02d02f9022ef86e60f1a84b9dc" ON "rebase" ("apy_id") `) + await db.query(`CREATE TABLE "rebase_option" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "status" text NOT NULL, "address_id" character varying, CONSTRAINT "PK_426a38c91faad05465d687740ea" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_751e6b6352737ddf4f0da0d6d8" ON "rebase_option" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_e59c9a534fcf23a97a8ac92afa" ON "rebase_option" ("block_number") `) + await db.query(`CREATE INDEX "IDX_6b6c08ec25dacd1a5bd6170152" ON "rebase_option" ("tx_hash") `) + await db.query(`CREATE INDEX "IDX_66c04aee6855c74debae4add8f" ON "rebase_option" ("address_id") `) await db.query(`CREATE TABLE "vault" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "eth" numeric NOT NULL, "weth" numeric NOT NULL, "st_eth" numeric NOT NULL, "r_eth" numeric NOT NULL, "frx_eth" numeric NOT NULL, CONSTRAINT "PK_dd0898234c77f9d97585171ac59" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_0f1a5b7e346813a4ec3a03010b" ON "vault" ("timestamp") `) await db.query(`CREATE INDEX "IDX_a9b314451a9001a7b0a222f68a" ON "vault" ("block_number") `) @@ -47,6 +52,7 @@ module.exports = class Data1694734538759 { await db.query(`CREATE INDEX "IDX_7a506ebb6c720f35607810b734" ON "financial_statement" ("dripper_id") `) await db.query(`ALTER TABLE "history" ADD CONSTRAINT "FK_59a55adcc59ddb69c297da693e5" FOREIGN KEY ("address_id") REFERENCES "address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "rebase" ADD CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2" FOREIGN KEY ("apy_id") REFERENCES "apy"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "rebase_option" ADD CONSTRAINT "FK_66c04aee6855c74debae4add8fe" FOREIGN KEY ("address_id") REFERENCES "address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_9f37653694923d2b62c6c01190b" FOREIGN KEY ("vault_id") REFERENCES "vault"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_f809f02abcc22d9ef50c97b42c8" FOREIGN KEY ("curve_id") REFERENCES "curve"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_b5c2c4b2d43680e3c6470d7f9df" FOREIGN KEY ("frax_staking_id") REFERENCES "frax_staking"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) @@ -69,6 +75,11 @@ module.exports = class Data1694734538759 { await db.query(`DROP INDEX "public"."IDX_a5955dbd9ac031314697cbd54f"`) await db.query(`DROP INDEX "public"."IDX_7cd793b6c4bc15b9082e0eb97a"`) await db.query(`DROP INDEX "public"."IDX_02d02f9022ef86e60f1a84b9dc"`) + await db.query(`DROP TABLE "rebase_option"`) + await db.query(`DROP INDEX "public"."IDX_751e6b6352737ddf4f0da0d6d8"`) + await db.query(`DROP INDEX "public"."IDX_e59c9a534fcf23a97a8ac92afa"`) + await db.query(`DROP INDEX "public"."IDX_6b6c08ec25dacd1a5bd6170152"`) + await db.query(`DROP INDEX "public"."IDX_66c04aee6855c74debae4add8f"`) await db.query(`DROP TABLE "vault"`) await db.query(`DROP INDEX "public"."IDX_0f1a5b7e346813a4ec3a03010b"`) await db.query(`DROP INDEX "public"."IDX_a9b314451a9001a7b0a222f68a"`) @@ -100,6 +111,7 @@ module.exports = class Data1694734538759 { await db.query(`DROP INDEX "public"."IDX_7a506ebb6c720f35607810b734"`) await db.query(`ALTER TABLE "history" DROP CONSTRAINT "FK_59a55adcc59ddb69c297da693e5"`) await db.query(`ALTER TABLE "rebase" DROP CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2"`) + await db.query(`ALTER TABLE "rebase_option" DROP CONSTRAINT "FK_66c04aee6855c74debae4add8fe"`) await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_9f37653694923d2b62c6c01190b"`) await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_f809f02abcc22d9ef50c97b42c8"`) await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_b5c2c4b2d43680e3c6470d7f9df"`) diff --git a/package-lock.json b/package-lock.json index 4c800635..0a008566 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,8 @@ "ethers": "^6.5.1", "pg": "^8.11.0", "typeorm": "^0.3.16", - "uuid": "^9.0.0" + "uuid": "^9.0.0", + "viem": "^1.10.13" }, "devDependencies": { "@subsquid/evm-typegen": "^3.2.0", @@ -29,10 +30,14 @@ }, "node_modules/@adraffy/ens-normalize": { "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.9.2.tgz", + "integrity": "sha512-0h+FrQDqe2Wn+IIGFkTCd4aAwTJ+7834Ek1COohCyV26AXhwQ7WQaz+4F/nLOeVl/3BtWHOHLPsq46V8YB46Eg==", "license": "MIT" }, "node_modules/@apollo/protobufjs": { "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.6.tgz", + "integrity": "sha512-Wqo1oSHNUj/jxmsVp4iR3I480p6qdqHikn38lKrFhfzcDJ7lwd7Ck7cHRl4JE81tWNArl77xhnG/OkZhxKBYOw==", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { @@ -57,10 +62,14 @@ }, "node_modules/@apollo/protobufjs/node_modules/@types/node": { "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", "license": "MIT" }, "node_modules/@apollo/usage-reporting-protobuf": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@apollo/usage-reporting-protobuf/-/usage-reporting-protobuf-4.1.1.tgz", + "integrity": "sha512-u40dIUePHaSKVshcedO7Wp+mPiZsaU6xjv9J+VyxpoU/zL6Jle+9zWeG98tr/+SZ0nZ4OXhrbb8SNr0rAPpIDA==", "license": "MIT", "dependencies": { "@apollo/protobufjs": "1.2.7" @@ -68,6 +77,8 @@ }, "node_modules/@apollo/usage-reporting-protobuf/node_modules/@apollo/protobufjs": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.7.tgz", + "integrity": "sha512-Lahx5zntHPZia35myYDBRuF58tlwPskwHc5CWBZC/4bMKB6siTBWwtMrkqXcsNwQiFSzSx5hKdRPUmemrEp3Gg==", "hasInstallScript": true, "license": "BSD-3-Clause", "dependencies": { @@ -91,6 +102,8 @@ }, "node_modules/@apollo/utils.dropunuseddefinitions": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.dropunuseddefinitions/-/utils.dropunuseddefinitions-1.1.0.tgz", + "integrity": "sha512-jU1XjMr6ec9pPoL+BFWzEPW7VHHulVdGKMkPAMiCigpVIT11VmCbnij0bWob8uS3ODJ65tZLYKAh/55vLw2rbg==", "license": "MIT", "engines": { "node": ">=12.13.0" @@ -101,6 +114,8 @@ }, "node_modules/@apollo/utils.keyvadapter": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@apollo/utils.keyvadapter/-/utils.keyvadapter-1.1.2.tgz", + "integrity": "sha512-vPC5e97uwHuZ2iMHVrEeRsV4dLw0lNx2UY9APhb7StC/RMR3BdnuPwS/+5yR9tUF5IUut+iJZocHkS4y6mR9aA==", "license": "MIT", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", @@ -110,6 +125,8 @@ }, "node_modules/@apollo/utils.keyvaluecache": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-1.0.2.tgz", + "integrity": "sha512-p7PVdLPMnPzmXSQVEsy27cYEjVON+SH/Wb7COyW3rQN8+wJgT1nv9jZouYtztWW8ZgTkii5T6tC9qfoDREd4mg==", "license": "MIT", "dependencies": { "@apollo/utils.logger": "^1.0.0", @@ -118,10 +135,14 @@ }, "node_modules/@apollo/utils.logger": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-1.0.1.tgz", + "integrity": "sha512-XdlzoY7fYNK4OIcvMD2G94RoFZbzTQaNP0jozmqqMudmaGo2I/2Jx71xlDJ801mWA/mbYRihyaw6KJii7k5RVA==", "license": "MIT" }, "node_modules/@apollo/utils.printwithreducedwhitespace": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.printwithreducedwhitespace/-/utils.printwithreducedwhitespace-1.1.0.tgz", + "integrity": "sha512-GfFSkAv3n1toDZ4V6u2d7L4xMwLA+lv+6hqXicMN9KELSJ9yy9RzuEXaX73c/Ry+GzRsBy/fdSUGayGqdHfT2Q==", "license": "MIT", "engines": { "node": ">=12.13.0" @@ -132,6 +153,8 @@ }, "node_modules/@apollo/utils.removealiases": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.removealiases/-/utils.removealiases-1.0.0.tgz", + "integrity": "sha512-6cM8sEOJW2LaGjL/0vHV0GtRaSekrPQR4DiywaApQlL9EdROASZU5PsQibe2MWeZCOhNrPRuHh4wDMwPsWTn8A==", "license": "MIT", "engines": { "node": ">=12.13.0" @@ -142,6 +165,8 @@ }, "node_modules/@apollo/utils.sortast": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.sortast/-/utils.sortast-1.1.0.tgz", + "integrity": "sha512-VPlTsmUnOwzPK5yGZENN069y6uUHgeiSlpEhRnLFYwYNoJHsuJq2vXVwIaSmts015WTPa2fpz1inkLYByeuRQA==", "license": "MIT", "dependencies": { "lodash.sortby": "^4.7.0" @@ -155,6 +180,8 @@ }, "node_modules/@apollo/utils.stripsensitiveliterals": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.stripsensitiveliterals/-/utils.stripsensitiveliterals-1.2.0.tgz", + "integrity": "sha512-E41rDUzkz/cdikM5147d8nfCFVKovXxKBcjvLEQ7bjZm/cg9zEcXvS6vFY8ugTubI3fn6zoqo0CyU8zT+BGP9w==", "license": "MIT", "engines": { "node": ">=12.13.0" @@ -165,6 +192,8 @@ }, "node_modules/@apollo/utils.usagereporting": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.usagereporting/-/utils.usagereporting-1.0.1.tgz", + "integrity": "sha512-6dk+0hZlnDbahDBB2mP/PZ5ybrtCJdLMbeNJD+TJpKyZmSY6bA3SjI8Cr2EM9QA+AdziywuWg+SgbWUF3/zQqQ==", "license": "MIT", "dependencies": { "@apollo/usage-reporting-protobuf": "^4.0.0", @@ -183,6 +212,8 @@ }, "node_modules/@apollographql/apollo-tools": { "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.5.4.tgz", + "integrity": "sha512-shM3q7rUbNyXVVRkQJQseXv6bnYM3BUma/eZhwXR4xsuM+bqWnJKvW7SAfRjP7LuSCocrexa5AXhjjawNHrIlw==", "license": "MIT", "engines": { "node": ">=8", @@ -194,6 +225,8 @@ }, "node_modules/@apollographql/graphql-playground-html": { "version": "1.6.29", + "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.29.tgz", + "integrity": "sha512-xCcXpoz52rI4ksJSdOCxeOCn2DLocxwHf9dVT/Q90Pte1LX+LY+91SFtJF3KXVHH8kEin+g1KKCQPKBjZJfWNA==", "license": "MIT", "dependencies": { "xss": "^1.0.8" @@ -201,6 +234,8 @@ }, "node_modules/@babel/code-frame": { "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "license": "MIT", "dependencies": { @@ -213,6 +248,8 @@ }, "node_modules/@babel/generator": { "version": "7.17.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", + "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", "dev": true, "license": "MIT", "dependencies": { @@ -226,6 +263,8 @@ }, "node_modules/@babel/helper-environment-visitor": { "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", + "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", "dev": true, "license": "MIT", "engines": { @@ -234,6 +273,8 @@ }, "node_modules/@babel/helper-function-name": { "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, "license": "MIT", "dependencies": { @@ -246,6 +287,8 @@ }, "node_modules/@babel/helper-hoist-variables": { "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "license": "MIT", "dependencies": { @@ -257,6 +300,8 @@ }, "node_modules/@babel/helper-split-export-declaration": { "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "license": "MIT", "dependencies": { @@ -268,6 +313,8 @@ }, "node_modules/@babel/helper-string-parser": { "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true, "license": "MIT", "engines": { @@ -276,6 +323,8 @@ }, "node_modules/@babel/helper-validator-identifier": { "version": "7.22.19", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.19.tgz", + "integrity": "sha512-Tinq7ybnEPFFXhlYOYFiSjespWQk0dq2dRNAiMdRTOYQzEGqnnNyrTxPYHP5r6wGjlF1rFgABdDV0g8EwD6Qbg==", "dev": true, "license": "MIT", "engines": { @@ -284,6 +333,8 @@ }, "node_modules/@babel/highlight": { "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", + "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", "dev": true, "license": "MIT", "dependencies": { @@ -297,6 +348,8 @@ }, "node_modules/@babel/parser": { "version": "7.22.16", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", + "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", "dev": true, "license": "MIT", "bin": { @@ -308,6 +361,8 @@ }, "node_modules/@babel/runtime": { "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", + "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" @@ -318,6 +373,8 @@ }, "node_modules/@babel/template": { "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "license": "MIT", "dependencies": { @@ -331,6 +388,8 @@ }, "node_modules/@babel/traverse": { "version": "7.17.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", + "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", "dev": true, "license": "MIT", "dependencies": { @@ -351,6 +410,8 @@ }, "node_modules/@babel/traverse/node_modules/@babel/generator": { "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.15.tgz", + "integrity": "sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==", "dev": true, "license": "MIT", "dependencies": { @@ -365,6 +426,8 @@ }, "node_modules/@babel/traverse/node_modules/debug": { "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "license": "MIT", "dependencies": { @@ -381,11 +444,15 @@ }, "node_modules/@babel/traverse/node_modules/ms": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true, "license": "MIT" }, "node_modules/@babel/types": { "version": "7.22.19", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.19.tgz", + "integrity": "sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==", "dev": true, "license": "MIT", "dependencies": { @@ -399,6 +466,8 @@ }, "node_modules/@graphql-tools/merge": { "version": "8.4.2", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.2.tgz", + "integrity": "sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==", "license": "MIT", "dependencies": { "@graphql-tools/utils": "^9.2.1", @@ -410,6 +479,8 @@ }, "node_modules/@graphql-tools/mock": { "version": "8.7.20", + "resolved": "https://registry.npmjs.org/@graphql-tools/mock/-/mock-8.7.20.tgz", + "integrity": "sha512-ljcHSJWjC/ZyzpXd5cfNhPI7YljRVvabKHPzKjEs5ElxWu2cdlLGvyNYepApXDsM/OJG/2xuhGM+9GWu5gEAPQ==", "license": "MIT", "dependencies": { "@graphql-tools/schema": "^9.0.18", @@ -423,6 +494,8 @@ }, "node_modules/@graphql-tools/mock/node_modules/@graphql-tools/schema": { "version": "9.0.19", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.19.tgz", + "integrity": "sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==", "license": "MIT", "dependencies": { "@graphql-tools/merge": "^8.4.1", @@ -436,6 +509,8 @@ }, "node_modules/@graphql-tools/mock/node_modules/value-or-promise": { "version": "1.0.12", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", + "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==", "license": "MIT", "engines": { "node": ">=12" @@ -443,6 +518,8 @@ }, "node_modules/@graphql-tools/schema": { "version": "8.5.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-8.5.1.tgz", + "integrity": "sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg==", "license": "MIT", "dependencies": { "@graphql-tools/merge": "8.3.1", @@ -456,6 +533,8 @@ }, "node_modules/@graphql-tools/schema/node_modules/@graphql-tools/merge": { "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.1.tgz", + "integrity": "sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==", "license": "MIT", "dependencies": { "@graphql-tools/utils": "8.9.0", @@ -467,6 +546,8 @@ }, "node_modules/@graphql-tools/schema/node_modules/@graphql-tools/utils": { "version": "8.9.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.9.0.tgz", + "integrity": "sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==", "license": "MIT", "dependencies": { "tslib": "^2.4.0" @@ -477,6 +558,8 @@ }, "node_modules/@graphql-tools/utils": { "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz", + "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==", "license": "MIT", "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", @@ -488,6 +571,8 @@ }, "node_modules/@graphql-typed-document-node/core": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", "license": "MIT", "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" @@ -495,14 +580,20 @@ }, "node_modules/@ioredis/commands": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.2.0.tgz", + "integrity": "sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==", "license": "MIT" }, "node_modules/@josephg/resolvable": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@josephg/resolvable/-/resolvable-1.0.1.tgz", + "integrity": "sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg==", "license": "ISC" }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "license": "MIT", "dependencies": { @@ -516,6 +607,8 @@ }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", "dev": true, "license": "MIT", "engines": { @@ -524,6 +617,8 @@ }, "node_modules/@jridgewell/set-array": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true, "license": "MIT", "engines": { @@ -532,11 +627,15 @@ }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true, "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, "license": "MIT", "dependencies": { @@ -546,6 +645,8 @@ }, "node_modules/@keyv/redis": { "version": "2.5.8", + "resolved": "https://registry.npmjs.org/@keyv/redis/-/redis-2.5.8.tgz", + "integrity": "sha512-WweuUZqZN2ETcseV6r1AEum1qG6eR5poNhkZ4CIpWBOjMasT2ArTKWyIPxxYllKUS2A8wKv1l8+AqH6Jpzk7Ug==", "license": "MIT", "dependencies": { "ioredis": "^5.3.2" @@ -554,8 +655,32 @@ "node": ">= 12" } }, + "node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/curves/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@noble/hashes": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.2.tgz", + "integrity": "sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==", "funding": [ { "type": "individual", @@ -566,6 +691,8 @@ }, "node_modules/@noble/secp256k1": { "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", + "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", "funding": [ { "type": "individual", @@ -576,22 +703,32 @@ }, "node_modules/@protobufjs/aspromise": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/base64": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/codegen": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/eventemitter": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/fetch": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", "license": "BSD-3-Clause", "dependencies": { "@protobufjs/aspromise": "^1.1.1", @@ -600,30 +737,99 @@ }, "node_modules/@protobufjs/float": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/inquire": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/path": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/pool": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==", "license": "BSD-3-Clause" }, "node_modules/@protobufjs/utf8": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==", "license": "BSD-3-Clause" }, + "node_modules/@scure/base": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.3.tgz", + "integrity": "sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.2.tgz", + "integrity": "sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==", + "dependencies": { + "@noble/curves": "~1.2.0", + "@noble/hashes": "~1.3.2", + "@scure/base": "~1.1.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", + "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", + "dependencies": { + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip39/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@sqltools/formatter": { "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", + "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==", "license": "MIT" }, "node_modules/@subsquid/archive-registry": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@subsquid/archive-registry/-/archive-registry-3.2.0.tgz", + "integrity": "sha512-qEzFODDVwEx+3cdmk4LPAKoLzjcBcqvhhLovEWOUKxN+S9SZaOWYHf7yq1pi48X6nUSVLmK7rofBx+pS4hIU7Q==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/util-internal": "^1.0.0", @@ -637,10 +843,14 @@ }, "node_modules/@subsquid/archive-registry/node_modules/@subsquid/util-internal": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-1.1.0.tgz", + "integrity": "sha512-O6m666RDcWEw4vb3bmeNZKlAa1rGOHQvS0nhZFTBXnxZpqK/pU5N0jrQ7X/3is0pY2RKxFoxTurZjhv4QdxtqA==", "license": "GPL-3.0-or-later" }, "node_modules/@subsquid/archive-registry/node_modules/commander": { "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "license": "MIT", "engines": { "node": ">=14" @@ -648,6 +858,8 @@ }, "node_modules/@subsquid/evm-processor": { "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@subsquid/evm-processor/-/evm-processor-1.8.2.tgz", + "integrity": "sha512-JMVSx/ZHooidVFb7PPR5hjesGItf31Lf9TDJaP8GixoXJd+YoRQbZZXe0kJvcewtHjzGqMK07j6gbJPiJcXzpg==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/http-client": "^1.3.0", @@ -661,6 +873,8 @@ }, "node_modules/@subsquid/evm-typegen": { "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@subsquid/evm-typegen/-/evm-typegen-3.2.2.tgz", + "integrity": "sha512-DzjzUwjJNJM74skZCuYPMKYhvDg2KLRdt1ooiOpgH91zEmcS8wx70dtdOtQxDIDm1Bbt/pfS3Yntq7CjbeI2/g==", "dev": true, "license": "GPL-3.0-or-later", "dependencies": { @@ -679,10 +893,14 @@ } }, "node_modules/@subsquid/graphiql-console": { - "version": "0.3.0" + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@subsquid/graphiql-console/-/graphiql-console-0.3.0.tgz", + "integrity": "sha512-C89mus6IXnNi0xMQrZqUFBZwLj8tbuq9lye8Gq/lHmmERAUpi6UsWEyLdJLx2mneZzF3JtY8eNiiZ16jmjtvfw==" }, "node_modules/@subsquid/graphql-server": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@subsquid/graphql-server/-/graphql-server-4.3.0.tgz", + "integrity": "sha512-Ws2uHJyhgNgo3uJZQ4XYKAPvnOGJ3wXq/XhcX/b3z2OeiCv89daB+V6Lzf6nBsVBg9D2Ev0vNWIVRKJQbEn+mA==", "license": "GPL-3.0-or-later", "dependencies": { "@apollo/utils.keyvadapter": "~1.1.2", @@ -735,6 +953,8 @@ }, "node_modules/@subsquid/graphql-server/node_modules/@graphql-tools/utils": { "version": "8.13.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.13.1.tgz", + "integrity": "sha512-qIh9yYpdUFmctVqovwMdheVNJqFh+DQNWIhX87FJStfXYnmweBUDATok9fWPleKeFwxnW8IapKmY8m8toJEkAw==", "license": "MIT", "dependencies": { "tslib": "^2.4.0" @@ -745,6 +965,8 @@ }, "node_modules/@subsquid/http-client": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@subsquid/http-client/-/http-client-1.3.0.tgz", + "integrity": "sha512-GV31imnZf1dYsbZmuXyIMtdSYtVSm06m05T0fjl+ilnOQRvafAx1rMmKVy9INksZwssVQZ/9EHC+Wy8DPw8Oeg==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/logger": "^1.3.0", @@ -754,6 +976,8 @@ }, "node_modules/@subsquid/http-client/node_modules/node-fetch": { "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", "license": "MIT", "dependencies": { "data-uri-to-buffer": "^4.0.0", @@ -770,6 +994,8 @@ }, "node_modules/@subsquid/logger": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@subsquid/logger/-/logger-1.3.0.tgz", + "integrity": "sha512-1aCaFzGXrzW4bioiv6hPX+vsKO2EsiqFKcWedRW9G+0nnelAfhw5lGsyCvMzfkuk2xUCRA6vWwOReVK3BPW0Zg==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/util-internal-hex": "^1.2.0", @@ -779,6 +1005,8 @@ }, "node_modules/@subsquid/openreader": { "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@subsquid/openreader/-/openreader-4.4.0.tgz", + "integrity": "sha512-MiHu+PQH4frnF8RPd4F1WwdPzaaA3trBM1VuzN5cTEPPt8vBF4A1BIL78Qq1HH/HH+yLriNjmA7/IVaAFjsfgw==", "license": "GPL-3.0-or-later", "dependencies": { "@graphql-tools/merge": "^8", @@ -814,6 +1042,8 @@ }, "node_modules/@subsquid/rpc-client": { "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@subsquid/rpc-client/-/rpc-client-4.4.1.tgz", + "integrity": "sha512-ZnqmJUDdj4OsZZLVHAqXhPF4vijut54PwNdLg8MlfCU4gX99oYwB/wvtulVuJckNLiXDQ3ka+CDLe/MWV2svIA==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/http-client": "^1.2.1", @@ -826,10 +1056,14 @@ }, "node_modules/@subsquid/rpc-client/node_modules/@subsquid/util-internal-counters": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-counters/-/util-internal-counters-1.3.0.tgz", + "integrity": "sha512-/Eeu9d3gW50nFSp49PDYrioIJdczR+wPlXBCe8EIMTUFEySIhhxFPB7y4JqL2pnUrK2UqAgyKoTx0diqP6fdxA==", "license": "GPL-3.0-or-later" }, "node_modules/@subsquid/typeorm-codegen": { "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-codegen/-/typeorm-codegen-1.3.1.tgz", + "integrity": "sha512-hHMbJvYZ9wJFnsK+NgOAC9jv1bawsss1eCrUBI3NMoCJ9xeEZOdx13eQAI+8OAPXedqCx4v0PLFZZOlAKc1/7w==", "dev": true, "license": "GPL-3.0-or-later", "dependencies": { @@ -845,6 +1079,8 @@ }, "node_modules/@subsquid/typeorm-config": { "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-config/-/typeorm-config-3.3.0.tgz", + "integrity": "sha512-DJXoAQnVooEdEU3vxL33I5WRJRRPy9t+15rP17kGMkXGLuPAc0hpelJGSO5Ze9csn/IytwrZUWG6y2I2Q81nyQ==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/util-naming": "^1.2.0" @@ -860,6 +1096,8 @@ }, "node_modules/@subsquid/typeorm-migration": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-migration/-/typeorm-migration-1.2.1.tgz", + "integrity": "sha512-aMo4hmqzwmFHLrdu1PXm3bGiRSodyjgmnETmnYiI11g+FbVWwTuJ3P1jBY9hrRFEr6iGb2+pYVRMme75XoNzTw==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/typeorm-config": "^3.2.0", @@ -881,6 +1119,8 @@ }, "node_modules/@subsquid/typeorm-store": { "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@subsquid/typeorm-store/-/typeorm-store-1.2.2.tgz", + "integrity": "sha512-pp2PvmK51KzpWlGQxDzqoxNnAr5vcMYlA0NLRUM3xHnqlkxwgIrJLRqwmAOYlOiQp0YHqqdFbjtraJXjftCiHA==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/typeorm-config": "^3.3.0", @@ -892,10 +1132,14 @@ }, "node_modules/@subsquid/util-internal": { "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal/-/util-internal-2.5.1.tgz", + "integrity": "sha512-URBBCWP/cXuNhFP8B5Qsm6qaft1CIoWRhx8mCL1gDxasLWmPEnLC2eMHfMvU0CtF9mYKyXV2SjCf4BK9tQJ92g==", "license": "GPL-3.0-or-later" }, "node_modules/@subsquid/util-internal-archive-client": { "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-archive-client/-/util-internal-archive-client-0.0.0.tgz", + "integrity": "sha512-tsVxjiFSq3SZUP2RQOTF6ca1ZeKhlpcIb0kb+KPbUaOv13H2YNo9vjG1RpW+f4/Sr7ARo7EOkIOgQb9t+u/2VQ==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/http-client": "^1.3.0", @@ -913,14 +1157,20 @@ }, "node_modules/@subsquid/util-internal-binary-heap": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-binary-heap/-/util-internal-binary-heap-1.0.0.tgz", + "integrity": "sha512-88auuc8yNFmCZugmJSTYzS7WM/nN2obKGQCgrl8Jty5rJUFbqazGSi8icqftKhv6MPtUMJ3PSTRLiTFXAUGnAA==", "license": "GPL-3.0-or-later" }, "node_modules/@subsquid/util-internal-code-printer": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-code-printer/-/util-internal-code-printer-1.2.0.tgz", + "integrity": "sha512-UZgNiYs5C/aSBYXXi9LgWyjJ2Uy/0uYowNq8Hx4OhraJq8OoqS5Ef0K/RMf7+4tpgvuArocJUcpvtRCKWewvbA==", "license": "GPL-3.0-or-later" }, "node_modules/@subsquid/util-internal-commander": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-commander/-/util-internal-commander-1.3.0.tgz", + "integrity": "sha512-ZSPzYjNZ/k/6qDa7xdrCgXkq/whYnVPLF8nX+35aAgrM+ShX7XUg/Dq6u0rW3u3sfWcKzsNFHbFB8SzjWN5StA==", "license": "GPL-3.0-or-later", "peerDependencies": { "commander": "^11.0.0" @@ -933,6 +1183,8 @@ }, "node_modules/@subsquid/util-internal-http-server": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-http-server/-/util-internal-http-server-1.2.0.tgz", + "integrity": "sha512-eaOreTdStkB405Lg07CNmoi7BmUVYyHLsNiMcvH+CUyiqI4dwkGd5JwXJek+GbEvaixiKF3t7Km/SX8bH2BJEA==", "license": "GPL-3.0-or-later", "dependencies": { "stoppable": "^1.1.0" @@ -948,6 +1200,8 @@ }, "node_modules/@subsquid/util-internal-processor-tools": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-processor-tools/-/util-internal-processor-tools-2.0.0.tgz", + "integrity": "sha512-QEeCoXZ9/OvLKytVW9tGTxOb2h1NxW4o9UFteWEEMhsDh11cHQ2TVn+kynQ5OPLIq1cXZZD0NmYGN1pRD11y/Q==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/logger": "^1.3.0", @@ -960,10 +1214,14 @@ }, "node_modules/@subsquid/util-internal-processor-tools/node_modules/@subsquid/util-internal-counters": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-counters/-/util-internal-counters-1.3.0.tgz", + "integrity": "sha512-/Eeu9d3gW50nFSp49PDYrioIJdczR+wPlXBCe8EIMTUFEySIhhxFPB7y4JqL2pnUrK2UqAgyKoTx0diqP6fdxA==", "license": "GPL-3.0-or-later" }, "node_modules/@subsquid/util-internal-processor-tools/node_modules/@subsquid/util-internal-prometheus-server": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-prometheus-server/-/util-internal-prometheus-server-1.2.0.tgz", + "integrity": "sha512-VvYAg1qUK3aDmPNMNsjjXFgSt8iOZ4B6A+QTLAdkZO9r+aOU5rSAe6r03BpxKSwgBqGH40RNhi8pn2w5zShQ0g==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/util-internal-http-server": "^1.2.0" @@ -974,6 +1232,8 @@ }, "node_modules/@subsquid/util-internal-range": { "version": "0.0.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-internal-range/-/util-internal-range-0.0.0.tgz", + "integrity": "sha512-faj70/0jk/of0VFIbrVUlzRPEGNWZTApwetBF0EP1UfW09349Q5LowqCtbuC0TYHQtnm7Qvz5rBG5K0bFGI8Lw==", "license": "GPL-3.0-or-later", "dependencies": { "@subsquid/util-internal": "^2.4.0", @@ -982,6 +1242,8 @@ }, "node_modules/@subsquid/util-naming": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@subsquid/util-naming/-/util-naming-1.2.0.tgz", + "integrity": "sha512-mFFFh3CLd4IOm5OIl0tyhGvL6s+LQqtGgq8mD4oCZuzC2IhRNJ7D1KAv8JTZsxzOhHfLeibF2xvdN5jBwSLEyg==", "license": "GPL-3.0-or-later", "dependencies": { "camelcase": "^6.3.0", @@ -990,6 +1252,8 @@ }, "node_modules/@trivago/prettier-plugin-sort-imports": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.2.0.tgz", + "integrity": "sha512-YBepjbt+ZNBVmN3ev1amQH3lWCmHyt5qTbLCp/syXJRu/Kw2koXh44qayB1gMRxcL/gV8egmjN5xWSrYyfUtyw==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -1012,6 +1276,8 @@ }, "node_modules/@trivago/prettier-plugin-sort-imports/node_modules/@babel/types": { "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", "dev": true, "license": "MIT", "dependencies": { @@ -1024,6 +1290,8 @@ }, "node_modules/@types/accepts": { "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==", "license": "MIT", "dependencies": { "@types/node": "*" @@ -1031,10 +1299,14 @@ }, "node_modules/@types/accepts/node_modules/@types/node": { "version": "20.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz", + "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==", "license": "MIT" }, "node_modules/@types/body-parser": { "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", "license": "MIT", "dependencies": { "@types/connect": "*", @@ -1043,10 +1315,14 @@ }, "node_modules/@types/body-parser/node_modules/@types/node": { "version": "20.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz", + "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==", "license": "MIT" }, "node_modules/@types/connect": { "version": "3.4.36", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", + "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", "license": "MIT", "dependencies": { "@types/node": "*" @@ -1054,14 +1330,20 @@ }, "node_modules/@types/connect/node_modules/@types/node": { "version": "20.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz", + "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==", "license": "MIT" }, "node_modules/@types/cors": { "version": "2.8.12", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", + "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", "license": "MIT" }, "node_modules/@types/express": { "version": "4.17.14", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", + "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", "license": "MIT", "dependencies": { "@types/body-parser": "*", @@ -1072,6 +1354,8 @@ }, "node_modules/@types/express-serve-static-core": { "version": "4.17.31", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", + "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", "license": "MIT", "dependencies": { "@types/node": "*", @@ -1081,10 +1365,14 @@ }, "node_modules/@types/express-serve-static-core/node_modules/@types/node": { "version": "20.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz", + "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==", "license": "MIT" }, "node_modules/@types/express/node_modules/@types/express-serve-static-core": { "version": "4.17.36", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.36.tgz", + "integrity": "sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==", "license": "MIT", "dependencies": { "@types/node": "*", @@ -1095,35 +1383,50 @@ }, "node_modules/@types/express/node_modules/@types/node": { "version": "20.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz", + "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==", "license": "MIT" }, "node_modules/@types/http-errors": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-/K3ds8TRAfBvi5vfjuz8y6+GiAYBZ0x4tXv1Av6CWBWn0IlADc+ZX9pMq7oU0fNQPnBwIZl3rmeLp6SBApbxSQ==", "license": "MIT" }, "node_modules/@types/long": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==", "license": "MIT" }, "node_modules/@types/mime": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-3.0.1.tgz", + "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==", "license": "MIT" }, "node_modules/@types/node": { "version": "18.17.15", - "dev": true, + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.15.tgz", + "integrity": "sha512-2yrWpBk32tvV/JAd3HNHWuZn/VDN1P+72hWirHnvsvTGSqbANi+kSeuQR9yAHnbvaBvHDsoTdXV0Fe+iRtHLKA==", "license": "MIT" }, "node_modules/@types/qs": { "version": "6.9.8", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.8.tgz", + "integrity": "sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg==", "license": "MIT" }, "node_modules/@types/range-parser": { "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", + "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", "license": "MIT" }, "node_modules/@types/send": { "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.1.tgz", + "integrity": "sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==", "license": "MIT", "dependencies": { "@types/mime": "^1", @@ -1132,14 +1435,20 @@ }, "node_modules/@types/send/node_modules/@types/mime": { "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", + "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", "license": "MIT" }, "node_modules/@types/send/node_modules/@types/node": { "version": "20.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz", + "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==", "license": "MIT" }, "node_modules/@types/serve-static": { "version": "1.15.2", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.2.tgz", + "integrity": "sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==", "license": "MIT", "dependencies": { "@types/http-errors": "*", @@ -1149,15 +1458,52 @@ }, "node_modules/@types/serve-static/node_modules/@types/node": { "version": "20.6.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz", + "integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg==", "license": "MIT" }, "node_modules/@types/uuid": { "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.4.tgz", + "integrity": "sha512-zAuJWQflfx6dYJM62vna+Sn5aeSWhh3OB+wfUEACNcqUSc0AGc5JKl+ycL1vrH7frGTXhJchYjE1Hak8L819dA==", "dev": true, "license": "MIT" }, + "node_modules/@types/ws": { + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", + "integrity": "sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/abitype": { + "version": "0.9.8", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-0.9.8.tgz", + "integrity": "sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wagmi-dev" + } + ], + "peerDependencies": { + "typescript": ">=5.0.4", + "zod": "^3 >=3.19.1" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + }, + "zod": { + "optional": true + } + } + }, "node_modules/accepts": { "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "license": "MIT", "dependencies": { "mime-types": "~2.1.34", @@ -1169,10 +1515,14 @@ }, "node_modules/aes-js": { "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", "license": "MIT" }, "node_modules/ansi-regex": { "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "license": "MIT", "engines": { "node": ">=8" @@ -1180,6 +1530,8 @@ }, "node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -1193,10 +1545,14 @@ }, "node_modules/any-promise": { "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", "license": "MIT" }, "node_modules/apollo-datasource": { "version": "3.3.2", + "resolved": "https://registry.npmjs.org/apollo-datasource/-/apollo-datasource-3.3.2.tgz", + "integrity": "sha512-L5TiS8E2Hn/Yz7SSnWIVbZw0ZfEIXZCa5VUiVxD9P53JvSrf4aStvsFDlGWPvpIdCR+aly2CfoB79B9/JjKFqg==", "license": "MIT", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", @@ -1208,6 +1564,8 @@ }, "node_modules/apollo-reporting-protobuf": { "version": "3.4.0", + "resolved": "https://registry.npmjs.org/apollo-reporting-protobuf/-/apollo-reporting-protobuf-3.4.0.tgz", + "integrity": "sha512-h0u3EbC/9RpihWOmcSsvTW2O6RXVaD/mPEjfrPkxRPTEPWqncsgOoRJw+wih4OqfH3PvTJvoEIf4LwKrUaqWog==", "license": "MIT", "dependencies": { "@apollo/protobufjs": "1.2.6" @@ -1215,6 +1573,8 @@ }, "node_modules/apollo-server-core": { "version": "3.12.1", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.12.1.tgz", + "integrity": "sha512-9SF5WAkkV0FZQ2HVUWI9Jada1U0jg7e8NCN9EklbtvaCeUlOLyXyM+KCWuZ7+dqHxjshbtcwylPHutt3uzoNkw==", "license": "MIT", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", @@ -1250,6 +1610,8 @@ }, "node_modules/apollo-server-core/node_modules/lru-cache": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -1260,6 +1622,8 @@ }, "node_modules/apollo-server-env": { "version": "4.2.1", + "resolved": "https://registry.npmjs.org/apollo-server-env/-/apollo-server-env-4.2.1.tgz", + "integrity": "sha512-vm/7c7ld+zFMxibzqZ7SSa5tBENc4B0uye9LTfjJwGoQFY5xsUPH5FpO5j0bMUDZ8YYNbrF9SNtzc5Cngcr90g==", "license": "MIT", "dependencies": { "node-fetch": "^2.6.7" @@ -1270,6 +1634,8 @@ }, "node_modules/apollo-server-errors": { "version": "3.3.1", + "resolved": "https://registry.npmjs.org/apollo-server-errors/-/apollo-server-errors-3.3.1.tgz", + "integrity": "sha512-xnZJ5QWs6FixHICXHxUfm+ZWqqxrNuPlQ+kj5m6RtEgIpekOPssH/SD9gf2B4HuWV0QozorrygwZnux8POvyPA==", "license": "MIT", "engines": { "node": ">=12.0" @@ -1280,6 +1646,8 @@ }, "node_modules/apollo-server-express": { "version": "3.12.1", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.12.1.tgz", + "integrity": "sha512-5A9efrhEXqDx08BnORWf0zPYCABENqur47VZZW8osQpSSnMINqzJiV5RMrzz8wIznecRRhEcz+BqLdiexqZdgg==", "license": "MIT", "dependencies": { "@types/accepts": "^1.3.5", @@ -1304,6 +1672,8 @@ }, "node_modules/apollo-server-express/node_modules/body-parser": { "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -1326,6 +1696,8 @@ }, "node_modules/apollo-server-express/node_modules/raw-body": { "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -1339,6 +1711,8 @@ }, "node_modules/apollo-server-plugin-base": { "version": "3.7.2", + "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-3.7.2.tgz", + "integrity": "sha512-wE8dwGDvBOGehSsPTRZ8P/33Jan6/PmL0y0aN/1Z5a5GcbFhDaaJCjK5cav6npbbGL2DPKK0r6MPXi3k3N45aw==", "license": "MIT", "dependencies": { "apollo-server-types": "^3.8.0" @@ -1352,6 +1726,8 @@ }, "node_modules/apollo-server-plugin-response-cache": { "version": "3.7.1", + "resolved": "https://registry.npmjs.org/apollo-server-plugin-response-cache/-/apollo-server-plugin-response-cache-3.7.1.tgz", + "integrity": "sha512-3FHwwySf1kQl8dGC+2E08LtDeFGUOeqckLchAD1REYx1vwMZbGhmEIwaNezjXwxkTM5Y7l38n0vQTka6YoQN7w==", "license": "MIT", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", @@ -1367,6 +1743,8 @@ }, "node_modules/apollo-server-types": { "version": "3.8.0", + "resolved": "https://registry.npmjs.org/apollo-server-types/-/apollo-server-types-3.8.0.tgz", + "integrity": "sha512-ZI/8rTE4ww8BHktsVpb91Sdq7Cb71rdSkXELSwdSR0eXu600/sY+1UXhTWdiJvk+Eq5ljqoHLwLbY2+Clq2b9A==", "license": "MIT", "dependencies": { "@apollo/utils.keyvaluecache": "^1.0.1", @@ -1383,6 +1761,8 @@ }, "node_modules/app-root-path": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", + "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", "license": "MIT", "engines": { "node": ">= 6.0.0" @@ -1390,6 +1770,8 @@ }, "node_modules/array-buffer-byte-length": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -1401,10 +1783,14 @@ }, "node_modules/array-flatten": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", "license": "MIT" }, "node_modules/async-retry": { "version": "1.3.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", + "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", "license": "MIT", "dependencies": { "retry": "0.13.1" @@ -1412,6 +1798,8 @@ }, "node_modules/available-typed-arrays": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -1422,10 +1810,14 @@ }, "node_modules/balanced-match": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "license": "MIT" }, "node_modules/base64-js": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "funding": [ { "type": "github", @@ -1444,10 +1836,14 @@ }, "node_modules/bintrees": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bintrees/-/bintrees-1.0.2.tgz", + "integrity": "sha512-VOMgTMwjAaUG580SXn3LacVgjurrbMme7ZZNYGSSV7mmtY6QQRh0Eg3pwIcntQ77DErK1L0NxkbetjcoXzVwKw==", "license": "MIT" }, "node_modules/body-parser": { "version": "1.20.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", + "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -1470,6 +1866,8 @@ }, "node_modules/brace-expansion": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -1477,6 +1875,8 @@ }, "node_modules/buffer": { "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "funding": [ { "type": "github", @@ -1499,6 +1899,8 @@ }, "node_modules/buffer-writer": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", + "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", "license": "MIT", "engines": { "node": ">=4" @@ -1506,6 +1908,8 @@ }, "node_modules/bufferutil": { "version": "4.0.7", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.7.tgz", + "integrity": "sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -1517,6 +1921,8 @@ }, "node_modules/bytes": { "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -1524,6 +1930,8 @@ }, "node_modules/call-bind": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", "license": "MIT", "dependencies": { "function-bind": "^1.1.1", @@ -1535,6 +1943,8 @@ }, "node_modules/camelcase": { "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "license": "MIT", "engines": { "node": ">=10" @@ -1545,6 +1955,8 @@ }, "node_modules/chalk": { "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1558,6 +1970,8 @@ }, "node_modules/chalk/node_modules/ansi-styles": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "license": "MIT", "dependencies": { @@ -1569,6 +1983,8 @@ }, "node_modules/chalk/node_modules/color-convert": { "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "license": "MIT", "dependencies": { @@ -1577,11 +1993,15 @@ }, "node_modules/chalk/node_modules/color-name": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true, "license": "MIT" }, "node_modules/chalk/node_modules/has-flag": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "license": "MIT", "engines": { @@ -1590,6 +2010,8 @@ }, "node_modules/chalk/node_modules/supports-color": { "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "license": "MIT", "dependencies": { @@ -1601,6 +2023,8 @@ }, "node_modules/cli-highlight": { "version": "2.1.11", + "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", + "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", "license": "ISC", "dependencies": { "chalk": "^4.0.0", @@ -1620,6 +2044,8 @@ }, "node_modules/cli-highlight/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -1634,6 +2060,8 @@ }, "node_modules/cli-highlight/node_modules/cliui": { "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", "license": "ISC", "dependencies": { "string-width": "^4.2.0", @@ -1643,6 +2071,8 @@ }, "node_modules/cli-highlight/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -1653,6 +2083,8 @@ }, "node_modules/cli-highlight/node_modules/yargs": { "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "license": "MIT", "dependencies": { "cliui": "^7.0.2", @@ -1669,6 +2101,8 @@ }, "node_modules/cli-highlight/node_modules/yargs-parser": { "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", "license": "ISC", "engines": { "node": ">=10" @@ -1676,6 +2110,8 @@ }, "node_modules/cliui": { "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "license": "ISC", "dependencies": { "string-width": "^4.2.0", @@ -1688,6 +2124,8 @@ }, "node_modules/clone": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", "license": "MIT", "optional": true, "engines": { @@ -1696,6 +2134,8 @@ }, "node_modules/cluster-key-slot": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", "license": "Apache-2.0", "engines": { "node": ">=0.10.0" @@ -1703,6 +2143,8 @@ }, "node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -1713,10 +2155,14 @@ }, "node_modules/color-name": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "license": "MIT" }, "node_modules/commander": { "version": "11.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.0.0.tgz", + "integrity": "sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==", "license": "MIT", "engines": { "node": ">=16" @@ -1724,6 +2170,8 @@ }, "node_modules/content-disposition": { "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "license": "MIT", "dependencies": { "safe-buffer": "5.2.1" @@ -1734,6 +2182,8 @@ }, "node_modules/content-type": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -1741,6 +2191,8 @@ }, "node_modules/cookie": { "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", + "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -1748,10 +2200,14 @@ }, "node_modules/cookie-signature": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", "license": "MIT" }, "node_modules/cors": { "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "license": "MIT", "dependencies": { "object-assign": "^4", @@ -1763,10 +2219,14 @@ }, "node_modules/cssfilter": { "version": "0.0.10", + "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==", "license": "MIT" }, "node_modules/d": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", "license": "ISC", "dependencies": { "es5-ext": "^0.10.50", @@ -1775,6 +2235,8 @@ }, "node_modules/data-uri-to-buffer": { "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", "license": "MIT", "engines": { "node": ">= 12" @@ -1782,10 +2244,14 @@ }, "node_modules/dataloader": { "version": "2.2.2", + "resolved": "https://registry.npmjs.org/dataloader/-/dataloader-2.2.2.tgz", + "integrity": "sha512-8YnDaaf7N3k/q5HnTJVuzSyLETjoZjVmHc4AeKAzOvKHEFQKcn64OKBfzHYtE9zGjctNM7V9I0MfnUVLpi7M5g==", "license": "MIT" }, "node_modules/date-fns": { "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.21.0" @@ -1800,6 +2266,8 @@ }, "node_modules/debug": { "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "license": "MIT", "dependencies": { "ms": "2.0.0" @@ -1807,6 +2275,8 @@ }, "node_modules/deep-equal": { "version": "2.2.2", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.2.tgz", + "integrity": "sha512-xjVyBf0w5vH0I42jdAZzOKVldmPgSulmiyPRywoyq7HXC9qdgo17kxJE+rdnif5Tz6+pIrpJI8dCpMNLIGkUiA==", "license": "MIT", "dependencies": { "array-buffer-byte-length": "^1.0.0", @@ -1834,6 +2304,8 @@ }, "node_modules/defaults": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", "license": "MIT", "optional": true, "dependencies": { @@ -1845,6 +2317,8 @@ }, "node_modules/define-data-property": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", + "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.1", @@ -1857,6 +2331,8 @@ }, "node_modules/define-properties": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", @@ -1872,6 +2348,8 @@ }, "node_modules/denque": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", + "integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", "license": "Apache-2.0", "engines": { "node": ">=0.10" @@ -1879,6 +2357,8 @@ }, "node_modules/depd": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -1886,6 +2366,8 @@ }, "node_modules/destroy": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "license": "MIT", "engines": { "node": ">= 0.8", @@ -1894,6 +2376,8 @@ }, "node_modules/dotenv": { "version": "16.3.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", + "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==", "license": "BSD-2-Clause", "engines": { "node": ">=12" @@ -1904,6 +2388,8 @@ }, "node_modules/easy-table": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.2.0.tgz", + "integrity": "sha512-OFzVOv03YpvtcWGe5AayU5G2hgybsg3iqA6drU8UaoZyB9jLGMTrz9+asnLp/E+6qPh88yEI1gvyZFZ41dmgww==", "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -1914,14 +2400,20 @@ }, "node_modules/ee-first": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "license": "MIT" }, "node_modules/emoji-regex": { "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, "node_modules/encodeurl": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -1929,6 +2421,8 @@ }, "node_modules/es-get-iterator": { "version": "1.1.3", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", + "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -1947,6 +2441,8 @@ }, "node_modules/es5-ext": { "version": "0.10.62", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz", + "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==", "hasInstallScript": true, "license": "ISC", "dependencies": { @@ -1960,6 +2456,8 @@ }, "node_modules/es6-iterator": { "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", "license": "MIT", "dependencies": { "d": "1", @@ -1969,6 +2467,8 @@ }, "node_modules/es6-symbol": { "version": "3.1.3", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", + "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", "license": "ISC", "dependencies": { "d": "^1.0.1", @@ -1977,6 +2477,8 @@ }, "node_modules/escalade": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", "license": "MIT", "engines": { "node": ">=6" @@ -1984,10 +2486,14 @@ }, "node_modules/escape-html": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "license": "MIT" }, "node_modules/escape-string-regexp": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "license": "MIT", "engines": { @@ -1996,6 +2502,8 @@ }, "node_modules/etag": { "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2003,6 +2511,8 @@ }, "node_modules/ethers": { "version": "6.7.1", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.7.1.tgz", + "integrity": "sha512-qX5kxIFMfg1i+epfgb0xF4WM7IqapIIu50pOJ17aebkxxa4BacW5jFrQRmCJpDEg2ZK2oNtR5QjrQ1WDBF29dA==", "funding": [ { "type": "individual", @@ -2029,14 +2539,20 @@ }, "node_modules/ethers/node_modules/@types/node": { "version": "18.15.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==", "license": "MIT" }, "node_modules/ethers/node_modules/tslib": { "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "license": "0BSD" }, "node_modules/ethers/node_modules/ws": { "version": "8.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", "license": "MIT", "engines": { "node": ">=10.0.0" @@ -2056,6 +2572,8 @@ }, "node_modules/express": { "version": "4.18.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", + "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", "license": "MIT", "dependencies": { "accepts": "~1.3.8", @@ -2096,6 +2614,8 @@ }, "node_modules/ext": { "version": "1.7.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", + "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", "license": "ISC", "dependencies": { "type": "^2.7.2" @@ -2103,14 +2623,20 @@ }, "node_modules/ext/node_modules/type": { "version": "2.7.2", + "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", + "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==", "license": "ISC" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "license": "MIT" }, "node_modules/fetch-blob": { "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", "funding": [ { "type": "github", @@ -2132,6 +2658,8 @@ }, "node_modules/finalhandler": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "license": "MIT", "dependencies": { "debug": "2.6.9", @@ -2148,6 +2676,8 @@ }, "node_modules/for-each": { "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "license": "MIT", "dependencies": { "is-callable": "^1.1.3" @@ -2155,6 +2685,8 @@ }, "node_modules/formdata-polyfill": { "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", "license": "MIT", "dependencies": { "fetch-blob": "^3.1.2" @@ -2165,6 +2697,8 @@ }, "node_modules/forwarded": { "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2172,6 +2706,8 @@ }, "node_modules/fresh": { "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2179,14 +2715,20 @@ }, "node_modules/fs.realpath": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, "node_modules/function-bind": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "license": "MIT" }, "node_modules/functions-have-names": { "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2194,6 +2736,8 @@ }, "node_modules/get-caller-file": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" @@ -2201,6 +2745,8 @@ }, "node_modules/get-intrinsic": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", + "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", "license": "MIT", "dependencies": { "function-bind": "^1.1.1", @@ -2214,6 +2760,8 @@ }, "node_modules/glob": { "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -2231,6 +2779,8 @@ }, "node_modules/globals": { "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true, "license": "MIT", "engines": { @@ -2239,6 +2789,8 @@ }, "node_modules/gopd": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.3" @@ -2249,6 +2801,8 @@ }, "node_modules/graphql": { "version": "15.8.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", + "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==", "license": "MIT", "engines": { "node": ">= 10.x" @@ -2256,6 +2810,8 @@ }, "node_modules/graphql-parse-resolve-info": { "version": "4.13.0", + "resolved": "https://registry.npmjs.org/graphql-parse-resolve-info/-/graphql-parse-resolve-info-4.13.0.tgz", + "integrity": "sha512-VVJ1DdHYcR7hwOGQKNH+QTzuNgsLA8l/y436HtP9YHoX6nmwXRWq3xWthU3autMysXdm0fQUbhTZCx0W9ICozw==", "license": "MIT", "dependencies": { "debug": "^4.1.1", @@ -2270,6 +2826,8 @@ }, "node_modules/graphql-parse-resolve-info/node_modules/debug": { "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "license": "MIT", "dependencies": { "ms": "2.1.2" @@ -2285,10 +2843,14 @@ }, "node_modules/graphql-parse-resolve-info/node_modules/ms": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "license": "MIT" }, "node_modules/graphql-tag": { "version": "2.12.6", + "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz", + "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==", "license": "MIT", "dependencies": { "tslib": "^2.1.0" @@ -2302,6 +2864,8 @@ }, "node_modules/graphql-ws": { "version": "5.14.0", + "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.14.0.tgz", + "integrity": "sha512-itrUTQZP/TgswR4GSSYuwWUzrE/w5GhbwM2GX3ic2U7aw33jgEsayfIlvaj7/GcIvZgNMzsPTrE5hqPuFUiE5g==", "license": "MIT", "workspaces": [ "website" @@ -2315,6 +2879,8 @@ }, "node_modules/has": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "license": "MIT", "dependencies": { "function-bind": "^1.1.1" @@ -2325,6 +2891,8 @@ }, "node_modules/has-bigints": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2332,6 +2900,8 @@ }, "node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "license": "MIT", "engines": { "node": ">=8" @@ -2339,6 +2909,8 @@ }, "node_modules/has-property-descriptors": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", "license": "MIT", "dependencies": { "get-intrinsic": "^1.1.1" @@ -2349,6 +2921,8 @@ }, "node_modules/has-proto": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -2359,6 +2933,8 @@ }, "node_modules/has-symbols": { "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -2369,6 +2945,8 @@ }, "node_modules/has-tostringtag": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" @@ -2382,6 +2960,8 @@ }, "node_modules/highlight.js": { "version": "10.7.3", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", + "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", "license": "BSD-3-Clause", "engines": { "node": "*" @@ -2389,6 +2969,8 @@ }, "node_modules/http-errors": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "license": "MIT", "dependencies": { "depd": "2.0.0", @@ -2403,6 +2985,8 @@ }, "node_modules/iconv-lite": { "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "license": "MIT", "dependencies": { "safer-buffer": ">= 2.1.2 < 3" @@ -2413,6 +2997,8 @@ }, "node_modules/ieee754": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "funding": [ { "type": "github", @@ -2431,10 +3017,14 @@ }, "node_modules/inflected": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/inflected/-/inflected-2.1.0.tgz", + "integrity": "sha512-hAEKNxvHf2Iq3H60oMBHkB4wl5jn3TPF3+fXek/sRwAB5gP9xWs4r7aweSF95f99HFoz69pnZTcu8f0SIHV18w==", "license": "MIT" }, "node_modules/inflight": { "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -2443,10 +3033,14 @@ }, "node_modules/inherits": { "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, "node_modules/internal-slot": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "license": "MIT", "dependencies": { "get-intrinsic": "^1.2.0", @@ -2459,6 +3053,8 @@ }, "node_modules/ioredis": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-5.3.2.tgz", + "integrity": "sha512-1DKMMzlIHM02eBBVOFQ1+AolGjs6+xEcM4PDL7NqOS6szq7H9jSaEkIUH6/a5Hl241LzW6JLSiAbNvTQjUupUA==", "license": "MIT", "dependencies": { "@ioredis/commands": "^1.1.1", @@ -2481,6 +3077,8 @@ }, "node_modules/ioredis/node_modules/debug": { "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "license": "MIT", "dependencies": { "ms": "2.1.2" @@ -2496,10 +3094,14 @@ }, "node_modules/ioredis/node_modules/ms": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "license": "MIT" }, "node_modules/ipaddr.js": { "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", "license": "MIT", "engines": { "node": ">= 0.10" @@ -2507,6 +3109,8 @@ }, "node_modules/is-arguments": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -2521,6 +3125,8 @@ }, "node_modules/is-array-buffer": { "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -2533,6 +3139,8 @@ }, "node_modules/is-bigint": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", "license": "MIT", "dependencies": { "has-bigints": "^1.0.1" @@ -2543,6 +3151,8 @@ }, "node_modules/is-boolean-object": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -2557,6 +3167,8 @@ }, "node_modules/is-callable": { "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -2567,6 +3179,8 @@ }, "node_modules/is-date-object": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" @@ -2580,6 +3194,8 @@ }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "license": "MIT", "engines": { "node": ">=8" @@ -2587,6 +3203,8 @@ }, "node_modules/is-map": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.2.tgz", + "integrity": "sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2594,6 +3212,8 @@ }, "node_modules/is-number-object": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" @@ -2607,6 +3227,8 @@ }, "node_modules/is-regex": { "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -2621,6 +3243,8 @@ }, "node_modules/is-set": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.2.tgz", + "integrity": "sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2628,6 +3252,8 @@ }, "node_modules/is-shared-array-buffer": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "license": "MIT", "dependencies": { "call-bind": "^1.0.2" @@ -2638,6 +3264,8 @@ }, "node_modules/is-string": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "license": "MIT", "dependencies": { "has-tostringtag": "^1.0.0" @@ -2651,6 +3279,8 @@ }, "node_modules/is-symbol": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", "license": "MIT", "dependencies": { "has-symbols": "^1.0.2" @@ -2664,6 +3294,8 @@ }, "node_modules/is-typed-array": { "version": "1.1.12", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", + "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", "license": "MIT", "dependencies": { "which-typed-array": "^1.1.11" @@ -2677,10 +3309,14 @@ }, "node_modules/is-typedarray": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", "license": "MIT" }, "node_modules/is-weakmap": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.1.tgz", + "integrity": "sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2688,6 +3324,8 @@ }, "node_modules/is-weakset": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.2.tgz", + "integrity": "sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==", "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -2699,20 +3337,36 @@ }, "node_modules/isarray": { "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", "license": "MIT" }, + "node_modules/isomorphic-ws": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", + "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", + "peerDependencies": { + "ws": "*" + } + }, "node_modules/javascript-natural-sort": { "version": "0.7.1", + "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz", + "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==", "dev": true, "license": "MIT" }, "node_modules/js-tokens": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true, "license": "MIT" }, "node_modules/jsesc": { "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true, "license": "MIT", "bin": { @@ -2724,10 +3378,14 @@ }, "node_modules/json-buffer": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "license": "MIT" }, "node_modules/keyv": { "version": "4.5.3", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.3.tgz", + "integrity": "sha512-QCiSav9WaX1PgETJ+SpNnx2PRRapJ/oRSXM4VO5OGYGSjrxbKPVFVhB3l2OCbLCk329N8qyAtsJjSjvVBWzEug==", "license": "MIT", "dependencies": { "json-buffer": "3.0.1" @@ -2735,23 +3393,33 @@ }, "node_modules/lodash": { "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true, "license": "MIT" }, "node_modules/lodash.defaults": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", "license": "MIT" }, "node_modules/lodash.isarguments": { "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", "license": "MIT" }, "node_modules/lodash.sortby": { "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==", "license": "MIT" }, "node_modules/loglevel": { "version": "1.8.1", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.1.tgz", + "integrity": "sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==", "license": "MIT", "engines": { "node": ">= 0.6.0" @@ -2763,10 +3431,14 @@ }, "node_modules/long": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", "license": "Apache-2.0" }, "node_modules/lru-cache": { "version": "7.13.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.1.tgz", + "integrity": "sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ==", "license": "ISC", "engines": { "node": ">=12" @@ -2774,6 +3446,8 @@ }, "node_modules/media-typer": { "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2781,10 +3455,14 @@ }, "node_modules/merge-descriptors": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", "license": "MIT" }, "node_modules/methods": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2792,6 +3470,8 @@ }, "node_modules/mime": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "license": "MIT", "bin": { "mime": "cli.js" @@ -2802,6 +3482,8 @@ }, "node_modules/mime-db": { "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2809,6 +3491,8 @@ }, "node_modules/mime-types": { "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", "license": "MIT", "dependencies": { "mime-db": "1.52.0" @@ -2819,6 +3503,8 @@ }, "node_modules/minimatch": { "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -2829,6 +3515,8 @@ }, "node_modules/mkdirp": { "version": "2.1.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", + "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", "license": "MIT", "bin": { "mkdirp": "dist/cjs/src/bin.js" @@ -2842,10 +3530,14 @@ }, "node_modules/ms": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "license": "MIT" }, "node_modules/mz": { "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", "license": "MIT", "dependencies": { "any-promise": "^1.0.0", @@ -2855,6 +3547,8 @@ }, "node_modules/negotiator": { "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -2862,14 +3556,20 @@ }, "node_modules/next-tick": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", + "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==", "license": "ISC" }, "node_modules/node-abort-controller": { "version": "3.1.1", + "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", + "integrity": "sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==", "license": "MIT" }, "node_modules/node-domexception": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", "funding": [ { "type": "github", @@ -2887,6 +3587,8 @@ }, "node_modules/node-fetch": { "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" @@ -2905,6 +3607,8 @@ }, "node_modules/node-gyp-build": { "version": "4.6.1", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", + "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==", "license": "MIT", "bin": { "node-gyp-build": "bin.js", @@ -2914,6 +3618,8 @@ }, "node_modules/object-assign": { "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -2921,6 +3627,8 @@ }, "node_modules/object-inspect": { "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2928,6 +3636,8 @@ }, "node_modules/object-is": { "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -2942,6 +3652,8 @@ }, "node_modules/object-keys": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "license": "MIT", "engines": { "node": ">= 0.4" @@ -2949,6 +3661,8 @@ }, "node_modules/object.assign": { "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -2965,6 +3679,8 @@ }, "node_modules/on-finished": { "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "license": "MIT", "dependencies": { "ee-first": "1.1.1" @@ -2975,6 +3691,8 @@ }, "node_modules/once": { "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "license": "ISC", "dependencies": { "wrappy": "1" @@ -2982,14 +3700,20 @@ }, "node_modules/packet-reader": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", + "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==", "license": "MIT" }, "node_modules/parse5": { "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", "license": "MIT" }, "node_modules/parse5-htmlparser2-tree-adapter": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", + "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", "license": "MIT", "dependencies": { "parse5": "^6.0.1" @@ -2997,10 +3721,14 @@ }, "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", "license": "MIT" }, "node_modules/parseurl": { "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -3008,10 +3736,14 @@ }, "node_modules/path-to-regexp": { "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", "license": "MIT" }, "node_modules/pg": { "version": "8.11.3", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz", + "integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==", "license": "MIT", "dependencies": { "buffer-writer": "2.0.0", @@ -3039,15 +3771,21 @@ }, "node_modules/pg-cloudflare": { "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", + "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", "license": "MIT", "optional": true }, "node_modules/pg-connection-string": { "version": "2.6.2", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", + "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==", "license": "MIT" }, "node_modules/pg-int8": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", + "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", "license": "ISC", "engines": { "node": ">=4.0.0" @@ -3055,6 +3793,8 @@ }, "node_modules/pg-pool": { "version": "3.6.1", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz", + "integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==", "license": "MIT", "peerDependencies": { "pg": ">=8.0" @@ -3062,10 +3802,14 @@ }, "node_modules/pg-protocol": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", + "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==", "license": "MIT" }, "node_modules/pg-types": { "version": "2.2.0", + "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", + "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", "license": "MIT", "dependencies": { "pg-int8": "1.0.1", @@ -3080,6 +3824,8 @@ }, "node_modules/pgpass": { "version": "1.0.5", + "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", + "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", "license": "MIT", "dependencies": { "split2": "^4.1.0" @@ -3087,6 +3833,8 @@ }, "node_modules/postgres-array": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", + "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", "license": "MIT", "engines": { "node": ">=4" @@ -3094,6 +3842,8 @@ }, "node_modules/postgres-bytea": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", + "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -3101,6 +3851,8 @@ }, "node_modules/postgres-date": { "version": "1.0.7", + "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", + "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -3108,6 +3860,8 @@ }, "node_modules/postgres-interval": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", + "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", "license": "MIT", "dependencies": { "xtend": "^4.0.0" @@ -3118,6 +3872,8 @@ }, "node_modules/prettier": { "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", "dev": true, "license": "MIT", "bin": { @@ -3132,6 +3888,8 @@ }, "node_modules/prom-client": { "version": "14.2.0", + "resolved": "https://registry.npmjs.org/prom-client/-/prom-client-14.2.0.tgz", + "integrity": "sha512-sF308EhTenb/pDRPakm+WgiN+VdM/T1RaHj1x+MvAuT8UiQP8JmOEbxVqtkbfR4LrvOg5n7ic01kRBDGXjYikA==", "license": "Apache-2.0", "dependencies": { "tdigest": "^0.1.1" @@ -3142,6 +3900,8 @@ }, "node_modules/proxy-addr": { "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", "license": "MIT", "dependencies": { "forwarded": "0.2.0", @@ -3153,6 +3913,8 @@ }, "node_modules/qs": { "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "license": "BSD-3-Clause", "dependencies": { "side-channel": "^1.0.4" @@ -3166,6 +3928,8 @@ }, "node_modules/range-parser": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "license": "MIT", "engines": { "node": ">= 0.6" @@ -3173,6 +3937,8 @@ }, "node_modules/raw-body": { "version": "2.5.1", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", + "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", "license": "MIT", "dependencies": { "bytes": "3.1.2", @@ -3186,6 +3952,8 @@ }, "node_modules/redis-errors": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", "license": "MIT", "engines": { "node": ">=4" @@ -3193,6 +3961,8 @@ }, "node_modules/redis-parser": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", "license": "MIT", "dependencies": { "redis-errors": "^1.0.0" @@ -3203,14 +3973,20 @@ }, "node_modules/reflect-metadata": { "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", "license": "Apache-2.0" }, "node_modules/regenerator-runtime": { "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", "license": "MIT" }, "node_modules/regexp.prototype.flags": { "version": "1.5.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz", + "integrity": "sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==", "license": "MIT", "dependencies": { "call-bind": "^1.0.2", @@ -3226,6 +4002,8 @@ }, "node_modules/require-directory": { "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -3233,6 +4011,8 @@ }, "node_modules/retry": { "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", "license": "MIT", "engines": { "node": ">= 4" @@ -3240,6 +4020,8 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -3258,10 +4040,14 @@ }, "node_modules/safer-buffer": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "license": "MIT" }, "node_modules/send": { "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", "license": "MIT", "dependencies": { "debug": "2.6.9", @@ -3284,10 +4070,14 @@ }, "node_modules/send/node_modules/ms": { "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "license": "MIT" }, "node_modules/serve-static": { "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", "license": "MIT", "dependencies": { "encodeurl": "~1.0.2", @@ -3301,6 +4091,8 @@ }, "node_modules/set-function-name": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.1.tgz", + "integrity": "sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==", "license": "MIT", "dependencies": { "define-data-property": "^1.0.1", @@ -3313,10 +4105,14 @@ }, "node_modules/setprototypeof": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "license": "ISC" }, "node_modules/sha.js": { "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "license": "(MIT AND BSD-3-Clause)", "dependencies": { "inherits": "^2.0.1", @@ -3328,6 +4124,8 @@ }, "node_modules/side-channel": { "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "license": "MIT", "dependencies": { "call-bind": "^1.0.0", @@ -3340,6 +4138,8 @@ }, "node_modules/source-map": { "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -3348,6 +4148,8 @@ }, "node_modules/split2": { "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "license": "ISC", "engines": { "node": ">= 10.x" @@ -3355,10 +4157,14 @@ }, "node_modules/standard-as-callback": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", "license": "MIT" }, "node_modules/statuses": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -3366,6 +4172,8 @@ }, "node_modules/stop-iteration-iterator": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", + "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", "license": "MIT", "dependencies": { "internal-slot": "^1.0.4" @@ -3376,6 +4184,8 @@ }, "node_modules/stoppable": { "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", + "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", "license": "MIT", "engines": { "node": ">=4", @@ -3384,6 +4194,8 @@ }, "node_modules/string-width": { "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -3396,6 +4208,8 @@ }, "node_modules/strip-ansi": { "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -3406,6 +4220,8 @@ }, "node_modules/supports-color": { "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -3419,6 +4235,8 @@ }, "node_modules/sync-fetch": { "version": "0.5.2", + "resolved": "https://registry.npmjs.org/sync-fetch/-/sync-fetch-0.5.2.tgz", + "integrity": "sha512-6gBqqkHrYvkH65WI2bzrDwrIKmt3U10s4Exnz3dYuE5Ah62FIfNv/F63inrNhu2Nyh3GH5f42GKU3RrSJoaUyQ==", "license": "MIT", "dependencies": { "node-fetch": "^2.6.1" @@ -3429,6 +4247,8 @@ }, "node_modules/tdigest": { "version": "0.1.2", + "resolved": "https://registry.npmjs.org/tdigest/-/tdigest-0.1.2.tgz", + "integrity": "sha512-+G0LLgjjo9BZX2MfdvPfH+MKLCrxlXSYec5DaPYP1fe6Iyhf0/fSmJ0bFiZ1F8BT6cGXl2LpltQptzjXKWEkKA==", "license": "MIT", "dependencies": { "bintrees": "1.0.2" @@ -3436,6 +4256,8 @@ }, "node_modules/thenify": { "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", "license": "MIT", "dependencies": { "any-promise": "^1.0.0" @@ -3443,6 +4265,8 @@ }, "node_modules/thenify-all": { "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", "license": "MIT", "dependencies": { "thenify": ">= 3.1.0 < 4" @@ -3453,6 +4277,8 @@ }, "node_modules/to-fast-properties": { "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", "dev": true, "license": "MIT", "engines": { @@ -3461,6 +4287,8 @@ }, "node_modules/toidentifier": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "license": "MIT", "engines": { "node": ">=0.6" @@ -3468,18 +4296,26 @@ }, "node_modules/tr46": { "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "license": "MIT" }, "node_modules/tslib": { "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "license": "0BSD" }, "node_modules/type": { "version": "1.2.0", + "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", + "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==", "license": "ISC" }, "node_modules/type-is": { "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "license": "MIT", "dependencies": { "media-typer": "0.3.0", @@ -3491,6 +4327,8 @@ }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "license": "MIT", "dependencies": { "is-typedarray": "^1.0.0" @@ -3498,6 +4336,8 @@ }, "node_modules/typeorm": { "version": "0.3.17", + "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.17.tgz", + "integrity": "sha512-UDjUEwIQalO9tWw9O2A4GU+sT3oyoUXheHJy4ft+RFdnRdQctdQ34L9SqE2p7LdwzafHx1maxT+bqXON+Qnmig==", "license": "MIT", "dependencies": { "@sqltools/formatter": "^1.2.5", @@ -3602,6 +4442,8 @@ }, "node_modules/typeorm/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -3616,6 +4458,8 @@ }, "node_modules/typeorm/node_modules/debug": { "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "license": "MIT", "dependencies": { "ms": "2.1.2" @@ -3631,10 +4475,14 @@ }, "node_modules/typeorm/node_modules/ms": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "license": "MIT" }, "node_modules/typeorm/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -3645,7 +4493,9 @@ }, "node_modules/typescript": { "version": "5.1.6", - "dev": true, + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "devOptional": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -3657,6 +4507,8 @@ }, "node_modules/unpipe": { "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", "license": "MIT", "engines": { "node": ">= 0.8" @@ -3664,6 +4516,8 @@ }, "node_modules/utf-8-validate": { "version": "5.0.10", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", + "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -3675,6 +4529,8 @@ }, "node_modules/utils-merge": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", "license": "MIT", "engines": { "node": ">= 0.4.0" @@ -3682,6 +4538,8 @@ }, "node_modules/uuid": { "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" @@ -3693,6 +4551,8 @@ }, "node_modules/value-or-promise": { "version": "1.0.11", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.11.tgz", + "integrity": "sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==", "license": "MIT", "engines": { "node": ">=12" @@ -3700,13 +4560,83 @@ }, "node_modules/vary": { "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", "license": "MIT", "engines": { "node": ">= 0.8" } }, + "node_modules/viem": { + "version": "1.10.14", + "resolved": "https://registry.npmjs.org/viem/-/viem-1.10.14.tgz", + "integrity": "sha512-GRwFXLFr+/7+7nYYkABgHom3zMIE3DdxZ/DP78QlYWUanpjUV5IebxMOm6pfKD+ZAj3vf9YPAmz+WogjiUgDWw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wagmi-dev" + } + ], + "dependencies": { + "@adraffy/ens-normalize": "1.9.4", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@scure/bip32": "1.3.2", + "@scure/bip39": "1.2.1", + "@types/ws": "^8.5.5", + "abitype": "0.9.8", + "isomorphic-ws": "5.0.0", + "ws": "8.13.0" + }, + "peerDependencies": { + "typescript": ">=5.0.4" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/viem/node_modules/@adraffy/ens-normalize": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz", + "integrity": "sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw==" + }, + "node_modules/viem/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/viem/node_modules/ws": { + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", + "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/wcwidth": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "license": "MIT", "optional": true, "dependencies": { @@ -3715,6 +4645,8 @@ }, "node_modules/web-streams-polyfill": { "version": "3.2.1", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz", + "integrity": "sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==", "license": "MIT", "engines": { "node": ">= 8" @@ -3722,10 +4654,14 @@ }, "node_modules/webidl-conversions": { "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "license": "BSD-2-Clause" }, "node_modules/websocket": { "version": "1.0.34", + "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", + "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", "license": "Apache-2.0", "dependencies": { "bufferutil": "^4.0.1", @@ -3741,6 +4677,8 @@ }, "node_modules/whatwg-mimetype": { "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", "license": "MIT", "engines": { "node": ">=12" @@ -3748,6 +4686,8 @@ }, "node_modules/whatwg-url": { "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "license": "MIT", "dependencies": { "tr46": "~0.0.3", @@ -3756,6 +4696,8 @@ }, "node_modules/which-boxed-primitive": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", "license": "MIT", "dependencies": { "is-bigint": "^1.0.1", @@ -3770,6 +4712,8 @@ }, "node_modules/which-collection": { "version": "1.0.1", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.1.tgz", + "integrity": "sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==", "license": "MIT", "dependencies": { "is-map": "^2.0.1", @@ -3783,6 +4727,8 @@ }, "node_modules/which-typed-array": { "version": "1.1.11", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", + "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", "license": "MIT", "dependencies": { "available-typed-arrays": "^1.0.5", @@ -3800,6 +4746,8 @@ }, "node_modules/wrap-ansi": { "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", @@ -3815,10 +4763,14 @@ }, "node_modules/wrappy": { "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, "node_modules/ws": { "version": "8.14.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.1.tgz", + "integrity": "sha512-4OOseMUq8AzRBI/7SLMUwO+FEDnguetSk7KMb1sHwvF2w2Wv5Hoj0nlifx8vtGsftE/jWHojPy8sMMzYLJ2G/A==", "license": "MIT", "engines": { "node": ">=10.0.0" @@ -3838,6 +4790,8 @@ }, "node_modules/xss": { "version": "1.0.14", + "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz", + "integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==", "license": "MIT", "dependencies": { "commander": "^2.20.3", @@ -3852,10 +4806,14 @@ }, "node_modules/xss/node_modules/commander": { "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "license": "MIT" }, "node_modules/xtend": { "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "license": "MIT", "engines": { "node": ">=0.4" @@ -3863,6 +4821,8 @@ }, "node_modules/y18n": { "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", "license": "ISC", "engines": { "node": ">=10" @@ -3870,6 +4830,8 @@ }, "node_modules/yaeti": { "version": "0.0.6", + "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", + "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", "license": "MIT", "engines": { "node": ">=0.10.32" @@ -3877,10 +4839,14 @@ }, "node_modules/yallist": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "license": "ISC" }, "node_modules/yargs": { "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "license": "MIT", "dependencies": { "cliui": "^8.0.1", @@ -3897,6 +4863,8 @@ }, "node_modules/yargs-parser": { "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "license": "ISC", "engines": { "node": ">=12" diff --git a/schema.graphql b/schema.graphql index 09fa57cf..dd6cffee 100644 --- a/schema.graphql +++ b/schema.graphql @@ -31,13 +31,14 @@ type Rebase @entity { apy: APY! } -# type RebaseOption @entity { -# id: ID! -# timestamp: DateTime! @index -# blockNumber: Int! @index -# txHash: String! @index -# status: Boolean! -# } +type RebaseOption @entity { + id: ID! + timestamp: DateTime! @index + blockNumber: Int! @index + txHash: String! @index + address: Address! + status: String! +} type APY @entity { id: ID! diff --git a/src/main.ts b/src/main.ts index 6ed79508..3cc22cd8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,14 +5,19 @@ import { transform } from './transform' processor.run(new TypeormDatabase({ supportHotBlocks: true }), async (ctx) => { const logs = parse(ctx) - const { history, rebases, owners, vaults } = await transform(ctx, logs) + const { history, rebases, owners, vaults, rebaseOptions } = await transform( + ctx, + logs, + ) const ownerValues = [...owners.values()] ctx.log.info( - `Storing: ${ownerValues.length} owners, ${history.length} histories, ${rebases.length} rebases, ${vaults.length} vaults`, + `Storing: ${ownerValues.length} owners, ${history.length} histories, ${rebases.length} rebases, ${rebaseOptions.length} rebaseOptions, ${vaults.length} vaults`, ) + await ctx.store.upsert(ownerValues) await ctx.store.insert(history) await ctx.store.insert(rebases) + await ctx.store.insert(rebaseOptions) await ctx.store.insert(vaults) }) diff --git a/src/model/generated/index.ts b/src/model/generated/index.ts index 973e52ae..d923dd14 100644 --- a/src/model/generated/index.ts +++ b/src/model/generated/index.ts @@ -1,6 +1,7 @@ export * from "./address.model" export * from "./history.model" export * from "./rebase.model" +export * from "./rebaseOption.model" export * from "./apy.model" export * from "./financialStatement.model" export * from "./vault.model" diff --git a/src/model/generated/rebaseOption.model.ts b/src/model/generated/rebaseOption.model.ts new file mode 100644 index 00000000..341363e4 --- /dev/null +++ b/src/model/generated/rebaseOption.model.ts @@ -0,0 +1,31 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_, ManyToOne as ManyToOne_} from "typeorm" +import {Address} from "./address.model" + +@Entity_() +export class RebaseOption { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @Index_() + @Column_("timestamp with time zone", {nullable: false}) + timestamp!: Date + + @Index_() + @Column_("int4", {nullable: false}) + blockNumber!: number + + @Index_() + @Column_("text", {nullable: false}) + txHash!: string + + @Index_() + @ManyToOne_(() => Address, {nullable: true}) + address!: Address + + @Column_("text", {nullable: false}) + status!: string +} diff --git a/src/parser/parser.ts b/src/parser/parser.ts index 9f3d5906..ea56815c 100644 --- a/src/parser/parser.ts +++ b/src/parser/parser.ts @@ -4,10 +4,13 @@ import * as erc20 from '../abi/oeth' import { OETH_ADDRESS, OETH_VAULT_ADDRESS } from '../utils/addresses' import { Bytes20 } from '@subsquid/evm-processor/lib/interfaces/evm' import { pad } from 'viem' +import { Trace } from '@subsquid/evm-processor' +import { TraceCall } from '@subsquid/evm-processor/src/interfaces/data' type ContextBlocks = Context['blocks'] type ContextBlock = ContextBlocks['0'] type ContextLog = ContextBlocks['0']['logs']['0'] +type ContextTrace = ContextBlock['traces']['0'] export interface BaseLog { block: ContextBlock @@ -32,14 +35,26 @@ export interface RawRebase extends BaseLog { rebasingCreditsPerToken: bigint } -export type RawLog = RawTransfer | RawRebase +export interface RawTrace extends BaseLog { + type: 'trace' + trace: ContextTrace +} + +export type RawLog = RawTransfer | RawRebase | RawTrace /** * Aggregate Transfer and Rebase events from the logs */ export function parse(ctx: Context): RawLog[] { let logs: RawLog[] = [] - const createBaseLog = (block: ContextBlock, log: ContextLog): BaseLog => { + const createBaseLog = ( + block: ContextBlock, + log: { + id: string + transactionHash: string + address: string + }, + ): BaseLog => { return { block, id: log.id, @@ -70,6 +85,17 @@ export function parse(ctx: Context): RawLog[] { rebasingCreditsPerToken, }) } + const createTrace = (block: ContextBlock, trace: ContextTrace) => { + logs.push({ + ...createBaseLog(block, { + id: trace.transaction!.id!, + address: trace.transaction!.to!, + transactionHash: trace.transaction!.hash!, + }), + type: 'trace', + trace, + }) + } const mapping: Record< Bytes20, // EVM Address @@ -94,6 +120,17 @@ export function parse(ctx: Context): RawLog[] { } for (let block of ctx.blocks) { + for (let trace of block.traces) { + if ( + trace.type === 'call' && + OETH_ADDRESS === trace.action.to && + (trace.action.sighash === oeth.functions.rebaseOptIn.sighash || + trace.action.sighash === oeth.functions.rebaseOptOut.sighash) + ) { + // RebaseOption + createTrace(block, trace) + } + } for (let log of block.logs) { mapping[log.address]?.[log.topics[0]]?.(block, log) mapping['default']?.[log.topics[0]]?.(block, log) diff --git a/src/processor.ts b/src/processor.ts index 35c834d7..2f096396 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -45,12 +45,24 @@ export const processor = new EvmBatchProcessor() gasUsed: true, gas: true, value: true, + sighash: true, + input: true, + status: true, }, log: { transactionHash: true, topics: true, data: true, }, + trace: { + callTo: true, + callSighash: true, + callValue: true, + callFrom: true, + callInput: true, + createResultAddress: true, + // action: true, + }, }) .setBlockRange({ from: Math.min( @@ -58,13 +70,6 @@ export const processor = new EvmBatchProcessor() 17067001, // OETH Vault: https://etherscan.io/tx/0x0b81a0e2b7d824ce493465221218b9c79b4a9478c0bb7760b386be240f5985b8 ), }) - // .addTransaction({ - // to: [OETH_ADDRESS], - // sighash: [ - // oeth.functions.rebaseOptIn.sighash, - // oeth.functions.rebaseOptOut.sighash, - // ], - // }) .addLog({ address: [OETH_ADDRESS], topic0: [ @@ -83,6 +88,14 @@ export const processor = new EvmBatchProcessor() topic0: [erc20.events.Transfer.topic], topic2: [pad(OETH_VAULT_ADDRESS)], }) + .addTrace({ + type: ['call', 'delegatecall'], + callSighash: [ + oeth.functions.rebaseOptOut.sighash, + oeth.functions.rebaseOptIn.sighash, + ], + transaction: true, + }) export type Fields = EvmBatchProcessorFields export type Context = DataHandlerContext diff --git a/src/transform/transform.ts b/src/transform/transform.ts index 4c3d6d9c..a6766023 100644 --- a/src/transform/transform.ts +++ b/src/transform/transform.ts @@ -1,5 +1,13 @@ import { RawLog, RawRebase, RawTransfer } from '../parser' -import { Address, APY, FraxStaking, History, Rebase, Vault } from '../model' +import { + Address, + APY, + FraxStaking, + History, + Rebase, + RebaseOption, + Vault, +} from '../model' import * as oeth from '../abi/oeth' import { Context } from '../processor' import { v4 as uuidv4 } from 'uuid' @@ -25,12 +33,14 @@ interface TransformResult { vaults: Vault[] fraxStakings: FraxStaking[] owners: Map + rebaseOptions: RebaseOption[] } export const transform = async (ctx: Context, logs: RawLog[]) => { const result: TransformResult = { history: [], rebases: [], + rebaseOptions: [], vaults: [], fraxStakings: [], owners: new Map(), @@ -170,37 +180,69 @@ export const transform = async (ctx: Context, logs: RawLog[]) => { } }, }) - await trackAddressBalances({ - address: OETH_FRAX_STAKING_ADDRESS, // TODO: Check this, probably wrong - tokens: [FRXETH_ADDRESS], // TODO: Check this, probably wrong - log, - fn: async ({ log, token, change }) => { - const dateId = log.timestamp.toISOString() - const { latest, current } = await getLatest( - ctx, - FraxStaking, - result.fraxStakings, - dateId, - ) - - let fraxStaking = current - if (!fraxStaking) { - fraxStaking = new FraxStaking({ - id: dateId, - timestamp: log.timestamp, - blockNumber: log.blockNumber, - txHash: log.txHash, - frxETH: latest?.frxETH ?? 0n, - }) - result.fraxStakings.push(fraxStaking) - } + // await trackAddressBalances({ + // address: OETH_FRAX_STAKING_ADDRESS, // TODO: Check this, probably wrong + // tokens: [FRXETH_ADDRESS], // TODO: Check this, probably wrong + // log, + // fn: async ({ log, token, change }) => { + // const dateId = log.timestamp.toISOString() + // const { latest, current } = await getLatest( + // ctx, + // FraxStaking, + // result.fraxStakings, + // dateId, + // ) + // + // let fraxStaking = current + // if (!fraxStaking) { + // fraxStaking = new FraxStaking({ + // id: dateId, + // timestamp: log.timestamp, + // blockNumber: log.blockNumber, + // txHash: log.txHash, + // frxETH: latest?.frxETH ?? 0n, + // }) + // result.fraxStakings.push(fraxStaking) + // } + // + // // TODO: Werk on me pweeze + // if (token === FRXETH_ADDRESS) { + // fraxStaking.frxETH += change + // } + // }, + // }) + } else if (log.type === 'trace' && log.trace.type === 'call') { + const trace = log.trace + if ( + OETH_ADDRESS === trace.action.to && + (trace.action.sighash === oeth.functions.rebaseOptIn.sighash || + trace.action.sighash === oeth.functions.rebaseOptOut.sighash) + ) { + const address = log.trace.transaction!.from + let owner = result.owners.get(address) + if (!owner) { + owner = await createAddress(ctx, address, log.timestamp) + result.owners.set(address, owner) + } - // TODO: Werk on me pweeze - if (token === FRXETH_ADDRESS) { - fraxStaking.frxETH += change - } - }, - }) + let rebaseOption = new RebaseOption({ + id: uuidv4(), + timestamp: log.timestamp, + blockNumber: log.blockNumber, + txHash: log.txHash, + address: owner, + status: owner.rebasingOption, + }) + result.rebaseOptions.push(rebaseOption) + if (trace.action.sighash === oeth.functions.rebaseOptIn.sighash) { + owner.rebasingOption = 'OptIn' + rebaseOption.status = 'OptIn' + } + if (trace.action.sighash === oeth.functions.rebaseOptOut.sighash) { + owner.rebasingOption = 'OptOut' + rebaseOption.status = 'OptOut' + } + } } } @@ -210,12 +252,12 @@ export const transform = async (ctx: Context, logs: RawLog[]) => { const getLatest = async ( ctx: Context, entity: EntityClass, - store: T[], + memory: T[], id: string, ) => { - const current = store.slice(store.length - 1).find((v) => v.id === id) + const current = memory.slice(memory.length - 1).find((v) => v.id === id) const latest = - store[store.length - 1] ?? + memory[memory.length - 1] ?? (await ctx.store.findOne(entity as EntityClass, { where: { id: LessThanOrEqual(id) }, order: { id: 'desc' }, @@ -252,7 +294,11 @@ const trackAddressBalances = async ({ /** * Create a new Address entity */ -async function createAddress(ctx: Context, addr: string): Promise
{ +async function createAddress( + ctx: Context, + addr: string, + lastUpdated?: Date, +): Promise
{ let isContract: boolean = false if (addr !== '0x0000000000000000000000000000000000000000') { isContract = @@ -264,8 +310,10 @@ async function createAddress(ctx: Context, addr: string): Promise
{ id: addr, balance: 0, earned: 0, + credits: 0n, isContract, rebasingOption: isContract ? 'OptOut' : 'OptIn', + lastUpdated, }) } diff --git a/tsconfig.json b/tsconfig.json index 50becfdf..e59d8d66 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,9 @@ "skipLibCheck": true, "resolveJsonModule": true }, - "include": ["src"], + "include": [ + "src" + ], "exclude": [ "node_modules" ] From 5d21f55c26f06d5da6983377e0d35d36bff1673e Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Fri, 15 Sep 2023 15:57:30 -0700 Subject: [PATCH 04/31] FraxStaking --- src/processor.ts | 17 ++++++++++- src/transform/transform.ts | 62 +++++++++++++++++++------------------- src/utils/addresses.ts | 1 + 3 files changed, 48 insertions(+), 32 deletions(-) diff --git a/src/processor.ts b/src/processor.ts index 2f096396..55aac4fb 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -13,7 +13,9 @@ import * as oeth from './abi/oeth' import * as erc20 from './abi/erc20' import { OETH_ADDRESS, + OETH_FRAX_STAKING_ADDRESS, OETH_VAULT_ADDRESS, + SFRXETH_ADDRESS, VAULT_HOLDINGS_ADDRESSES, } from './utils/addresses' import { pad } from 'viem' @@ -66,8 +68,9 @@ export const processor = new EvmBatchProcessor() }) .setBlockRange({ from: Math.min( - 16933090, // OETH Deploy: https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 + 16933090, // OETH: https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 17067001, // OETH Vault: https://etherscan.io/tx/0x0b81a0e2b7d824ce493465221218b9c79b4a9478c0bb7760b386be240f5985b8 + 17067223, // OETH Frax Staking: https://etherscan.io/tx/0x422903d2be38a264423a77e8472d365fa567f5bca12ea2403dfaee1b305c7da4 ), }) .addLog({ @@ -78,6 +81,7 @@ export const processor = new EvmBatchProcessor() ], transaction: true, }) + // Track VAULT_HOLDINGS_ADDRESSES Balances .addLog({ address: VAULT_HOLDINGS_ADDRESSES, topic0: [erc20.events.Transfer.topic], @@ -88,6 +92,17 @@ export const processor = new EvmBatchProcessor() topic0: [erc20.events.Transfer.topic], topic2: [pad(OETH_VAULT_ADDRESS)], }) + // Track OETH_FRAX_STAKING_ADDRESS SFRXETH_ADDRESS Balance + .addLog({ + address: [SFRXETH_ADDRESS], + topic0: [erc20.events.Transfer.topic], + topic1: [pad(OETH_FRAX_STAKING_ADDRESS)], + }) + .addLog({ + address: [SFRXETH_ADDRESS], + topic0: [erc20.events.Transfer.topic], + topic2: [pad(OETH_FRAX_STAKING_ADDRESS)], + }) .addTrace({ type: ['call', 'delegatecall'], callSighash: [ diff --git a/src/transform/transform.ts b/src/transform/transform.ts index a6766023..5325b9e2 100644 --- a/src/transform/transform.ts +++ b/src/transform/transform.ts @@ -19,6 +19,7 @@ import { OETH_FRAX_STAKING_ADDRESS, OETH_VAULT_ADDRESS, RETH_ADDRESS, + SFRXETH_ADDRESS, STETH_ADDRESS, VAULT_HOLDINGS_ADDRESSES, WETH_ADDRESS, @@ -180,37 +181,36 @@ export const transform = async (ctx: Context, logs: RawLog[]) => { } }, }) - // await trackAddressBalances({ - // address: OETH_FRAX_STAKING_ADDRESS, // TODO: Check this, probably wrong - // tokens: [FRXETH_ADDRESS], // TODO: Check this, probably wrong - // log, - // fn: async ({ log, token, change }) => { - // const dateId = log.timestamp.toISOString() - // const { latest, current } = await getLatest( - // ctx, - // FraxStaking, - // result.fraxStakings, - // dateId, - // ) - // - // let fraxStaking = current - // if (!fraxStaking) { - // fraxStaking = new FraxStaking({ - // id: dateId, - // timestamp: log.timestamp, - // blockNumber: log.blockNumber, - // txHash: log.txHash, - // frxETH: latest?.frxETH ?? 0n, - // }) - // result.fraxStakings.push(fraxStaking) - // } - // - // // TODO: Werk on me pweeze - // if (token === FRXETH_ADDRESS) { - // fraxStaking.frxETH += change - // } - // }, - // }) + await trackAddressBalances({ + address: OETH_FRAX_STAKING_ADDRESS, + tokens: [SFRXETH_ADDRESS], + log, + fn: async ({ log, token, change }) => { + const dateId = log.timestamp.toISOString() + const { latest, current } = await getLatest( + ctx, + FraxStaking, + result.fraxStakings, + dateId, + ) + + let fraxStaking = current + if (!fraxStaking) { + fraxStaking = new FraxStaking({ + id: dateId, + timestamp: log.timestamp, + blockNumber: log.blockNumber, + txHash: log.txHash, + frxETH: latest?.frxETH ?? 0n, + }) + result.fraxStakings.push(fraxStaking) + } + + if (token === SFRXETH_ADDRESS) { + fraxStaking.frxETH += change + } + }, + }) } else if (log.type === 'trace' && log.trace.type === 'call') { const trace = log.trace if ( diff --git a/src/utils/addresses.ts b/src/utils/addresses.ts index d410d55d..f0788ca7 100644 --- a/src/utils/addresses.ts +++ b/src/utils/addresses.ts @@ -24,3 +24,4 @@ export const CONVEX_DEPOSIT = '0xf403c135812408bfbe8713b5a23a04b3d48aae31' export const OETH_FRAX_STAKING_ADDRESS = '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5' +export const SFRXETH_ADDRESS = '0xac3e018457b222d93114458476f3e3416abbe38f' From 1c12098c887797f1d4a5b19fccfec69cd9631baa Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Fri, 15 Sep 2023 16:04:34 -0700 Subject: [PATCH 05/31] FraxStaking --- src/main.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 3cc22cd8..3ebc6653 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,10 +5,8 @@ import { transform } from './transform' processor.run(new TypeormDatabase({ supportHotBlocks: true }), async (ctx) => { const logs = parse(ctx) - const { history, rebases, owners, vaults, rebaseOptions } = await transform( - ctx, - logs, - ) + const { history, rebases, owners, vaults, rebaseOptions, fraxStakings } = + await transform(ctx, logs) const ownerValues = [...owners.values()] ctx.log.info( @@ -20,4 +18,5 @@ processor.run(new TypeormDatabase({ supportHotBlocks: true }), async (ctx) => { await ctx.store.insert(rebases) await ctx.store.insert(rebaseOptions) await ctx.store.insert(vaults) + await ctx.store.insert(fraxStakings) }) From baab269f288126d902622ba2690e18efe0b0fd88 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Fri, 15 Sep 2023 18:38:49 -0700 Subject: [PATCH 06/31] reorganize everything --- src/main.ts | 32 +- src/parser/index.ts | 1 - src/parser/parser.ts | 141 ------- src/processor.ts | 51 +-- src/processors/frax-staking/frax-staking.ts | 83 ++++ src/processors/frax-staking/index.ts | 1 + src/processors/oeth/index.ts | 1 + src/processors/oeth/oeth.ts | 200 ++++++++++ src/processors/oeth/utils.ts | 144 +++++++ src/processors/utils.ts | 50 +++ src/processors/vault/index.ts | 1 + src/processors/vault/vault.ts | 100 +++++ src/transform/index.ts | 1 - src/transform/transform.ts | 419 -------------------- 14 files changed, 597 insertions(+), 628 deletions(-) delete mode 100644 src/parser/index.ts delete mode 100644 src/parser/parser.ts create mode 100644 src/processors/frax-staking/frax-staking.ts create mode 100644 src/processors/frax-staking/index.ts create mode 100644 src/processors/oeth/index.ts create mode 100644 src/processors/oeth/oeth.ts create mode 100644 src/processors/oeth/utils.ts create mode 100644 src/processors/utils.ts create mode 100644 src/processors/vault/index.ts create mode 100644 src/processors/vault/vault.ts delete mode 100644 src/transform/index.ts delete mode 100644 src/transform/transform.ts diff --git a/src/main.ts b/src/main.ts index 3ebc6653..fee4e00c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,22 +1,22 @@ import { TypeormDatabase } from '@subsquid/typeorm-store' import { processor } from './processor' -import { parse } from './parser' -import { transform } from './transform' -processor.run(new TypeormDatabase({ supportHotBlocks: true }), async (ctx) => { - const logs = parse(ctx) - const { history, rebases, owners, vaults, rebaseOptions, fraxStakings } = - await transform(ctx, logs) +import * as oethProcessor from './processors/oeth' +import * as vaultProcessor from './processors/vault' +import * as fraxStakingProcessor from './processors/frax-staking' - const ownerValues = [...owners.values()] - ctx.log.info( - `Storing: ${ownerValues.length} owners, ${history.length} histories, ${rebases.length} rebases, ${rebaseOptions.length} rebaseOptions, ${vaults.length} vaults`, - ) +oethProcessor.setup(processor) +vaultProcessor.setup(processor) +fraxStakingProcessor.setup(processor) - await ctx.store.upsert(ownerValues) - await ctx.store.insert(history) - await ctx.store.insert(rebases) - await ctx.store.insert(rebaseOptions) - await ctx.store.insert(vaults) - await ctx.store.insert(fraxStakings) +processor.run(new TypeormDatabase({ supportHotBlocks: true }), async (ctx) => { + let start = Date.now() + const time = (name: string) => () => + ctx.log.info(`${name} ${Date.now() - start}ms`) + // The idea is that these processors have zero dependencies on one another and can be processed asynchronously. + await Promise.all([ + oethProcessor.process(ctx).then(time('oethProcessor')), // This processor is slow. Likely due to the high quantity of address balance lookups. + vaultProcessor.process(ctx), + fraxStakingProcessor.process(ctx), + ]) }) diff --git a/src/parser/index.ts b/src/parser/index.ts deleted file mode 100644 index e9312eb3..00000000 --- a/src/parser/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './parser' diff --git a/src/parser/parser.ts b/src/parser/parser.ts deleted file mode 100644 index ea56815c..00000000 --- a/src/parser/parser.ts +++ /dev/null @@ -1,141 +0,0 @@ -import { Context } from '../processor' -import * as oeth from '../abi/oeth' -import * as erc20 from '../abi/oeth' -import { OETH_ADDRESS, OETH_VAULT_ADDRESS } from '../utils/addresses' -import { Bytes20 } from '@subsquid/evm-processor/lib/interfaces/evm' -import { pad } from 'viem' -import { Trace } from '@subsquid/evm-processor' -import { TraceCall } from '@subsquid/evm-processor/src/interfaces/data' - -type ContextBlocks = Context['blocks'] -type ContextBlock = ContextBlocks['0'] -type ContextLog = ContextBlocks['0']['logs']['0'] -type ContextTrace = ContextBlock['traces']['0'] - -export interface BaseLog { - block: ContextBlock - id: string - address: Bytes20 - timestamp: Date - blockNumber: number - txHash: string -} - -export interface RawTransfer extends BaseLog { - type: 'transfer' - value: bigint - from: string - to: string -} - -export interface RawRebase extends BaseLog { - type: 'rebase' - totalSupply: bigint - rebasingCredits: bigint - rebasingCreditsPerToken: bigint -} - -export interface RawTrace extends BaseLog { - type: 'trace' - trace: ContextTrace -} - -export type RawLog = RawTransfer | RawRebase | RawTrace - -/** - * Aggregate Transfer and Rebase events from the logs - */ -export function parse(ctx: Context): RawLog[] { - let logs: RawLog[] = [] - const createBaseLog = ( - block: ContextBlock, - log: { - id: string - transactionHash: string - address: string - }, - ): BaseLog => { - return { - block, - id: log.id, - timestamp: new Date(block.header.timestamp), - blockNumber: block.header.height, - txHash: log.transactionHash, - address: log.address, - } - } - const createTransfer = (block: ContextBlock, log: ContextLog) => { - let { from, to, value } = oeth.events.Transfer.decode(log) - logs.push({ - ...createBaseLog(block, log), - type: 'transfer', - value, - from: from.toLowerCase(), - to: to.toLowerCase(), - }) - } - const createRebase = (block: ContextBlock, log: ContextLog) => { - let { totalSupply, rebasingCredits, rebasingCreditsPerToken } = - oeth.events.TotalSupplyUpdatedHighres.decode(log) - logs.push({ - ...createBaseLog(block, log), - type: 'rebase', - totalSupply, - rebasingCredits, - rebasingCreditsPerToken, - }) - } - const createTrace = (block: ContextBlock, trace: ContextTrace) => { - logs.push({ - ...createBaseLog(block, { - id: trace.transaction!.id!, - address: trace.transaction!.to!, - transactionHash: trace.transaction!.hash!, - }), - type: 'trace', - trace, - }) - } - - const mapping: Record< - Bytes20, // EVM Address - | undefined - | Record< - string, // Topic0 - (block: ContextBlock, log: ContextLog) => void - > - > = { - [OETH_ADDRESS]: { - [oeth.events.Transfer.topic]: createTransfer, - [oeth.events.TotalSupplyUpdatedHighres.topic]: createRebase, - }, - default: { - [erc20.events.Transfer.topic]: (block, log) => { - if (log.topics[1] === pad(OETH_VAULT_ADDRESS)) - createTransfer(block, log) - else if (log.topics[2] === pad(OETH_VAULT_ADDRESS)) - createTransfer(block, log) - }, - }, - } - - for (let block of ctx.blocks) { - for (let trace of block.traces) { - if ( - trace.type === 'call' && - OETH_ADDRESS === trace.action.to && - (trace.action.sighash === oeth.functions.rebaseOptIn.sighash || - trace.action.sighash === oeth.functions.rebaseOptOut.sighash) - ) { - // RebaseOption - createTrace(block, trace) - } - } - for (let log of block.logs) { - mapping[log.address]?.[log.topics[0]]?.(block, log) - mapping['default']?.[log.topics[0]]?.(block, log) - } - } - - return logs -} diff --git a/src/processor.ts b/src/processor.ts index 55aac4fb..856c49e1 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -9,17 +9,6 @@ import { } from '@subsquid/evm-processor' import { Store } from '@subsquid/typeorm-store' -import * as oeth from './abi/oeth' -import * as erc20 from './abi/erc20' -import { - OETH_ADDRESS, - OETH_FRAX_STAKING_ADDRESS, - OETH_VAULT_ADDRESS, - SFRXETH_ADDRESS, - VAULT_HOLDINGS_ADDRESSES, -} from './utils/addresses' -import { pad } from 'viem' - export const processor = new EvmBatchProcessor() .setDataSource({ // Change the Archive endpoints for run the squid @@ -68,49 +57,11 @@ export const processor = new EvmBatchProcessor() }) .setBlockRange({ from: Math.min( - 16933090, // OETH: https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 + 16933090, // OETH: https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 17067001, // OETH Vault: https://etherscan.io/tx/0x0b81a0e2b7d824ce493465221218b9c79b4a9478c0bb7760b386be240f5985b8 17067223, // OETH Frax Staking: https://etherscan.io/tx/0x422903d2be38a264423a77e8472d365fa567f5bca12ea2403dfaee1b305c7da4 ), }) - .addLog({ - address: [OETH_ADDRESS], - topic0: [ - oeth.events.Transfer.topic, - oeth.events.TotalSupplyUpdatedHighres.topic, - ], - transaction: true, - }) - // Track VAULT_HOLDINGS_ADDRESSES Balances - .addLog({ - address: VAULT_HOLDINGS_ADDRESSES, - topic0: [erc20.events.Transfer.topic], - topic1: [pad(OETH_VAULT_ADDRESS)], - }) - .addLog({ - address: VAULT_HOLDINGS_ADDRESSES, - topic0: [erc20.events.Transfer.topic], - topic2: [pad(OETH_VAULT_ADDRESS)], - }) - // Track OETH_FRAX_STAKING_ADDRESS SFRXETH_ADDRESS Balance - .addLog({ - address: [SFRXETH_ADDRESS], - topic0: [erc20.events.Transfer.topic], - topic1: [pad(OETH_FRAX_STAKING_ADDRESS)], - }) - .addLog({ - address: [SFRXETH_ADDRESS], - topic0: [erc20.events.Transfer.topic], - topic2: [pad(OETH_FRAX_STAKING_ADDRESS)], - }) - .addTrace({ - type: ['call', 'delegatecall'], - callSighash: [ - oeth.functions.rebaseOptOut.sighash, - oeth.functions.rebaseOptIn.sighash, - ], - transaction: true, - }) export type Fields = EvmBatchProcessorFields export type Context = DataHandlerContext diff --git a/src/processors/frax-staking/frax-staking.ts b/src/processors/frax-staking/frax-staking.ts new file mode 100644 index 00000000..e0de32f2 --- /dev/null +++ b/src/processors/frax-staking/frax-staking.ts @@ -0,0 +1,83 @@ +import { Context } from '../../processor' +import { FraxStaking, Vault } from '../../model' +import { EvmBatchProcessor } from '@subsquid/evm-processor' +import { + OETH_FRAX_STAKING_ADDRESS, + SFRXETH_ADDRESS, +} from '../../utils/addresses' +import * as erc20 from '../../abi/erc20' +import { pad } from 'viem' +import { getLatest, trackAddressBalances } from '../utils' + +interface ProcessResult { + fraxStakings: FraxStaking[] +} + +export const setup = (processor: EvmBatchProcessor) => { + processor.addLog({ + address: [SFRXETH_ADDRESS], + topic0: [erc20.events.Transfer.topic], + topic1: [pad(OETH_FRAX_STAKING_ADDRESS)], + }) + processor.addLog({ + address: [SFRXETH_ADDRESS], + topic0: [erc20.events.Transfer.topic], + topic2: [pad(OETH_FRAX_STAKING_ADDRESS)], + }) +} + +export const process = async (ctx: Context) => { + const result: ProcessResult = { + fraxStakings: [], + } + + for (const block of ctx.blocks) { + for (const log of block.logs) { + await processTransfer(ctx, result, block, log) + } + } + + await ctx.store.insert(result.fraxStakings) +} + +const processTransfer = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: Context['blocks']['0']['logs']['0'], +) => { + if (log.topics[0] === erc20.events.Transfer.topic) { + const data = erc20.events.Transfer.decode(log) + await trackAddressBalances({ + log, + data, + address: OETH_FRAX_STAKING_ADDRESS, + tokens: [SFRXETH_ADDRESS], + fn: async ({ log, token, change }) => { + const dateId = new Date(block.header.timestamp).toISOString() + const { latest, current } = await getLatest( + ctx, + FraxStaking, + result.fraxStakings, + dateId, + ) + + let fraxStaking = current + if (!fraxStaking) { + fraxStaking = new FraxStaking({ + id: dateId, + timestamp: new Date(block.header.timestamp), + blockNumber: block.header.height, + txHash: log.transactionHash, + frxETH: latest?.frxETH ?? 0n, + }) + result.fraxStakings.push(fraxStaking) + } + + if (token === SFRXETH_ADDRESS) { + fraxStaking.frxETH += change + } + }, + }) + } +} diff --git a/src/processors/frax-staking/index.ts b/src/processors/frax-staking/index.ts new file mode 100644 index 00000000..4cec3a21 --- /dev/null +++ b/src/processors/frax-staking/index.ts @@ -0,0 +1 @@ +export * from './frax-staking' diff --git a/src/processors/oeth/index.ts b/src/processors/oeth/index.ts new file mode 100644 index 00000000..526449ec --- /dev/null +++ b/src/processors/oeth/index.ts @@ -0,0 +1 @@ +export * from './oeth' diff --git a/src/processors/oeth/oeth.ts b/src/processors/oeth/oeth.ts new file mode 100644 index 00000000..c1f07f29 --- /dev/null +++ b/src/processors/oeth/oeth.ts @@ -0,0 +1,200 @@ +import { Context } from '../../processor' +import { Address, History, Rebase, RebaseOption } from '../../model' +import { EvmBatchProcessor } from '@subsquid/evm-processor' +import * as oeth from '../../abi/oeth' +import { ADDRESS_ZERO, OETH_ADDRESS } from '../../utils/addresses' +import { v4 as uuidv4 } from 'uuid' +import { createAddress, createRebaseAPY } from './utils' + +export const setup = (processor: EvmBatchProcessor) => { + processor.addTrace({ + type: ['call', 'delegatecall'], + callSighash: [ + oeth.functions.rebaseOptOut.sighash, + oeth.functions.rebaseOptIn.sighash, + ], + transaction: true, + }) + processor.addLog({ + address: [OETH_ADDRESS], + topic0: [ + oeth.events.Transfer.topic, + oeth.events.TotalSupplyUpdatedHighres.topic, + ], + transaction: true, + }) +} + +interface ProcessResult { + history: History[] + rebases: Rebase[] + owners: Map + rebaseOptions: RebaseOption[] +} + +export const process = async (ctx: Context) => { + const result: ProcessResult = { + history: [], + rebases: [], + rebaseOptions: [], + // get all addresses from the database. + // we need this because we increase their balance based on rebase events + owners: await ctx.store + .find(Address) + .then((q) => new Map(q.map((i) => [i.id, i]))), + } + + for (const block of ctx.blocks) { + for (const trace of block.traces) { + await processRebaseOpt(ctx, result, block, trace) + } + for (const log of block.logs) { + await processTransfer(ctx, result, block, log) + await processTotalSupplyUpdatedHighres(ctx, result, block, log) + } + } + + await ctx.store.upsert([...result.owners.values()]) + await ctx.store.insert(result.history) + await ctx.store.insert(result.rebases) + await ctx.store.insert(result.rebaseOptions) +} + +const processTransfer = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: Context['blocks']['0']['logs']['0'], +) => { + if (log.topics[0] === oeth.events.Transfer.topic) { + const data = oeth.events.Transfer.decode(log) + // Bind the token contract to the block number + const token = new oeth.Contract(ctx, block.header, OETH_ADDRESS) + // Transfer events + let addressSub = result.owners.get(data.from) + let addressAdd = result.owners.get(data.to) + + if (addressSub == null) { + addressSub = await createAddress(ctx, data.from) + result.owners.set(addressSub.id, addressSub) + } + if (addressAdd == null) { + addressAdd = await createAddress(ctx, data.to) + result.owners.set(addressAdd.id, addressAdd) + } + + addressSub.lastUpdated = new Date(block.header.timestamp) + addressAdd.lastUpdated = new Date(block.header.timestamp) + + const isSwap = [data.from, data.to].includes(ADDRESS_ZERO) + + // update the address balance + await Promise.all( + [addressSub, addressAdd].map(async (address) => { + const credits = await token.creditsBalanceOfHighres(address.id) + const newBalance = Number(credits[0]) / Number(credits[1]) + result.history.push( + new History({ + // we can't use {t.id} because it's not unique + id: uuidv4(), + address: address, + value: newBalance - address.balance, + balance: newBalance, + timestamp: new Date(block.header.timestamp), + blockNumber: block.header.height, + txHash: log.transactionHash, + type: isSwap + ? 'Swap' + : addressSub === address + ? 'Sent' + : 'Received', + }), + ) + address.credits = BigInt(credits[0]) // token credits + address.balance = Number(credits[0]) / Number(credits[1]) // token balance + }), + ) + } +} + +const processTotalSupplyUpdatedHighres = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: Context['blocks']['0']['logs']['0'], +) => { + if (log.topics[0] === oeth.events.TotalSupplyUpdatedHighres.topic) { + const data = oeth.events.TotalSupplyUpdatedHighres.decode(log) + // Rebase events + let rebase = createRebaseAPY(ctx, block, log, data) + for (const address of result.owners.values()) { + if (address.rebasingOption === 'OptOut') { + continue + } + const newBalance = + Number(address.credits) / Number(data.rebasingCreditsPerToken) + const earned = newBalance - address.balance + + result.history.push( + new History({ + id: uuidv4(), + // we can't use {t.id} because it's not unique + address: address, + value: earned, + balance: newBalance, + timestamp: new Date(block.header.timestamp), + blockNumber: block.header.height, + txHash: log.transactionHash, + type: 'Yield', + }), + ) + + address.balance = newBalance + address.earned += earned + } + const entity = await rebase + result.rebases.push(entity) + } +} + +const processRebaseOpt = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + trace: Context['blocks']['0']['traces']['0'], +) => { + const timestamp = new Date(block.header.timestamp) + const blockNumber = block.header.height + if (trace.type === 'call') { + if ( + OETH_ADDRESS === trace.action.to && + (trace.action.sighash === oeth.functions.rebaseOptIn.sighash || + trace.action.sighash === oeth.functions.rebaseOptOut.sighash) + ) { + const address = trace.transaction!.from + let owner = result.owners.get(address) + if (!owner) { + owner = await createAddress(ctx, address, timestamp) + result.owners.set(address, owner) + } + + let rebaseOption = new RebaseOption({ + id: uuidv4(), + timestamp, + blockNumber, + txHash: trace.transaction?.hash, + address: owner, + status: owner.rebasingOption, + }) + result.rebaseOptions.push(rebaseOption) + if (trace.action.sighash === oeth.functions.rebaseOptIn.sighash) { + owner.rebasingOption = 'OptIn' + rebaseOption.status = 'OptIn' + } + if (trace.action.sighash === oeth.functions.rebaseOptOut.sighash) { + owner.rebasingOption = 'OptOut' + rebaseOption.status = 'OptOut' + } + } + } +} diff --git a/src/processors/oeth/utils.ts b/src/processors/oeth/utils.ts new file mode 100644 index 00000000..aab30985 --- /dev/null +++ b/src/processors/oeth/utils.ts @@ -0,0 +1,144 @@ +import { Context } from '../../processor' +import { Address, APY, Rebase } from '../../model' +import { LessThan, MoreThanOrEqual } from 'typeorm' +import * as oeth from '../../abi/oeth' + +/** + * Create a new Address entity + */ +export async function createAddress( + ctx: Context, + addr: string, + lastUpdated?: Date, +): Promise
{ + let isContract: boolean = false + if (addr !== '0x0000000000000000000000000000000000000000') { + isContract = + (await ctx._chain.client.call('eth_getCode', [addr, 'latest'])) !== '0x' + } + + // ctx.log.info(`New address ${rawAddress}`); + return new Address({ + id: addr, + balance: 0, + earned: 0, + credits: 0n, + isContract, + rebasingOption: isContract ? 'OptOut' : 'OptIn', + lastUpdated, + }) +} + +/** + * Create Rebase entity and set APY + */ +export async function createRebaseAPY( + ctx: Context, + block: Context['blocks']['0'], + log: Context['blocks']['0']['logs']['0'], + rebaseEvent: ReturnType, +): Promise { + const rebase = new Rebase({ + id: log.id, + blockNumber: block.header.height, + timestamp: new Date(block.header.timestamp), + txHash: log.transactionHash, + rebasingCredits: rebaseEvent.rebasingCredits, + rebasingCreditsPerToken: rebaseEvent.rebasingCreditsPerToken, + totalSupply: rebaseEvent.totalSupply, + }) + + // use date as id for APY + const date = new Date(block.header.timestamp) + const dateId = date.toISOString().substring(0, 10) + date.setDate(date.getDate() - 1) + const lastDateId = date.toISOString().substring(0, 10) + + // use date as id for APY + date.setDate(date.getDate() - 6) + const last7daysDateId = { + key: 'apy7DayAvg', + value: date.toISOString().substring(0, 10), + } + date.setDate(date.getDate() - 14) + const last14daysDateId = { + key: 'apy14DayAvg', + value: date.toISOString().substring(0, 10), + } + date.setDate(date.getDate() - 16) + const last30daysDateId = { + key: 'apy30DayAvg', + value: date.toISOString().substring(0, 10), + } + + // get last APY to compare with current one + let lastApy = await ctx.store.findOne(APY, { + where: { id: LessThan(dateId) }, + order: { id: 'DESC' }, + }) + + // check if there is already an APY for the current date + let apy = await ctx.store.findOne(APY, { where: { id: dateId } }) + // ctx.log.info(`APY: ${dateId} ${apy}, ${lastDateId} ${lastApy}`); + // create a new APY if it doesn't exist + if (!apy) { + apy = new APY({ + id: dateId, + blockNumber: block.header.height, + timestamp: new Date(block.header.timestamp), + txHash: log.transactionHash, + rebasingCreditsPerToken: rebaseEvent.rebasingCreditsPerToken, + }) + } + + rebase.apy = apy + + // should only happen for the first rebase event + if (!lastApy) { + apy.apr = 0 + apy.apy = 0 + apy.apy7DayAvg = 0 + apy.apy14DayAvg = 0 + apy.apy30DayAvg = 0 + + await ctx.store.upsert(apy) + return rebase + } + + // update APY with the new rebase event + apy.blockNumber = block.header.height + apy.timestamp = new Date(block.header.timestamp) + apy.txHash = log.transactionHash + apy.rebasingCreditsPerToken = rebaseEvent.rebasingCreditsPerToken + + // this should normally be 1 day but more secure to calculate it + const diffTime = Math.abs( + new Date(apy.id).getTime() - new Date(lastApy.id).getTime(), + ) + const dayDiff = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) + + apy.apr = + ((Number(lastApy.rebasingCreditsPerToken) / + Number(apy.rebasingCreditsPerToken) - + 1) * + 100 * + 365.25) / + dayDiff + const periods_per_year = 365.25 / dayDiff + apy.apy = + ((1 + apy.apr / periods_per_year / 100) ** periods_per_year - 1) * 100 + + // calculate average APY for the last 7, 14 and 30 days + for (const i of [last7daysDateId, last14daysDateId, last30daysDateId]) { + let pastAPYs = await ctx.store.findBy(APY, { + id: MoreThanOrEqual(i.value), + }) + // @ts-ignore + apy[i.key] = + pastAPYs.reduce((acc: number, cur: APY) => acc + cur.apy, apy.apy) / + (pastAPYs.length + 1) + } + + await ctx.store.upsert(apy) + return rebase +} diff --git a/src/processors/utils.ts b/src/processors/utils.ts new file mode 100644 index 00000000..3cfec6e3 --- /dev/null +++ b/src/processors/utils.ts @@ -0,0 +1,50 @@ +import { Context } from '../processor' +import * as erc20 from '../abi/erc20' +import { Entity, EntityClass } from '@subsquid/typeorm-store' +import { LessThanOrEqual } from 'typeorm' + +export const trackAddressBalances = async ({ + log, + data, + address, + tokens, + fn, +}: { + log: Context['blocks']['0']['logs']['0'] + data: ReturnType + address: string + tokens: string[] + fn: (params: { + address: string + token: string + change: bigint + log: Context['blocks']['0']['logs']['0'] + data: ReturnType + }) => Promise +}) => { + if ( + data.value > 0n && + (data.from.toLowerCase() === address || + data.to.toLowerCase() === address) && + tokens.includes(log.address) + ) { + const change = data.from === address ? -data.value : data.value + await fn({ address, token: log.address, change, log, data }) + } +} + +export const getLatest = async ( + ctx: Context, + entity: EntityClass, + memory: T[], + id: string, +) => { + const current = memory.slice(memory.length - 1).find((v) => v.id === id) + const latest = + memory[memory.length - 1] ?? + (await ctx.store.findOne(entity as EntityClass, { + where: { id: LessThanOrEqual(id) }, + order: { id: 'desc' }, + })) + return { current, latest } +} diff --git a/src/processors/vault/index.ts b/src/processors/vault/index.ts new file mode 100644 index 00000000..5265e039 --- /dev/null +++ b/src/processors/vault/index.ts @@ -0,0 +1 @@ +export * from './vault' diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts new file mode 100644 index 00000000..83938258 --- /dev/null +++ b/src/processors/vault/vault.ts @@ -0,0 +1,100 @@ +import { Context } from '../../processor' +import { Vault } from '../../model' +import { EvmBatchProcessor } from '@subsquid/evm-processor' +import { + ADDRESS_ZERO, + FRXETH_ADDRESS, + OETH_VAULT_ADDRESS, + RETH_ADDRESS, + STETH_ADDRESS, + VAULT_HOLDINGS_ADDRESSES, + WETH_ADDRESS, +} from '../../utils/addresses' +import * as erc20 from '../../abi/erc20' +import { pad } from 'viem' +import { getLatest, trackAddressBalances } from '../utils' + +interface ProcessResult { + vaults: Vault[] +} + +export const setup = (processor: EvmBatchProcessor) => { + processor.addLog({ + address: VAULT_HOLDINGS_ADDRESSES, + topic0: [erc20.events.Transfer.topic], + topic1: [pad(OETH_VAULT_ADDRESS)], + }) + processor.addLog({ + address: VAULT_HOLDINGS_ADDRESSES, + topic0: [erc20.events.Transfer.topic], + topic2: [pad(OETH_VAULT_ADDRESS)], + }) +} + +export const process = async (ctx: Context) => { + const result: ProcessResult = { + vaults: [], + } + + for (const block of ctx.blocks) { + for (const log of block.logs) { + await processTransfer(ctx, result, block, log) + } + } + + await ctx.store.insert(result.vaults) +} + +const processTransfer = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: Context['blocks']['0']['logs']['0'], +) => { + if (log.topics[0] === erc20.events.Transfer.topic) { + const data = erc20.events.Transfer.decode(log) + await trackAddressBalances({ + log, + data, + address: OETH_VAULT_ADDRESS, + tokens: VAULT_HOLDINGS_ADDRESSES, + fn: async ({ log, token, change }) => { + const dateId = new Date(block.header.timestamp).toISOString() + const { latest, current } = await getLatest( + ctx, + Vault, + result.vaults, + dateId, + ) + + let vault = current + if (!vault) { + vault = new Vault({ + id: dateId, + timestamp: new Date(block.header.timestamp), + blockNumber: block.header.height, + txHash: log.transactionHash, + eth: latest?.eth ?? 0n, + weth: latest?.weth ?? 0n, + rETH: latest?.rETH ?? 0n, + stETH: latest?.stETH ?? 0n, + frxETH: latest?.frxETH ?? 0n, + }) + result.vaults.push(vault) + } + + if (token === ADDRESS_ZERO) { + vault.eth += change + } else if (token === WETH_ADDRESS) { + vault.weth += change + } else if (token === RETH_ADDRESS) { + vault.rETH += change + } else if (token === STETH_ADDRESS) { + vault.stETH += change + } else if (token === FRXETH_ADDRESS) { + vault.frxETH += change + } + }, + }) + } +} diff --git a/src/transform/index.ts b/src/transform/index.ts deleted file mode 100644 index d551975c..00000000 --- a/src/transform/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './transform' diff --git a/src/transform/transform.ts b/src/transform/transform.ts deleted file mode 100644 index 5325b9e2..00000000 --- a/src/transform/transform.ts +++ /dev/null @@ -1,419 +0,0 @@ -import { RawLog, RawRebase, RawTransfer } from '../parser' -import { - Address, - APY, - FraxStaking, - History, - Rebase, - RebaseOption, - Vault, -} from '../model' -import * as oeth from '../abi/oeth' -import { Context } from '../processor' -import { v4 as uuidv4 } from 'uuid' -import { LessThan, LessThanOrEqual, MoreThanOrEqual } from 'typeorm' -import { - ADDRESS_ZERO, - FRXETH_ADDRESS, - OETH_ADDRESS, - OETH_FRAX_STAKING_ADDRESS, - OETH_VAULT_ADDRESS, - RETH_ADDRESS, - SFRXETH_ADDRESS, - STETH_ADDRESS, - VAULT_HOLDINGS_ADDRESSES, - WETH_ADDRESS, -} from '../utils/addresses' -import { Entity, EntityClass } from '@subsquid/typeorm-store' - -const addressZero = '0x0000000000000000000000000000000000000000' - -interface TransformResult { - history: History[] - rebases: Rebase[] - vaults: Vault[] - fraxStakings: FraxStaking[] - owners: Map - rebaseOptions: RebaseOption[] -} - -export const transform = async (ctx: Context, logs: RawLog[]) => { - const result: TransformResult = { - history: [], - rebases: [], - rebaseOptions: [], - vaults: [], - fraxStakings: [], - owners: new Map(), - } - - // get all addresses from the database. - // we need this because we increase their balance based on rebase events - result.owners = await ctx.store - .find(Address) - .then((q) => new Map(q.map((i) => [i.id, i]))) - - for (let log of logs) { - // let rebase = await ctx.store.findOne(History, { - // where: { blockNumber: LessThanOrEqual(t.blockNumber), type: 'Rebase' }, - // order: { blockNumber: 'DESC' }, - // }); - - if (log.address === OETH_ADDRESS) { - if (log.type === 'transfer') { - // Bind the token contract to the block number - const token = new oeth.Contract(ctx, log.block.header, OETH_ADDRESS) - // Transfer events - let addressSub = result.owners.get(log.from) - let addressAdd = result.owners.get(log.to) - - if (addressSub == null) { - addressSub = await createAddress(ctx, log.from) - result.owners.set(addressSub.id, addressSub) - } - if (addressAdd == null) { - addressAdd = await createAddress(ctx, log.to) - result.owners.set(addressAdd.id, addressAdd) - } - - addressSub.lastUpdated = log.timestamp - addressAdd.lastUpdated = log.timestamp - - const isSwap = [log.from, log.to].includes(addressZero) - - // update the address balance - await Promise.all( - [addressSub, addressAdd].map(async (address) => { - const credits = await token.creditsBalanceOfHighres(address.id) - const newBalance = Number(credits[0]) / Number(credits[1]) - result.history.push( - new History({ - // we can't use {t.id} because it's not unique - id: uuidv4(), - address: address, - value: newBalance - address.balance, - balance: newBalance, - timestamp: log.timestamp, - blockNumber: log.blockNumber, - txHash: log.txHash, - type: isSwap - ? 'Swap' - : addressSub === address - ? 'Sent' - : 'Received', - }), - ) - address.credits = BigInt(credits[0]) // token credits - address.balance = Number(credits[0]) / Number(credits[1]) // token balance - }), - ) - } else if (log.type === 'rebase') { - // Rebase events - let rebase = createRebaseAPY(ctx, log) - for (const address of result.owners.values()) { - if (address.rebasingOption === 'OptOut') { - continue - } - const newBalance = - Number(address.credits) / Number(log.rebasingCreditsPerToken) - const earned = newBalance - address.balance - - result.history.push( - new History({ - id: uuidv4(), - // we can't use {t.id} because it's not unique - address: address, - value: earned, - balance: newBalance, - timestamp: log.timestamp, - blockNumber: log.blockNumber, - txHash: log.txHash, - type: 'Yield', - }), - ) - - address.balance = newBalance - address.earned += earned - } - const entity = await rebase - result.rebases.push(entity) - } - } else if (log.type === 'transfer') { - await trackAddressBalances({ - address: OETH_VAULT_ADDRESS, - tokens: VAULT_HOLDINGS_ADDRESSES, - log, - fn: async ({ log, token, change }) => { - const dateId = log.timestamp.toISOString() - const { latest, current } = await getLatest( - ctx, - Vault, - result.vaults, - dateId, - ) - - let vault = current - if (!vault) { - vault = new Vault({ - id: dateId, - timestamp: log.timestamp, - blockNumber: log.blockNumber, - txHash: log.txHash, - eth: latest?.eth ?? 0n, - weth: latest?.weth ?? 0n, - rETH: latest?.rETH ?? 0n, - stETH: latest?.stETH ?? 0n, - frxETH: latest?.frxETH ?? 0n, - }) - result.vaults.push(vault) - } - - if (token === ADDRESS_ZERO) { - vault.eth += change - } else if (token === WETH_ADDRESS) { - vault.weth += change - } else if (token === RETH_ADDRESS) { - vault.rETH += change - } else if (token === STETH_ADDRESS) { - vault.stETH += change - } else if (token === FRXETH_ADDRESS) { - vault.frxETH += change - } - }, - }) - await trackAddressBalances({ - address: OETH_FRAX_STAKING_ADDRESS, - tokens: [SFRXETH_ADDRESS], - log, - fn: async ({ log, token, change }) => { - const dateId = log.timestamp.toISOString() - const { latest, current } = await getLatest( - ctx, - FraxStaking, - result.fraxStakings, - dateId, - ) - - let fraxStaking = current - if (!fraxStaking) { - fraxStaking = new FraxStaking({ - id: dateId, - timestamp: log.timestamp, - blockNumber: log.blockNumber, - txHash: log.txHash, - frxETH: latest?.frxETH ?? 0n, - }) - result.fraxStakings.push(fraxStaking) - } - - if (token === SFRXETH_ADDRESS) { - fraxStaking.frxETH += change - } - }, - }) - } else if (log.type === 'trace' && log.trace.type === 'call') { - const trace = log.trace - if ( - OETH_ADDRESS === trace.action.to && - (trace.action.sighash === oeth.functions.rebaseOptIn.sighash || - trace.action.sighash === oeth.functions.rebaseOptOut.sighash) - ) { - const address = log.trace.transaction!.from - let owner = result.owners.get(address) - if (!owner) { - owner = await createAddress(ctx, address, log.timestamp) - result.owners.set(address, owner) - } - - let rebaseOption = new RebaseOption({ - id: uuidv4(), - timestamp: log.timestamp, - blockNumber: log.blockNumber, - txHash: log.txHash, - address: owner, - status: owner.rebasingOption, - }) - result.rebaseOptions.push(rebaseOption) - if (trace.action.sighash === oeth.functions.rebaseOptIn.sighash) { - owner.rebasingOption = 'OptIn' - rebaseOption.status = 'OptIn' - } - if (trace.action.sighash === oeth.functions.rebaseOptOut.sighash) { - owner.rebasingOption = 'OptOut' - rebaseOption.status = 'OptOut' - } - } - } - } - - return result -} - -const getLatest = async ( - ctx: Context, - entity: EntityClass, - memory: T[], - id: string, -) => { - const current = memory.slice(memory.length - 1).find((v) => v.id === id) - const latest = - memory[memory.length - 1] ?? - (await ctx.store.findOne(entity as EntityClass, { - where: { id: LessThanOrEqual(id) }, - order: { id: 'desc' }, - })) - return { current, latest } -} - -const trackAddressBalances = async ({ - log, - address, - tokens, - fn, -}: { - log: RawTransfer - address: string - tokens: string[] - fn: (params: { - address: string - token: string - change: bigint - log: RawTransfer - }) => Promise -}) => { - if ( - log.value > 0n && - (log.from === address || log.to === address) && - tokens.includes(log.address) - ) { - const change = log.from === address ? -log.value : log.value - await fn({ address, token: log.address, change, log }) - } -} - -/** - * Create a new Address entity - */ -async function createAddress( - ctx: Context, - addr: string, - lastUpdated?: Date, -): Promise
{ - let isContract: boolean = false - if (addr !== '0x0000000000000000000000000000000000000000') { - isContract = - (await ctx._chain.client.call('eth_getCode', [addr, 'latest'])) !== '0x' - } - - // ctx.log.info(`New address ${rawAddress}`); - return new Address({ - id: addr, - balance: 0, - earned: 0, - credits: 0n, - isContract, - rebasingOption: isContract ? 'OptOut' : 'OptIn', - lastUpdated, - }) -} - -/** - * Create Rebase entity and set APY - */ -async function createRebaseAPY( - ctx: Context, - rebaseEvent: RawRebase, -): Promise { - const r = new Rebase({ ...rebaseEvent }) - - // use date as id for APY - const date = new Date(rebaseEvent.timestamp) - const dateId = date.toISOString().substring(0, 10) - date.setDate(date.getDate() - 1) - const lastDateId = date.toISOString().substring(0, 10) - - // use date as id for APY - date.setDate(date.getDate() - 6) - const last7daysDateId = { - key: 'apy7DayAvg', - value: date.toISOString().substring(0, 10), - } - date.setDate(date.getDate() - 14) - const last14daysDateId = { - key: 'apy14DayAvg', - value: date.toISOString().substring(0, 10), - } - date.setDate(date.getDate() - 16) - const last30daysDateId = { - key: 'apy30DayAvg', - value: date.toISOString().substring(0, 10), - } - - // get last APY to compare with current one - let lastApy = await ctx.store.findOne(APY, { - where: { id: LessThan(dateId) }, - order: { id: 'DESC' }, - }) - - // check if there is already an APY for the current date - let apy = await ctx.store.findOne(APY, { where: { id: dateId } }) - // ctx.log.info(`APY: ${dateId} ${apy}, ${lastDateId} ${lastApy}`); - // create a new APY if it doesn't exist - if (!apy) { - apy = new APY({ - id: dateId, - blockNumber: rebaseEvent.blockNumber, - timestamp: rebaseEvent.timestamp, - txHash: rebaseEvent.txHash, - rebasingCreditsPerToken: rebaseEvent.rebasingCreditsPerToken, - }) - } - // should only happen for the first rebase event - if (!lastApy) { - apy.apr = 0 - apy.apy = 0 - apy.apy7DayAvg = 0 - apy.apy14DayAvg = 0 - apy.apy30DayAvg = 0 - - await ctx.store.upsert(apy) - return r - } - - // update APY with the new rebase event - apy.blockNumber = rebaseEvent.blockNumber - apy.timestamp = rebaseEvent.timestamp - apy.txHash = rebaseEvent.txHash - apy.rebasingCreditsPerToken = rebaseEvent.rebasingCreditsPerToken - - // this should normally be 1 day but more secure to calculate it - const diffTime = Math.abs( - new Date(apy.id).getTime() - new Date(lastApy.id).getTime(), - ) - const dayDiff = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) - - apy.apr = - ((Number(lastApy.rebasingCreditsPerToken) / - Number(apy.rebasingCreditsPerToken) - - 1) * - 100 * - 365.25) / - dayDiff - const periods_per_year = 365.25 / dayDiff - apy.apy = - ((1 + apy.apr / periods_per_year / 100) ** periods_per_year - 1) * 100 - - // calculate average APY for the last 7, 14 and 30 days - for (const i of [last7daysDateId, last14daysDateId, last30daysDateId]) { - let pastAPYs = await ctx.store.findBy(APY, { - id: MoreThanOrEqual(i.value), - }) - // @ts-ignore - apy[i.key] = - pastAPYs.reduce((acc: number, cur: APY) => acc + cur.apy, apy.apy) / - (pastAPYs.length + 1) - } - - await ctx.store.upsert(apy) - return r -} From f21fbaccd98a2e5fab811c74518eafb330273da4 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Sat, 16 Sep 2023 10:30:31 -0700 Subject: [PATCH 07/31] Add MorphoAave and Dripper --- src/processors/dripper/dripper.ts | 80 +++++++++++++++++++++ src/processors/dripper/index.ts | 1 + src/processors/frax-staking/frax-staking.ts | 2 +- src/processors/morpho-aave/index.ts | 1 + src/processors/morpho-aave/morpho-aave.ts | 80 +++++++++++++++++++++ src/utils/addresses.ts | 5 ++ 6 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 src/processors/dripper/dripper.ts create mode 100644 src/processors/dripper/index.ts create mode 100644 src/processors/morpho-aave/index.ts create mode 100644 src/processors/morpho-aave/morpho-aave.ts diff --git a/src/processors/dripper/dripper.ts b/src/processors/dripper/dripper.ts new file mode 100644 index 00000000..3e7ed470 --- /dev/null +++ b/src/processors/dripper/dripper.ts @@ -0,0 +1,80 @@ +import { Context } from '../../processor' +import { Dripper } from '../../model' +import { EvmBatchProcessor } from '@subsquid/evm-processor' +import { OETH_DRIPPER_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' +import * as erc20 from '../../abi/erc20' +import { pad } from 'viem' +import { getLatest, trackAddressBalances } from '../utils' + +interface ProcessResult { + drippers: Dripper[] +} + +export const setup = (processor: EvmBatchProcessor) => { + processor.addLog({ + address: [WETH_ADDRESS], + topic0: [erc20.events.Transfer.topic], + topic1: [pad(OETH_DRIPPER_ADDRESS)], + }) + processor.addLog({ + address: [WETH_ADDRESS], + topic0: [erc20.events.Transfer.topic], + topic2: [pad(OETH_DRIPPER_ADDRESS)], + }) +} + +export const process = async (ctx: Context) => { + const result: ProcessResult = { + drippers: [], + } + + for (const block of ctx.blocks) { + for (const log of block.logs) { + await processTransfer(ctx, result, block, log) + } + } + + await ctx.store.insert(result.drippers) +} + +const processTransfer = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: Context['blocks']['0']['logs']['0'], +) => { + if (log.topics[0] === erc20.events.Transfer.topic) { + const data = erc20.events.Transfer.decode(log) + await trackAddressBalances({ + log, + data, + address: OETH_DRIPPER_ADDRESS, + tokens: [WETH_ADDRESS], + fn: async ({ log, token, change }) => { + const dateId = new Date(block.header.timestamp).toISOString() + const { latest, current } = await getLatest( + ctx, + Dripper, + result.drippers, + dateId, + ) + + let dripper = current + if (!dripper) { + dripper = new Dripper({ + id: dateId, + timestamp: new Date(block.header.timestamp), + blockNumber: block.header.height, + txHash: log.transactionHash, + weth: latest?.weth ?? 0n, + }) + result.drippers.push(dripper) + } + + if (token === WETH_ADDRESS) { + dripper.weth += change + } + }, + }) + } +} diff --git a/src/processors/dripper/index.ts b/src/processors/dripper/index.ts new file mode 100644 index 00000000..ef915095 --- /dev/null +++ b/src/processors/dripper/index.ts @@ -0,0 +1 @@ +export * from './dripper' diff --git a/src/processors/frax-staking/frax-staking.ts b/src/processors/frax-staking/frax-staking.ts index e0de32f2..916edb0e 100644 --- a/src/processors/frax-staking/frax-staking.ts +++ b/src/processors/frax-staking/frax-staking.ts @@ -1,5 +1,5 @@ import { Context } from '../../processor' -import { FraxStaking, Vault } from '../../model' +import { FraxStaking } from '../../model' import { EvmBatchProcessor } from '@subsquid/evm-processor' import { OETH_FRAX_STAKING_ADDRESS, diff --git a/src/processors/morpho-aave/index.ts b/src/processors/morpho-aave/index.ts new file mode 100644 index 00000000..253b5a6b --- /dev/null +++ b/src/processors/morpho-aave/index.ts @@ -0,0 +1 @@ +export * from './morpho-aave' diff --git a/src/processors/morpho-aave/morpho-aave.ts b/src/processors/morpho-aave/morpho-aave.ts new file mode 100644 index 00000000..847e87a5 --- /dev/null +++ b/src/processors/morpho-aave/morpho-aave.ts @@ -0,0 +1,80 @@ +import { Context } from '../../processor' +import { MorphoAave } from '../../model' +import { EvmBatchProcessor } from '@subsquid/evm-processor' +import { OETH_MORPHO_AAVE_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' +import * as erc20 from '../../abi/erc20' +import { pad } from 'viem' +import { getLatest, trackAddressBalances } from '../utils' + +interface ProcessResult { + morphoAaves: MorphoAave[] +} + +export const setup = (processor: EvmBatchProcessor) => { + processor.addLog({ + address: [WETH_ADDRESS], + topic0: [erc20.events.Transfer.topic], + topic1: [pad(OETH_MORPHO_AAVE_ADDRESS)], + }) + processor.addLog({ + address: [WETH_ADDRESS], + topic0: [erc20.events.Transfer.topic], + topic2: [pad(OETH_MORPHO_AAVE_ADDRESS)], + }) +} + +export const process = async (ctx: Context) => { + const result: ProcessResult = { + morphoAaves: [], + } + + for (const block of ctx.blocks) { + for (const log of block.logs) { + await processTransfer(ctx, result, block, log) + } + } + + await ctx.store.insert(result.morphoAaves) +} + +const processTransfer = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: Context['blocks']['0']['logs']['0'], +) => { + if (log.topics[0] === erc20.events.Transfer.topic) { + const data = erc20.events.Transfer.decode(log) + await trackAddressBalances({ + log, + data, + address: OETH_MORPHO_AAVE_ADDRESS, + tokens: [WETH_ADDRESS], + fn: async ({ log, token, change }) => { + const dateId = new Date(block.header.timestamp).toISOString() + const { latest, current } = await getLatest( + ctx, + MorphoAave, + result.morphoAaves, + dateId, + ) + + let morphoAave = current + if (!morphoAave) { + morphoAave = new MorphoAave({ + id: dateId, + timestamp: new Date(block.header.timestamp), + blockNumber: block.header.height, + txHash: log.transactionHash, + weth: latest?.weth ?? 0n, + }) + result.morphoAaves.push(morphoAave) + } + + if (token === WETH_ADDRESS) { + morphoAave.weth += change + } + }, + }) + } +} diff --git a/src/utils/addresses.ts b/src/utils/addresses.ts index f0788ca7..96605182 100644 --- a/src/utils/addresses.ts +++ b/src/utils/addresses.ts @@ -25,3 +25,8 @@ export const CONVEX_DEPOSIT = '0xf403c135812408bfbe8713b5a23a04b3d48aae31' export const OETH_FRAX_STAKING_ADDRESS = '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5' export const SFRXETH_ADDRESS = '0xac3e018457b222d93114458476f3e3416abbe38f' + +export const OETH_MORPHO_AAVE_ADDRESS = + '0xc1fc9e5ec3058921ea5025d703cbe31764756319' + +export const OETH_DRIPPER_ADDRESS = '0xc0f42f73b8f01849a2dd99753524d4ba14317eb3' From 16ee7d57b2a0740ce77ec18a9e39afce6c83f942 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Sat, 16 Sep 2023 11:55:28 -0700 Subject: [PATCH 08/31] Add MorphoAave and Dripper --- src/main.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.ts b/src/main.ts index fee4e00c..25556059 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,10 +4,14 @@ import { processor } from './processor' import * as oethProcessor from './processors/oeth' import * as vaultProcessor from './processors/vault' import * as fraxStakingProcessor from './processors/frax-staking' +import * as morphoAaveProcessor from './processors/morpho-aave' +import * as dripperProcessor from './processors/dripper' oethProcessor.setup(processor) vaultProcessor.setup(processor) fraxStakingProcessor.setup(processor) +morphoAaveProcessor.setup(processor) +dripperProcessor.setup(processor) processor.run(new TypeormDatabase({ supportHotBlocks: true }), async (ctx) => { let start = Date.now() @@ -18,5 +22,7 @@ processor.run(new TypeormDatabase({ supportHotBlocks: true }), async (ctx) => { oethProcessor.process(ctx).then(time('oethProcessor')), // This processor is slow. Likely due to the high quantity of address balance lookups. vaultProcessor.process(ctx), fraxStakingProcessor.process(ctx), + morphoAaveProcessor.process(ctx), + dripperProcessor.process(ctx), ]) }) From a14a992b6b141306f9820c2b88f5ef0abaf71271 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Sat, 16 Sep 2023 14:08:04 -0700 Subject: [PATCH 09/31] optimize and simplify --- src/main.ts | 30 ++++-------- src/processor.ts | 25 +++++++++- src/processors/oeth/oeth.ts | 92 +++++++++++++++++++++--------------- src/processors/oeth/utils.ts | 44 +++++++++-------- 4 files changed, 112 insertions(+), 79 deletions(-) diff --git a/src/main.ts b/src/main.ts index 25556059..d50216fe 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,4 @@ -import { TypeormDatabase } from '@subsquid/typeorm-store' -import { processor } from './processor' +import { run } from './processor' import * as oethProcessor from './processors/oeth' import * as vaultProcessor from './processors/vault' @@ -7,22 +6,11 @@ import * as fraxStakingProcessor from './processors/frax-staking' import * as morphoAaveProcessor from './processors/morpho-aave' import * as dripperProcessor from './processors/dripper' -oethProcessor.setup(processor) -vaultProcessor.setup(processor) -fraxStakingProcessor.setup(processor) -morphoAaveProcessor.setup(processor) -dripperProcessor.setup(processor) - -processor.run(new TypeormDatabase({ supportHotBlocks: true }), async (ctx) => { - let start = Date.now() - const time = (name: string) => () => - ctx.log.info(`${name} ${Date.now() - start}ms`) - // The idea is that these processors have zero dependencies on one another and can be processed asynchronously. - await Promise.all([ - oethProcessor.process(ctx).then(time('oethProcessor')), // This processor is slow. Likely due to the high quantity of address balance lookups. - vaultProcessor.process(ctx), - fraxStakingProcessor.process(ctx), - morphoAaveProcessor.process(ctx), - dripperProcessor.process(ctx), - ]) -}) +// The idea is that these processors have zero dependencies on one another and can be processed asynchronously. +run([ + oethProcessor, + vaultProcessor, + fraxStakingProcessor, + morphoAaveProcessor, + dripperProcessor, +]) diff --git a/src/processor.ts b/src/processor.ts index 856c49e1..db2b7e72 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -7,7 +7,7 @@ import { Log as _Log, Transaction as _Transaction, } from '@subsquid/evm-processor' -import { Store } from '@subsquid/typeorm-store' +import { Store, TypeormDatabase } from '@subsquid/typeorm-store' export const processor = new EvmBatchProcessor() .setDataSource({ @@ -63,6 +63,29 @@ export const processor = new EvmBatchProcessor() ), }) +export const run = ( + processors: { + name?: string + setup: (p: typeof processor) => void + process: (ctx: Context) => Promise + }[], +) => { + processors.forEach((p) => p.setup(processor)) + processor.run( + new TypeormDatabase({ supportHotBlocks: true }), + async (ctx) => { + let start = Date.now() + const time = (name: string) => () => + ctx.log.info(`${name} ${Date.now() - start}ms`) + await Promise.all( + processors.map((p, index) => + p.process(ctx).then(time(p.name ?? `p${index}`)), + ), + ) + }, + ) +} + export type Fields = EvmBatchProcessorFields export type Context = DataHandlerContext export type Block = BlockHeader diff --git a/src/processors/oeth/oeth.ts b/src/processors/oeth/oeth.ts index c1f07f29..94a312b6 100644 --- a/src/processors/oeth/oeth.ts +++ b/src/processors/oeth/oeth.ts @@ -1,5 +1,5 @@ import { Context } from '../../processor' -import { Address, History, Rebase, RebaseOption } from '../../model' +import { Address, APY, History, Rebase, RebaseOption } from '../../model' import { EvmBatchProcessor } from '@subsquid/evm-processor' import * as oeth from '../../abi/oeth' import { ADDRESS_ZERO, OETH_ADDRESS } from '../../utils/addresses' @@ -26,22 +26,33 @@ export const setup = (processor: EvmBatchProcessor) => { } interface ProcessResult { + initialized: boolean + initialize: () => Promise history: History[] rebases: Rebase[] - owners: Map rebaseOptions: RebaseOption[] + apies: APY[] + owners: Map } export const process = async (ctx: Context) => { const result: ProcessResult = { + initialized: false, + // Saves ~5ms init time if we have no filter matches. + initialize: async () => { + if (result.initialized) return + result.initialized = true + result.owners = await ctx.store + .find(Address) + .then((q) => new Map(q.map((i) => [i.id, i]))) + }, history: [], rebases: [], rebaseOptions: [], + apies: [], // get all addresses from the database. // we need this because we increase their balance based on rebase events - owners: await ctx.store - .find(Address) - .then((q) => new Map(q.map((i) => [i.id, i]))), + owners: undefined as unknown as Map, // We want to error if someone forgets to initialize. } for (const block of ctx.blocks) { @@ -54,7 +65,10 @@ export const process = async (ctx: Context) => { } } - await ctx.store.upsert([...result.owners.values()]) + if (result.owners) { + await ctx.store.upsert([...result.owners.values()]) + } + await ctx.store.upsert(result.apies) await ctx.store.insert(result.history) await ctx.store.insert(result.rebases) await ctx.store.insert(result.rebaseOptions) @@ -67,6 +81,7 @@ const processTransfer = async ( log: Context['blocks']['0']['logs']['0'], ) => { if (log.topics[0] === oeth.events.Transfer.topic) { + await result.initialize() const data = oeth.events.Transfer.decode(log) // Bind the token contract to the block number const token = new oeth.Contract(ctx, block.header, OETH_ADDRESS) @@ -124,9 +139,10 @@ const processTotalSupplyUpdatedHighres = async ( log: Context['blocks']['0']['logs']['0'], ) => { if (log.topics[0] === oeth.events.TotalSupplyUpdatedHighres.topic) { + await result.initialize() const data = oeth.events.TotalSupplyUpdatedHighres.decode(log) // Rebase events - let rebase = createRebaseAPY(ctx, block, log, data) + let rebase = createRebaseAPY(ctx, result.apies, block, log, data) for (const address of result.owners.values()) { if (address.rebasingOption === 'OptOut') { continue @@ -163,38 +179,38 @@ const processRebaseOpt = async ( block: Context['blocks']['0'], trace: Context['blocks']['0']['traces']['0'], ) => { - const timestamp = new Date(block.header.timestamp) - const blockNumber = block.header.height - if (trace.type === 'call') { - if ( - OETH_ADDRESS === trace.action.to && - (trace.action.sighash === oeth.functions.rebaseOptIn.sighash || - trace.action.sighash === oeth.functions.rebaseOptOut.sighash) - ) { - const address = trace.transaction!.from - let owner = result.owners.get(address) - if (!owner) { - owner = await createAddress(ctx, address, timestamp) - result.owners.set(address, owner) - } + if ( + trace.type === 'call' && + OETH_ADDRESS === trace.action.to && + (trace.action.sighash === oeth.functions.rebaseOptIn.sighash || + trace.action.sighash === oeth.functions.rebaseOptOut.sighash) + ) { + await result.initialize() + const timestamp = new Date(block.header.timestamp) + const blockNumber = block.header.height + const address = trace.transaction!.from + let owner = result.owners.get(address) + if (!owner) { + owner = await createAddress(ctx, address, timestamp) + result.owners.set(address, owner) + } - let rebaseOption = new RebaseOption({ - id: uuidv4(), - timestamp, - blockNumber, - txHash: trace.transaction?.hash, - address: owner, - status: owner.rebasingOption, - }) - result.rebaseOptions.push(rebaseOption) - if (trace.action.sighash === oeth.functions.rebaseOptIn.sighash) { - owner.rebasingOption = 'OptIn' - rebaseOption.status = 'OptIn' - } - if (trace.action.sighash === oeth.functions.rebaseOptOut.sighash) { - owner.rebasingOption = 'OptOut' - rebaseOption.status = 'OptOut' - } + let rebaseOption = new RebaseOption({ + id: uuidv4(), + timestamp, + blockNumber, + txHash: trace.transaction?.hash, + address: owner, + status: owner.rebasingOption, + }) + result.rebaseOptions.push(rebaseOption) + if (trace.action.sighash === oeth.functions.rebaseOptIn.sighash) { + owner.rebasingOption = 'OptIn' + rebaseOption.status = 'OptIn' + } + if (trace.action.sighash === oeth.functions.rebaseOptOut.sighash) { + owner.rebasingOption = 'OptOut' + rebaseOption.status = 'OptOut' } } } diff --git a/src/processors/oeth/utils.ts b/src/processors/oeth/utils.ts index aab30985..9c67822e 100644 --- a/src/processors/oeth/utils.ts +++ b/src/processors/oeth/utils.ts @@ -34,6 +34,7 @@ export async function createAddress( */ export async function createRebaseAPY( ctx: Context, + apies: APY[], block: Context['blocks']['0'], log: Context['blocks']['0']['logs']['0'], rebaseEvent: ReturnType, @@ -57,28 +58,32 @@ export async function createRebaseAPY( // use date as id for APY date.setDate(date.getDate() - 6) const last7daysDateId = { - key: 'apy7DayAvg', + key: 'apy7DayAvg' as const, value: date.toISOString().substring(0, 10), } date.setDate(date.getDate() - 14) const last14daysDateId = { - key: 'apy14DayAvg', + key: 'apy14DayAvg' as const, value: date.toISOString().substring(0, 10), } date.setDate(date.getDate() - 16) const last30daysDateId = { - key: 'apy30DayAvg', + key: 'apy30DayAvg' as const, value: date.toISOString().substring(0, 10), } // get last APY to compare with current one - let lastApy = await ctx.store.findOne(APY, { - where: { id: LessThan(dateId) }, - order: { id: 'DESC' }, - }) + let lastApy = + apies.slice(apies.length - 2).find((apy) => apy.id < dateId) ?? + (await ctx.store.findOne(APY, { + where: { id: LessThan(dateId) }, + order: { id: 'DESC' }, + })) // check if there is already an APY for the current date - let apy = await ctx.store.findOne(APY, { where: { id: dateId } }) + let apy = + apies.slice(apies.length - 1).find((apy) => apy.id === dateId) ?? + (await ctx.store.findOne(APY, { where: { id: dateId } })) // ctx.log.info(`APY: ${dateId} ${apy}, ${lastDateId} ${lastApy}`); // create a new APY if it doesn't exist if (!apy) { @@ -101,7 +106,7 @@ export async function createRebaseAPY( apy.apy14DayAvg = 0 apy.apy30DayAvg = 0 - await ctx.store.upsert(apy) + apies.push(apy) return rebase } @@ -129,16 +134,17 @@ export async function createRebaseAPY( ((1 + apy.apr / periods_per_year / 100) ** periods_per_year - 1) * 100 // calculate average APY for the last 7, 14 and 30 days - for (const i of [last7daysDateId, last14daysDateId, last30daysDateId]) { - let pastAPYs = await ctx.store.findBy(APY, { - id: MoreThanOrEqual(i.value), - }) - // @ts-ignore - apy[i.key] = - pastAPYs.reduce((acc: number, cur: APY) => acc + cur.apy, apy.apy) / - (pastAPYs.length + 1) - } + await Promise.all( + [last7daysDateId, last14daysDateId, last30daysDateId].map(async (i) => { + const pastAPYs = await ctx.store.findBy(APY, { + id: MoreThanOrEqual(i.value), + }) + apy![i.key] = + pastAPYs.reduce((acc: number, cur: APY) => acc + cur.apy, apy!.apy) / + (pastAPYs.length + 1) + }), + ) - await ctx.store.upsert(apy) + apies.push(apy) return rebase } From 29f398e588e06693617c5abbe80d453ebcba6bc8 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Sat, 16 Sep 2023 14:10:39 -0700 Subject: [PATCH 10/31] optimize and simplify --- src/processors/oeth/utils.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/processors/oeth/utils.ts b/src/processors/oeth/utils.ts index 9c67822e..7498391d 100644 --- a/src/processors/oeth/utils.ts +++ b/src/processors/oeth/utils.ts @@ -94,6 +94,7 @@ export async function createRebaseAPY( txHash: log.transactionHash, rebasingCreditsPerToken: rebaseEvent.rebasingCreditsPerToken, }) + apies.push(apy) } rebase.apy = apy @@ -106,7 +107,6 @@ export async function createRebaseAPY( apy.apy14DayAvg = 0 apy.apy30DayAvg = 0 - apies.push(apy) return rebase } @@ -145,6 +145,5 @@ export async function createRebaseAPY( }), ) - apies.push(apy) return rebase } From 08cecc1ab2818b297516786c2742e7ce64561b5a Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Sat, 16 Sep 2023 15:06:06 -0700 Subject: [PATCH 11/31] debug underflow issue --- src/processor.ts | 12 +++++++----- src/processors/dripper/dripper.ts | 2 -- src/processors/frax-staking/frax-staking.ts | 2 -- src/processors/morpho-aave/morpho-aave.ts | 3 +-- src/processors/oeth/oeth.ts | 2 ++ src/processors/utils.ts | 16 +++++++++------- src/processors/vault/vault.ts | 2 -- 7 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/processor.ts b/src/processor.ts index db2b7e72..3a9963c5 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -56,11 +56,13 @@ export const processor = new EvmBatchProcessor() }, }) .setBlockRange({ - from: Math.min( - 16933090, // OETH: https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 - 17067001, // OETH Vault: https://etherscan.io/tx/0x0b81a0e2b7d824ce493465221218b9c79b4a9478c0bb7760b386be240f5985b8 - 17067223, // OETH Frax Staking: https://etherscan.io/tx/0x422903d2be38a264423a77e8472d365fa567f5bca12ea2403dfaee1b305c7da4 - ), + from: + // 18150356 ?? // Malformed Transfer logs show up around here + Math.min( + 16933090, // OETH: https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 + 17067001, // OETH Vault: https://etherscan.io/tx/0x0b81a0e2b7d824ce493465221218b9c79b4a9478c0bb7760b386be240f5985b8 + 17067223, // OETH Frax Staking: https://etherscan.io/tx/0x422903d2be38a264423a77e8472d365fa567f5bca12ea2403dfaee1b305c7da4 + ), }) export const run = ( diff --git a/src/processors/dripper/dripper.ts b/src/processors/dripper/dripper.ts index 3e7ed470..465f8a2a 100644 --- a/src/processors/dripper/dripper.ts +++ b/src/processors/dripper/dripper.ts @@ -44,10 +44,8 @@ const processTransfer = async ( log: Context['blocks']['0']['logs']['0'], ) => { if (log.topics[0] === erc20.events.Transfer.topic) { - const data = erc20.events.Transfer.decode(log) await trackAddressBalances({ log, - data, address: OETH_DRIPPER_ADDRESS, tokens: [WETH_ADDRESS], fn: async ({ log, token, change }) => { diff --git a/src/processors/frax-staking/frax-staking.ts b/src/processors/frax-staking/frax-staking.ts index 916edb0e..e34c26cf 100644 --- a/src/processors/frax-staking/frax-staking.ts +++ b/src/processors/frax-staking/frax-staking.ts @@ -47,10 +47,8 @@ const processTransfer = async ( log: Context['blocks']['0']['logs']['0'], ) => { if (log.topics[0] === erc20.events.Transfer.topic) { - const data = erc20.events.Transfer.decode(log) await trackAddressBalances({ log, - data, address: OETH_FRAX_STAKING_ADDRESS, tokens: [SFRXETH_ADDRESS], fn: async ({ log, token, change }) => { diff --git a/src/processors/morpho-aave/morpho-aave.ts b/src/processors/morpho-aave/morpho-aave.ts index 847e87a5..9d721b7b 100644 --- a/src/processors/morpho-aave/morpho-aave.ts +++ b/src/processors/morpho-aave/morpho-aave.ts @@ -44,10 +44,9 @@ const processTransfer = async ( log: Context['blocks']['0']['logs']['0'], ) => { if (log.topics[0] === erc20.events.Transfer.topic) { - const data = erc20.events.Transfer.decode(log) + if (log.data === '0x') log.data = '0x00' await trackAddressBalances({ log, - data, address: OETH_MORPHO_AAVE_ADDRESS, tokens: [WETH_ADDRESS], fn: async ({ log, token, change }) => { diff --git a/src/processors/oeth/oeth.ts b/src/processors/oeth/oeth.ts index 94a312b6..36c9fd19 100644 --- a/src/processors/oeth/oeth.ts +++ b/src/processors/oeth/oeth.ts @@ -80,6 +80,7 @@ const processTransfer = async ( block: Context['blocks']['0'], log: Context['blocks']['0']['logs']['0'], ) => { + if (log.address !== OETH_ADDRESS) return if (log.topics[0] === oeth.events.Transfer.topic) { await result.initialize() const data = oeth.events.Transfer.decode(log) @@ -138,6 +139,7 @@ const processTotalSupplyUpdatedHighres = async ( block: Context['blocks']['0'], log: Context['blocks']['0']['logs']['0'], ) => { + if (log.address !== OETH_ADDRESS) return if (log.topics[0] === oeth.events.TotalSupplyUpdatedHighres.topic) { await result.initialize() const data = oeth.events.TotalSupplyUpdatedHighres.decode(log) diff --git a/src/processors/utils.ts b/src/processors/utils.ts index 3cfec6e3..3f368f4b 100644 --- a/src/processors/utils.ts +++ b/src/processors/utils.ts @@ -2,16 +2,15 @@ import { Context } from '../processor' import * as erc20 from '../abi/erc20' import { Entity, EntityClass } from '@subsquid/typeorm-store' import { LessThanOrEqual } from 'typeorm' +import { pad } from 'viem' export const trackAddressBalances = async ({ log, - data, address, tokens, fn, }: { log: Context['blocks']['0']['logs']['0'] - data: ReturnType address: string tokens: string[] fn: (params: { @@ -22,14 +21,17 @@ export const trackAddressBalances = async ({ data: ReturnType }) => Promise }) => { + const paddedAddress = pad(address as `0x${string}`) if ( - data.value > 0n && - (data.from.toLowerCase() === address || - data.to.toLowerCase() === address) && + (log.topics[1].toLowerCase() === paddedAddress || + log.topics[2].toLowerCase() === paddedAddress) && tokens.includes(log.address) ) { - const change = data.from === address ? -data.value : data.value - await fn({ address, token: log.address, change, log, data }) + const data = erc20.events.Transfer.decode(log) + if (data.value > 0n) { + const change = data.from === address ? -data.value : data.value + await fn({ address, token: log.address, change, log, data }) + } } } diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts index 83938258..8d571d68 100644 --- a/src/processors/vault/vault.ts +++ b/src/processors/vault/vault.ts @@ -52,10 +52,8 @@ const processTransfer = async ( log: Context['blocks']['0']['logs']['0'], ) => { if (log.topics[0] === erc20.events.Transfer.topic) { - const data = erc20.events.Transfer.decode(log) await trackAddressBalances({ log, - data, address: OETH_VAULT_ADDRESS, tokens: VAULT_HOLDINGS_ADDRESSES, fn: async ({ log, token, change }) => { From 95b16ff8feb1e7c688d740445d6a2336a5c9f11e Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Sat, 16 Sep 2023 15:58:42 -0700 Subject: [PATCH 12/31] fix --- src/processors/morpho-aave/morpho-aave.ts | 1 - src/processors/utils.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/processors/morpho-aave/morpho-aave.ts b/src/processors/morpho-aave/morpho-aave.ts index 9d721b7b..107a456b 100644 --- a/src/processors/morpho-aave/morpho-aave.ts +++ b/src/processors/morpho-aave/morpho-aave.ts @@ -44,7 +44,6 @@ const processTransfer = async ( log: Context['blocks']['0']['logs']['0'], ) => { if (log.topics[0] === erc20.events.Transfer.topic) { - if (log.data === '0x') log.data = '0x00' await trackAddressBalances({ log, address: OETH_MORPHO_AAVE_ADDRESS, diff --git a/src/processors/utils.ts b/src/processors/utils.ts index 3f368f4b..accacba8 100644 --- a/src/processors/utils.ts +++ b/src/processors/utils.ts @@ -23,8 +23,8 @@ export const trackAddressBalances = async ({ }) => { const paddedAddress = pad(address as `0x${string}`) if ( - (log.topics[1].toLowerCase() === paddedAddress || - log.topics[2].toLowerCase() === paddedAddress) && + (log.topics[1]?.toLowerCase() === paddedAddress || + log.topics[2]?.toLowerCase() === paddedAddress) && tokens.includes(log.address) ) { const data = erc20.events.Transfer.decode(log) From b5618565cf90ab1d4fe4da68b7693d06eb94c916 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Sat, 16 Sep 2023 16:56:43 -0700 Subject: [PATCH 13/31] fix --- src/processors/utils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/processors/utils.ts b/src/processors/utils.ts index accacba8..c9aff3dd 100644 --- a/src/processors/utils.ts +++ b/src/processors/utils.ts @@ -25,11 +25,12 @@ export const trackAddressBalances = async ({ if ( (log.topics[1]?.toLowerCase() === paddedAddress || log.topics[2]?.toLowerCase() === paddedAddress) && - tokens.includes(log.address) + tokens.includes(log.address.toLowerCase()) ) { const data = erc20.events.Transfer.decode(log) if (data.value > 0n) { - const change = data.from === address ? -data.value : data.value + const change = + data.from.toLowerCase() === address ? -data.value : data.value await fn({ address, token: log.address, change, log, data }) } } From ebe4c661da29227eb9336df4d994794eaef1c1ba Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Mon, 18 Sep 2023 09:34:53 -0700 Subject: [PATCH 14/31] use `.prettierrc` --- .prettierrc | 13 ++++++++++--- package.json | 5 ----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.prettierrc b/.prettierrc index 78f1e5d2..49841bef 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,9 +2,16 @@ "singleQuote": true, "trailingComma": "all", "tabWidth": 2, - "semi": true, - "importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"], + "semi": false, + "importOrder": [ + "^@core/(.*)$", + "^@server/(.*)$", + "^@ui/(.*)$", + "^[./]" + ], "importOrderSeparation": true, "importOrderSortSpecifiers": true, - "plugins": ["@trivago/prettier-plugin-sort-imports"] + "plugins": [ + "@trivago/prettier-plugin-sort-imports" + ] } diff --git a/package.json b/package.json index d705612a..310301ed 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,5 @@ "@types/uuid": "^9.0.2", "prettier": "^3.0.3", "typescript": "~5.1.3" - }, - "prettier": { - "semi": false, - "singleQuote": true, - "trailingComma": "all" } } From 245386f0da094b18b6f3224ad255dae4cd6623be Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Mon, 18 Sep 2023 09:41:39 -0700 Subject: [PATCH 15/31] add & run prettier scripts --- abi/erc20.json | 2 +- abi/oeth.json | 2 +- package.json | 4 +++- src/main.ts | 7 +++---- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/abi/erc20.json b/abi/erc20.json index 3b0ab2f1..405d6b36 100644 --- a/abi/erc20.json +++ b/abi/erc20.json @@ -219,4 +219,4 @@ "name": "Transfer", "type": "event" } -] \ No newline at end of file +] diff --git a/abi/oeth.json b/abi/oeth.json index 71856e11..badd78dc 100644 --- a/abi/oeth.json +++ b/abi/oeth.json @@ -670,4 +670,4 @@ "stateMutability": "view", "type": "function" } -] \ No newline at end of file +] diff --git a/package.json b/package.json index 310301ed..2f99eef4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,9 @@ "name": "origin-squid", "private": true, "scripts": { - "build": "rm -rf lib && tsc" + "build": "rm -rf lib && tsc", + "prettier-check": "prettier --check **/*.ts **/*.json", + "prettier-fix": "prettier --write **/*.ts **/*.json" }, "dependencies": { "@subsquid/archive-registry": "^3.1.0", diff --git a/src/main.ts b/src/main.ts index d50216fe..abae6519 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,9 @@ import { run } from './processor' - -import * as oethProcessor from './processors/oeth' -import * as vaultProcessor from './processors/vault' +import * as dripperProcessor from './processors/dripper' import * as fraxStakingProcessor from './processors/frax-staking' import * as morphoAaveProcessor from './processors/morpho-aave' -import * as dripperProcessor from './processors/dripper' +import * as oethProcessor from './processors/oeth' +import * as vaultProcessor from './processors/vault' // The idea is that these processors have zero dependencies on one another and can be processed asynchronously. run([ From 16cf512e3aa8776cba15e38090963e61cdca2d8f Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Mon, 18 Sep 2023 10:14:12 -0700 Subject: [PATCH 16/31] define the `from` in each of our sub processors --- src/processor.ts | 11 ++--------- src/processors/dripper/dripper.ts | 11 +++++++---- src/processors/frax-staking/frax-staking.ts | 11 +++++++---- src/processors/morpho-aave/morpho-aave.ts | 11 +++++++---- src/processors/oeth/oeth.ts | 9 ++++++--- src/processors/vault/vault.ts | 11 +++++++---- 6 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/processor.ts b/src/processor.ts index 3a9963c5..54716614 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -55,23 +55,16 @@ export const processor = new EvmBatchProcessor() // action: true, }, }) - .setBlockRange({ - from: - // 18150356 ?? // Malformed Transfer logs show up around here - Math.min( - 16933090, // OETH: https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 - 17067001, // OETH Vault: https://etherscan.io/tx/0x0b81a0e2b7d824ce493465221218b9c79b4a9478c0bb7760b386be240f5985b8 - 17067223, // OETH Frax Staking: https://etherscan.io/tx/0x422903d2be38a264423a77e8472d365fa567f5bca12ea2403dfaee1b305c7da4 - ), - }) export const run = ( processors: { name?: string + from: number setup: (p: typeof processor) => void process: (ctx: Context) => Promise }[], ) => { + processor.setBlockRange({ from: Math.min(...processors.map((p) => p.from)) }) processors.forEach((p) => p.setup(processor)) processor.run( new TypeormDatabase({ supportHotBlocks: true }), diff --git a/src/processors/dripper/dripper.ts b/src/processors/dripper/dripper.ts index 465f8a2a..5dad5654 100644 --- a/src/processors/dripper/dripper.ts +++ b/src/processors/dripper/dripper.ts @@ -1,15 +1,18 @@ -import { Context } from '../../processor' -import { Dripper } from '../../model' import { EvmBatchProcessor } from '@subsquid/evm-processor' -import { OETH_DRIPPER_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' -import * as erc20 from '../../abi/erc20' import { pad } from 'viem' + +import * as erc20 from '../../abi/erc20' +import { Dripper } from '../../model' +import { Context } from '../../processor' +import { OETH_DRIPPER_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' import { getLatest, trackAddressBalances } from '../utils' interface ProcessResult { drippers: Dripper[] } +export const from = 17067704 // https://etherscan.io/tx/0x8e4217c5883891816b9035100b0b1342492f8e618029bf022bdc85bf9aa330f2 + export const setup = (processor: EvmBatchProcessor) => { processor.addLog({ address: [WETH_ADDRESS], diff --git a/src/processors/frax-staking/frax-staking.ts b/src/processors/frax-staking/frax-staking.ts index e34c26cf..32e8435a 100644 --- a/src/processors/frax-staking/frax-staking.ts +++ b/src/processors/frax-staking/frax-staking.ts @@ -1,18 +1,21 @@ -import { Context } from '../../processor' -import { FraxStaking } from '../../model' import { EvmBatchProcessor } from '@subsquid/evm-processor' +import { pad } from 'viem' + +import * as erc20 from '../../abi/erc20' +import { FraxStaking } from '../../model' +import { Context } from '../../processor' import { OETH_FRAX_STAKING_ADDRESS, SFRXETH_ADDRESS, } from '../../utils/addresses' -import * as erc20 from '../../abi/erc20' -import { pad } from 'viem' import { getLatest, trackAddressBalances } from '../utils' interface ProcessResult { fraxStakings: FraxStaking[] } +export const from = 17067223 // https://etherscan.io/tx/0x422903d2be38a264423a77e8472d365fa567f5bca12ea2403dfaee1b305c7da4 + export const setup = (processor: EvmBatchProcessor) => { processor.addLog({ address: [SFRXETH_ADDRESS], diff --git a/src/processors/morpho-aave/morpho-aave.ts b/src/processors/morpho-aave/morpho-aave.ts index 107a456b..b93ab9df 100644 --- a/src/processors/morpho-aave/morpho-aave.ts +++ b/src/processors/morpho-aave/morpho-aave.ts @@ -1,15 +1,18 @@ -import { Context } from '../../processor' -import { MorphoAave } from '../../model' import { EvmBatchProcessor } from '@subsquid/evm-processor' -import { OETH_MORPHO_AAVE_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' -import * as erc20 from '../../abi/erc20' import { pad } from 'viem' + +import * as erc20 from '../../abi/erc20' +import { MorphoAave } from '../../model' +import { Context } from '../../processor' +import { OETH_MORPHO_AAVE_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' import { getLatest, trackAddressBalances } from '../utils' interface ProcessResult { morphoAaves: MorphoAave[] } +export const from = 17367102 // https://etherscan.io/tx/0x15294349d566059bb37e200b2dba45428e237d6050de11862aa57c7875476526 + export const setup = (processor: EvmBatchProcessor) => { processor.addLog({ address: [WETH_ADDRESS], diff --git a/src/processors/oeth/oeth.ts b/src/processors/oeth/oeth.ts index 36c9fd19..659fbad0 100644 --- a/src/processors/oeth/oeth.ts +++ b/src/processors/oeth/oeth.ts @@ -1,11 +1,14 @@ -import { Context } from '../../processor' -import { Address, APY, History, Rebase, RebaseOption } from '../../model' import { EvmBatchProcessor } from '@subsquid/evm-processor' +import { v4 as uuidv4 } from 'uuid' + import * as oeth from '../../abi/oeth' +import { APY, Address, History, Rebase, RebaseOption } from '../../model' +import { Context } from '../../processor' import { ADDRESS_ZERO, OETH_ADDRESS } from '../../utils/addresses' -import { v4 as uuidv4 } from 'uuid' import { createAddress, createRebaseAPY } from './utils' +export const from = 16933090 // https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 + export const setup = (processor: EvmBatchProcessor) => { processor.addTrace({ type: ['call', 'delegatecall'], diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts index 8d571d68..057541b9 100644 --- a/src/processors/vault/vault.ts +++ b/src/processors/vault/vault.ts @@ -1,6 +1,9 @@ -import { Context } from '../../processor' -import { Vault } from '../../model' import { EvmBatchProcessor } from '@subsquid/evm-processor' +import { pad } from 'viem' + +import * as erc20 from '../../abi/erc20' +import { Vault } from '../../model' +import { Context } from '../../processor' import { ADDRESS_ZERO, FRXETH_ADDRESS, @@ -10,14 +13,14 @@ import { VAULT_HOLDINGS_ADDRESSES, WETH_ADDRESS, } from '../../utils/addresses' -import * as erc20 from '../../abi/erc20' -import { pad } from 'viem' import { getLatest, trackAddressBalances } from '../utils' interface ProcessResult { vaults: Vault[] } +export const from = 17067001 // https://etherscan.io/tx/0x0b81a0e2b7d824ce493465221218b9c79b4a9478c0bb7760b386be240f5985b8 + export const setup = (processor: EvmBatchProcessor) => { processor.addLog({ address: VAULT_HOLDINGS_ADDRESSES, From 0ca299ab5bf7c1b0b45e18bc8c09e456818a2e1f Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Mon, 18 Sep 2023 19:59:38 -0700 Subject: [PATCH 17/31] work on curve lp token --- abi/curve_lp_token.json | 1186 +++++++++++++++ ...08555614-Data.js => 1695072381593-Data.js} | 22 +- schema.graphql | 8 +- src/abi/curve_lp_token.abi.ts | 1271 +++++++++++++++++ src/abi/curve_lp_token.ts | 341 +++++ src/main.ts | 19 +- src/model/generated/curve.model.ts | 30 - .../generated/financialStatement.model.ts | 6 +- src/model/generated/index.ts | 2 +- src/processor.ts | 3 +- src/processors/curve-lp/curve-lp.ts | 260 ++++ src/processors/curve-lp/index.ts | 1 + src/processors/vault/vault.ts | 107 +- src/utils/addresses.ts | 9 +- 14 files changed, 3171 insertions(+), 94 deletions(-) create mode 100644 abi/curve_lp_token.json rename db/migrations/{1694808555614-Data.js => 1695072381593-Data.js} (91%) create mode 100644 src/abi/curve_lp_token.abi.ts create mode 100644 src/abi/curve_lp_token.ts delete mode 100644 src/model/generated/curve.model.ts create mode 100644 src/processors/curve-lp/curve-lp.ts create mode 100644 src/processors/curve-lp/index.ts diff --git a/abi/curve_lp_token.json b/abi/curve_lp_token.json new file mode 100644 index 00000000..33c1da44 --- /dev/null +++ b/abi/curve_lp_token.json @@ -0,0 +1,1186 @@ +[ + { + "name": "Transfer", + "inputs": [ + { + "name": "sender", + "type": "address", + "indexed": true + }, + { + "name": "receiver", + "type": "address", + "indexed": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "Approval", + "inputs": [ + { + "name": "owner", + "type": "address", + "indexed": true + }, + { + "name": "spender", + "type": "address", + "indexed": true + }, + { + "name": "value", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "TokenExchange", + "inputs": [ + { + "name": "buyer", + "type": "address", + "indexed": true + }, + { + "name": "sold_id", + "type": "int128", + "indexed": false + }, + { + "name": "tokens_sold", + "type": "uint256", + "indexed": false + }, + { + "name": "bought_id", + "type": "int128", + "indexed": false + }, + { + "name": "tokens_bought", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "AddLiquidity", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "token_amounts", + "type": "uint256[2]", + "indexed": false + }, + { + "name": "fees", + "type": "uint256[2]", + "indexed": false + }, + { + "name": "invariant", + "type": "uint256", + "indexed": false + }, + { + "name": "token_supply", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "RemoveLiquidity", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "token_amounts", + "type": "uint256[2]", + "indexed": false + }, + { + "name": "fees", + "type": "uint256[2]", + "indexed": false + }, + { + "name": "token_supply", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "RemoveLiquidityOne", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "token_amount", + "type": "uint256", + "indexed": false + }, + { + "name": "coin_amount", + "type": "uint256", + "indexed": false + }, + { + "name": "token_supply", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "RemoveLiquidityImbalance", + "inputs": [ + { + "name": "provider", + "type": "address", + "indexed": true + }, + { + "name": "token_amounts", + "type": "uint256[2]", + "indexed": false + }, + { + "name": "fees", + "type": "uint256[2]", + "indexed": false + }, + { + "name": "invariant", + "type": "uint256", + "indexed": false + }, + { + "name": "token_supply", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "RampA", + "inputs": [ + { + "name": "old_A", + "type": "uint256", + "indexed": false + }, + { + "name": "new_A", + "type": "uint256", + "indexed": false + }, + { + "name": "initial_time", + "type": "uint256", + "indexed": false + }, + { + "name": "future_time", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "StopRampA", + "inputs": [ + { + "name": "A", + "type": "uint256", + "indexed": false + }, + { + "name": "t", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "CommitNewFee", + "inputs": [ + { + "name": "new_fee", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "name": "ApplyNewFee", + "inputs": [ + { + "name": "fee", + "type": "uint256", + "indexed": false + } + ], + "anonymous": false, + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "constructor", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "initialize", + "inputs": [ + { + "name": "_name", + "type": "string" + }, + { + "name": "_symbol", + "type": "string" + }, + { + "name": "_coins", + "type": "address[4]" + }, + { + "name": "_rate_multipliers", + "type": "uint256[4]" + }, + { + "name": "_A", + "type": "uint256" + }, + { + "name": "_fee", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "view", + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transfer", + "inputs": [ + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "transferFrom", + "inputs": [ + { + "name": "_from", + "type": "address" + }, + { + "name": "_to", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "approve", + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "permit", + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_deadline", + "type": "uint256" + }, + { + "name": "_v", + "type": "uint8" + }, + { + "name": "_r", + "type": "bytes32" + }, + { + "name": "_s", + "type": "bytes32" + } + ], + "outputs": [ + { + "name": "", + "type": "bool" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "last_price", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "ema_price", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "get_balances", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256[2]" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "admin_fee", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "A", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "A_precise", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "get_p", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "price_oracle", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "get_virtual_price", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "calc_token_amount", + "inputs": [ + { + "name": "_amounts", + "type": "uint256[2]" + }, + { + "name": "_is_deposit", + "type": "bool" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "payable", + "type": "function", + "name": "add_liquidity", + "inputs": [ + { + "name": "_amounts", + "type": "uint256[2]" + }, + { + "name": "_min_mint_amount", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "payable", + "type": "function", + "name": "add_liquidity", + "inputs": [ + { + "name": "_amounts", + "type": "uint256[2]" + }, + { + "name": "_min_mint_amount", + "type": "uint256" + }, + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "get_dy", + "inputs": [ + { + "name": "i", + "type": "int128" + }, + { + "name": "j", + "type": "int128" + }, + { + "name": "dx", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "payable", + "type": "function", + "name": "exchange", + "inputs": [ + { + "name": "i", + "type": "int128" + }, + { + "name": "j", + "type": "int128" + }, + { + "name": "_dx", + "type": "uint256" + }, + { + "name": "_min_dy", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "payable", + "type": "function", + "name": "exchange", + "inputs": [ + { + "name": "i", + "type": "int128" + }, + { + "name": "j", + "type": "int128" + }, + { + "name": "_dx", + "type": "uint256" + }, + { + "name": "_min_dy", + "type": "uint256" + }, + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "remove_liquidity", + "inputs": [ + { + "name": "_burn_amount", + "type": "uint256" + }, + { + "name": "_min_amounts", + "type": "uint256[2]" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256[2]" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "remove_liquidity", + "inputs": [ + { + "name": "_burn_amount", + "type": "uint256" + }, + { + "name": "_min_amounts", + "type": "uint256[2]" + }, + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256[2]" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "remove_liquidity_imbalance", + "inputs": [ + { + "name": "_amounts", + "type": "uint256[2]" + }, + { + "name": "_max_burn_amount", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "remove_liquidity_imbalance", + "inputs": [ + { + "name": "_amounts", + "type": "uint256[2]" + }, + { + "name": "_max_burn_amount", + "type": "uint256" + }, + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "calc_withdraw_one_coin", + "inputs": [ + { + "name": "_burn_amount", + "type": "uint256" + }, + { + "name": "i", + "type": "int128" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "remove_liquidity_one_coin", + "inputs": [ + { + "name": "_burn_amount", + "type": "uint256" + }, + { + "name": "i", + "type": "int128" + }, + { + "name": "_min_received", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "remove_liquidity_one_coin", + "inputs": [ + { + "name": "_burn_amount", + "type": "uint256" + }, + { + "name": "i", + "type": "int128" + }, + { + "name": "_min_received", + "type": "uint256" + }, + { + "name": "_receiver", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "ramp_A", + "inputs": [ + { + "name": "_future_A", + "type": "uint256" + }, + { + "name": "_future_time", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "stop_ramp_A", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "view", + "type": "function", + "name": "admin_balances", + "inputs": [ + { + "name": "i", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "withdraw_admin_fees", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "commit_new_fee", + "inputs": [ + { + "name": "_new_fee", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "apply_new_fee", + "inputs": [], + "outputs": [] + }, + { + "stateMutability": "nonpayable", + "type": "function", + "name": "set_ma_exp_time", + "inputs": [ + { + "name": "_ma_exp_time", + "type": "uint256" + } + ], + "outputs": [] + }, + { + "stateMutability": "view", + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "coins", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "address" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "balances", + "inputs": [ + { + "name": "arg0", + "type": "uint256" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "fee", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_fee", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "admin_action_deadline", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "initial_A", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_A", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "initial_A_time", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "future_A_time", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "symbol", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "string" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "balanceOf", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "allowance", + "inputs": [ + { + "name": "arg0", + "type": "address" + }, + { + "name": "arg1", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "totalSupply", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "DOMAIN_SEPARATOR", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "nonces", + "inputs": [ + { + "name": "arg0", + "type": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "ma_exp_time", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + }, + { + "stateMutability": "view", + "type": "function", + "name": "ma_last_time", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256" + } + ] + } +] \ No newline at end of file diff --git a/db/migrations/1694808555614-Data.js b/db/migrations/1695072381593-Data.js similarity index 91% rename from db/migrations/1694808555614-Data.js rename to db/migrations/1695072381593-Data.js index 774f4525..e505301c 100644 --- a/db/migrations/1694808555614-Data.js +++ b/db/migrations/1695072381593-Data.js @@ -1,5 +1,5 @@ -module.exports = class Data1694808555614 { - name = 'Data1694808555614' +module.exports = class Data1695072381593 { + name = 'Data1695072381593' async up(db) { await db.query(`CREATE TABLE "history" ("id" character varying NOT NULL, "value" numeric NOT NULL, "balance" numeric NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "type" text NOT NULL, "address_id" character varying, CONSTRAINT "PK_9384942edf4804b38ca0ee51416" PRIMARY KEY ("id"))`) @@ -25,10 +25,10 @@ module.exports = class Data1694808555614 { await db.query(`CREATE INDEX "IDX_0f1a5b7e346813a4ec3a03010b" ON "vault" ("timestamp") `) await db.query(`CREATE INDEX "IDX_a9b314451a9001a7b0a222f68a" ON "vault" ("block_number") `) await db.query(`CREATE INDEX "IDX_534a4b5cb80e57e6e7d138b869" ON "vault" ("tx_hash") `) - await db.query(`CREATE TABLE "curve" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "eth" numeric NOT NULL, "oeth" numeric NOT NULL, CONSTRAINT "PK_5aa8792c58dd9c0ae7e09d98611" PRIMARY KEY ("id"))`) - await db.query(`CREATE INDEX "IDX_46ef935a92d46f4c5e7be3d9a0" ON "curve" ("timestamp") `) - await db.query(`CREATE INDEX "IDX_abec6d1835577bb9af8c8f3cd8" ON "curve" ("block_number") `) - await db.query(`CREATE INDEX "IDX_5b78300fa8fa16be40dd917f07" ON "curve" ("tx_hash") `) + await db.query(`CREATE TABLE "curve_lp" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "total_supply" numeric NOT NULL, "eth" numeric NOT NULL, "oeth" numeric NOT NULL, "total_supply_owned" numeric NOT NULL, "eth_owned" numeric NOT NULL, "oeth_owned" numeric NOT NULL, CONSTRAINT "PK_78cd36e42a49ac6ca38349e93ca" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_330db36ce24d451bd225362497" ON "curve_lp" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_21dec6975ac5df4cb0cf36a117" ON "curve_lp" ("block_number") `) + await db.query(`CREATE INDEX "IDX_b20dd512c2ef32c92dd1d4fd1d" ON "curve_lp" ("tx_hash") `) await db.query(`CREATE TABLE "frax_staking" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "frx_eth" numeric NOT NULL, CONSTRAINT "PK_8e4f242a30dc9aa67ce89dd9011" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_c40e57574ecb23502fa6755b03" ON "frax_staking" ("timestamp") `) await db.query(`CREATE INDEX "IDX_ac105b3fae6f14114535b8d0e2" ON "frax_staking" ("block_number") `) @@ -54,7 +54,7 @@ module.exports = class Data1694808555614 { await db.query(`ALTER TABLE "rebase" ADD CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2" FOREIGN KEY ("apy_id") REFERENCES "apy"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "rebase_option" ADD CONSTRAINT "FK_66c04aee6855c74debae4add8fe" FOREIGN KEY ("address_id") REFERENCES "address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_9f37653694923d2b62c6c01190b" FOREIGN KEY ("vault_id") REFERENCES "vault"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) - await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_f809f02abcc22d9ef50c97b42c8" FOREIGN KEY ("curve_id") REFERENCES "curve"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_f809f02abcc22d9ef50c97b42c8" FOREIGN KEY ("curve_id") REFERENCES "curve_lp"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_b5c2c4b2d43680e3c6470d7f9df" FOREIGN KEY ("frax_staking_id") REFERENCES "frax_staking"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_a610e78431c0dd56724129f2236" FOREIGN KEY ("morpho_aave_id") REFERENCES "morpho_aave"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_7a506ebb6c720f35607810b7347" FOREIGN KEY ("dripper_id") REFERENCES "dripper"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) @@ -84,10 +84,10 @@ module.exports = class Data1694808555614 { await db.query(`DROP INDEX "public"."IDX_0f1a5b7e346813a4ec3a03010b"`) await db.query(`DROP INDEX "public"."IDX_a9b314451a9001a7b0a222f68a"`) await db.query(`DROP INDEX "public"."IDX_534a4b5cb80e57e6e7d138b869"`) - await db.query(`DROP TABLE "curve"`) - await db.query(`DROP INDEX "public"."IDX_46ef935a92d46f4c5e7be3d9a0"`) - await db.query(`DROP INDEX "public"."IDX_abec6d1835577bb9af8c8f3cd8"`) - await db.query(`DROP INDEX "public"."IDX_5b78300fa8fa16be40dd917f07"`) + await db.query(`DROP TABLE "curve_lp"`) + await db.query(`DROP INDEX "public"."IDX_330db36ce24d451bd225362497"`) + await db.query(`DROP INDEX "public"."IDX_21dec6975ac5df4cb0cf36a117"`) + await db.query(`DROP INDEX "public"."IDX_b20dd512c2ef32c92dd1d4fd1d"`) await db.query(`DROP TABLE "frax_staking"`) await db.query(`DROP INDEX "public"."IDX_c40e57574ecb23502fa6755b03"`) await db.query(`DROP INDEX "public"."IDX_ac105b3fae6f14114535b8d0e2"`) diff --git a/schema.graphql b/schema.graphql index dd6cffee..eaf2b82f 100644 --- a/schema.graphql +++ b/schema.graphql @@ -59,7 +59,7 @@ type FinancialStatement @entity { blockNumber: Int! @index txHash: String! @index vault: Vault! - curve: Curve! + curve: CurveLP! fraxStaking: FraxStaking! morphoAave: MorphoAave! dripper: Dripper! @@ -81,13 +81,17 @@ type Vault @entity { # OETH Convex: 0x1827F9eA98E0bf96550b2FC20F7233277FcD7E63 # Curve LP Token: 0x94B17476A93b3262d87B9a326965D1E91f9c13E7 # Convex Deposit: 0xF403C135812408BFbE8713b5A23a04b3D48AAE31 -type Curve @entity { +type CurveLP @entity { id: ID! timestamp: DateTime! @index blockNumber: Int! @index txHash: String! @index + totalSupply: BigInt! eth: BigInt! oeth: BigInt! + totalSupplyOwned: BigInt! + ethOwned: BigInt! + oethOwned: BigInt! } # OETH Frax Staking: 0x3fF8654D633D4Ea0faE24c52Aec73B4A20D0d0e5 diff --git a/src/abi/curve_lp_token.abi.ts b/src/abi/curve_lp_token.abi.ts new file mode 100644 index 00000000..736d6a8c --- /dev/null +++ b/src/abi/curve_lp_token.abi.ts @@ -0,0 +1,1271 @@ +export const ABI_JSON = [ + { + "type": "event", + "anonymous": false, + "name": "Transfer", + "inputs": [ + { + "type": "address", + "name": "sender", + "indexed": true + }, + { + "type": "address", + "name": "receiver", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Approval", + "inputs": [ + { + "type": "address", + "name": "owner", + "indexed": true + }, + { + "type": "address", + "name": "spender", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "TokenExchange", + "inputs": [ + { + "type": "address", + "name": "buyer", + "indexed": true + }, + { + "type": "int128", + "name": "sold_id", + "indexed": false + }, + { + "type": "uint256", + "name": "tokens_sold", + "indexed": false + }, + { + "type": "int128", + "name": "bought_id", + "indexed": false + }, + { + "type": "uint256", + "name": "tokens_bought", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "AddLiquidity", + "inputs": [ + { + "type": "address", + "name": "provider", + "indexed": true + }, + { + "type": "uint256[2]", + "name": "token_amounts" + }, + { + "type": "uint256[2]", + "name": "fees" + }, + { + "type": "uint256", + "name": "invariant", + "indexed": false + }, + { + "type": "uint256", + "name": "token_supply", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RemoveLiquidity", + "inputs": [ + { + "type": "address", + "name": "provider", + "indexed": true + }, + { + "type": "uint256[2]", + "name": "token_amounts" + }, + { + "type": "uint256[2]", + "name": "fees" + }, + { + "type": "uint256", + "name": "token_supply", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RemoveLiquidityOne", + "inputs": [ + { + "type": "address", + "name": "provider", + "indexed": true + }, + { + "type": "uint256", + "name": "token_amount", + "indexed": false + }, + { + "type": "uint256", + "name": "coin_amount", + "indexed": false + }, + { + "type": "uint256", + "name": "token_supply", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RemoveLiquidityImbalance", + "inputs": [ + { + "type": "address", + "name": "provider", + "indexed": true + }, + { + "type": "uint256[2]", + "name": "token_amounts" + }, + { + "type": "uint256[2]", + "name": "fees" + }, + { + "type": "uint256", + "name": "invariant", + "indexed": false + }, + { + "type": "uint256", + "name": "token_supply", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RampA", + "inputs": [ + { + "type": "uint256", + "name": "old_A", + "indexed": false + }, + { + "type": "uint256", + "name": "new_A", + "indexed": false + }, + { + "type": "uint256", + "name": "initial_time", + "indexed": false + }, + { + "type": "uint256", + "name": "future_time", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "StopRampA", + "inputs": [ + { + "type": "uint256", + "name": "A", + "indexed": false + }, + { + "type": "uint256", + "name": "t", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "CommitNewFee", + "inputs": [ + { + "type": "uint256", + "name": "new_fee", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "ApplyNewFee", + "inputs": [ + { + "type": "uint256", + "name": "fee", + "indexed": false + } + ] + }, + { + "type": "constructor", + "stateMutability": "undefined", + "payable": false, + "inputs": [] + }, + { + "type": "function", + "name": "initialize", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "string", + "name": "_name" + }, + { + "type": "string", + "name": "_symbol" + }, + { + "type": "address[4]", + "name": "_coins" + }, + { + "type": "uint256[4]", + "name": "_rate_multipliers" + }, + { + "type": "uint256", + "name": "_A" + }, + { + "type": "uint256", + "name": "_fee" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "decimals", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "transfer", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_to" + }, + { + "type": "uint256", + "name": "_value" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "transferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_from" + }, + { + "type": "address", + "name": "_to" + }, + { + "type": "uint256", + "name": "_value" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "approve", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_spender" + }, + { + "type": "uint256", + "name": "_value" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "permit", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_owner" + }, + { + "type": "address", + "name": "_spender" + }, + { + "type": "uint256", + "name": "_value" + }, + { + "type": "uint256", + "name": "_deadline" + }, + { + "type": "uint8", + "name": "_v" + }, + { + "type": "bytes32", + "name": "_r" + }, + { + "type": "bytes32", + "name": "_s" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "last_price", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "ema_price", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "get_balances", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256[2]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "admin_fee", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "A", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "A_precise", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "get_p", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "price_oracle", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "get_virtual_price", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "calc_token_amount", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256[2]", + "name": "_amounts" + }, + { + "type": "bool", + "name": "_is_deposit" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "add_liquidity", + "constant": false, + "stateMutability": "payable", + "payable": true, + "inputs": [ + { + "type": "uint256[2]", + "name": "_amounts" + }, + { + "type": "uint256", + "name": "_min_mint_amount" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "add_liquidity", + "constant": false, + "stateMutability": "payable", + "payable": true, + "inputs": [ + { + "type": "uint256[2]", + "name": "_amounts" + }, + { + "type": "uint256", + "name": "_min_mint_amount" + }, + { + "type": "address", + "name": "_receiver" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "get_dy", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "int128", + "name": "i" + }, + { + "type": "int128", + "name": "j" + }, + { + "type": "uint256", + "name": "dx" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "exchange", + "constant": false, + "stateMutability": "payable", + "payable": true, + "inputs": [ + { + "type": "int128", + "name": "i" + }, + { + "type": "int128", + "name": "j" + }, + { + "type": "uint256", + "name": "_dx" + }, + { + "type": "uint256", + "name": "_min_dy" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "exchange", + "constant": false, + "stateMutability": "payable", + "payable": true, + "inputs": [ + { + "type": "int128", + "name": "i" + }, + { + "type": "int128", + "name": "j" + }, + { + "type": "uint256", + "name": "_dx" + }, + { + "type": "uint256", + "name": "_min_dy" + }, + { + "type": "address", + "name": "_receiver" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "remove_liquidity", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_burn_amount" + }, + { + "type": "uint256[2]", + "name": "_min_amounts" + } + ], + "outputs": [ + { + "type": "uint256[2]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "remove_liquidity", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_burn_amount" + }, + { + "type": "uint256[2]", + "name": "_min_amounts" + }, + { + "type": "address", + "name": "_receiver" + } + ], + "outputs": [ + { + "type": "uint256[2]", + "name": "" + } + ] + }, + { + "type": "function", + "name": "remove_liquidity_imbalance", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256[2]", + "name": "_amounts" + }, + { + "type": "uint256", + "name": "_max_burn_amount" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "remove_liquidity_imbalance", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256[2]", + "name": "_amounts" + }, + { + "type": "uint256", + "name": "_max_burn_amount" + }, + { + "type": "address", + "name": "_receiver" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "calc_withdraw_one_coin", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_burn_amount" + }, + { + "type": "int128", + "name": "i" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "remove_liquidity_one_coin", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_burn_amount" + }, + { + "type": "int128", + "name": "i" + }, + { + "type": "uint256", + "name": "_min_received" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "remove_liquidity_one_coin", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_burn_amount" + }, + { + "type": "int128", + "name": "i" + }, + { + "type": "uint256", + "name": "_min_received" + }, + { + "type": "address", + "name": "_receiver" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "ramp_A", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_future_A" + }, + { + "type": "uint256", + "name": "_future_time" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "stop_ramp_A", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "admin_balances", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "i" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "withdraw_admin_fees", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "commit_new_fee", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_new_fee" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "apply_new_fee", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "set_ma_exp_time", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_ma_exp_time" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "version", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "coins", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "arg0" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "balances", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "arg0" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "fee", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "future_fee", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "admin_action_deadline", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "initial_A", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "future_A", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "initial_A_time", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "future_A_time", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "name", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "symbol", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "balanceOf", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "allowance", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "arg0" + }, + { + "type": "address", + "name": "arg1" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "totalSupply", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "DOMAIN_SEPARATOR", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "nonces", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "arg0" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "ma_exp_time", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "ma_last_time", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + } +] diff --git a/src/abi/curve_lp_token.ts b/src/abi/curve_lp_token.ts new file mode 100644 index 00000000..5cba5c52 --- /dev/null +++ b/src/abi/curve_lp_token.ts @@ -0,0 +1,341 @@ +import * as ethers from 'ethers' +import {LogEvent, Func, ContractBase} from './abi.support' +import {ABI_JSON} from './curve_lp_token.abi' + +export const abi = new ethers.Interface(ABI_JSON); + +export const events = { + Transfer: new LogEvent<([sender: string, receiver: string, value: bigint] & {sender: string, receiver: string, value: bigint})>( + abi, '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' + ), + Approval: new LogEvent<([owner: string, spender: string, value: bigint] & {owner: string, spender: string, value: bigint})>( + abi, '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925' + ), + TokenExchange: new LogEvent<([buyer: string, sold_id: bigint, tokens_sold: bigint, bought_id: bigint, tokens_bought: bigint] & {buyer: string, sold_id: bigint, tokens_sold: bigint, bought_id: bigint, tokens_bought: bigint})>( + abi, '0x8b3e96f2b889fa771c53c981b40daf005f63f637f1869f707052d15a3dd97140' + ), + AddLiquidity: new LogEvent<([provider: string, token_amounts: Array, fees: Array, invariant: bigint, token_supply: bigint] & {provider: string, token_amounts: Array, fees: Array, invariant: bigint, token_supply: bigint})>( + abi, '0x26f55a85081d24974e85c6c00045d0f0453991e95873f52bff0d21af4079a768' + ), + RemoveLiquidity: new LogEvent<([provider: string, token_amounts: Array, fees: Array, token_supply: bigint] & {provider: string, token_amounts: Array, fees: Array, token_supply: bigint})>( + abi, '0x7c363854ccf79623411f8995b362bce5eddff18c927edc6f5dbbb5e05819a82c' + ), + RemoveLiquidityOne: new LogEvent<([provider: string, token_amount: bigint, coin_amount: bigint, token_supply: bigint] & {provider: string, token_amount: bigint, coin_amount: bigint, token_supply: bigint})>( + abi, '0x5ad056f2e28a8cec232015406b843668c1e36cda598127ec3b8c59b8c72773a0' + ), + RemoveLiquidityImbalance: new LogEvent<([provider: string, token_amounts: Array, fees: Array, invariant: bigint, token_supply: bigint] & {provider: string, token_amounts: Array, fees: Array, invariant: bigint, token_supply: bigint})>( + abi, '0x2b5508378d7e19e0d5fa338419034731416c4f5b219a10379956f764317fd47e' + ), + RampA: new LogEvent<([old_A: bigint, new_A: bigint, initial_time: bigint, future_time: bigint] & {old_A: bigint, new_A: bigint, initial_time: bigint, future_time: bigint})>( + abi, '0xa2b71ec6df949300b59aab36b55e189697b750119dd349fcfa8c0f779e83c254' + ), + StopRampA: new LogEvent<([A: bigint, t: bigint] & {A: bigint, t: bigint})>( + abi, '0x46e22fb3709ad289f62ce63d469248536dbc78d82b84a3d7e74ad606dc201938' + ), + CommitNewFee: new LogEvent<([new_fee: bigint] & {new_fee: bigint})>( + abi, '0x878eb36b3f197f05821c06953d9bc8f14b332a227b1e26df06a4215bbfe5d73f' + ), + ApplyNewFee: new LogEvent<([fee: bigint] & {fee: bigint})>( + abi, '0xa8715770654f54603947addf38c689adbd7182e21673b28bcf306a957aaba215' + ), +} + +export const functions = { + initialize: new Func<[_name: string, _symbol: string, _coins: Array, _rate_multipliers: Array, _A: bigint, _fee: bigint], {_name: string, _symbol: string, _coins: Array, _rate_multipliers: Array, _A: bigint, _fee: bigint}, []>( + abi, '0xa461b3c8' + ), + decimals: new Func<[], {}, bigint>( + abi, '0x313ce567' + ), + transfer: new Func<[_to: string, _value: bigint], {_to: string, _value: bigint}, boolean>( + abi, '0xa9059cbb' + ), + transferFrom: new Func<[_from: string, _to: string, _value: bigint], {_from: string, _to: string, _value: bigint}, boolean>( + abi, '0x23b872dd' + ), + approve: new Func<[_spender: string, _value: bigint], {_spender: string, _value: bigint}, boolean>( + abi, '0x095ea7b3' + ), + permit: new Func<[_owner: string, _spender: string, _value: bigint, _deadline: bigint, _v: number, _r: string, _s: string], {_owner: string, _spender: string, _value: bigint, _deadline: bigint, _v: number, _r: string, _s: string}, boolean>( + abi, '0xd505accf' + ), + last_price: new Func<[], {}, bigint>( + abi, '0xfde625e6' + ), + ema_price: new Func<[], {}, bigint>( + abi, '0xc24c7c29' + ), + get_balances: new Func<[], {}, Array>( + abi, '0x14f05979' + ), + admin_fee: new Func<[], {}, bigint>( + abi, '0xfee3f7f9' + ), + A: new Func<[], {}, bigint>( + abi, '0xf446c1d0' + ), + A_precise: new Func<[], {}, bigint>( + abi, '0x76a2f0f0' + ), + get_p: new Func<[], {}, bigint>( + abi, '0xf2388acb' + ), + price_oracle: new Func<[], {}, bigint>( + abi, '0x86fc88d3' + ), + get_virtual_price: new Func<[], {}, bigint>( + abi, '0xbb7b8b80' + ), + calc_token_amount: new Func<[_amounts: Array, _is_deposit: boolean], {_amounts: Array, _is_deposit: boolean}, bigint>( + abi, '0xed8e84f3' + ), + 'add_liquidity(uint256[2],uint256)': new Func<[_amounts: Array, _min_mint_amount: bigint], {_amounts: Array, _min_mint_amount: bigint}, bigint>( + abi, '0x0b4c7e4d' + ), + 'add_liquidity(uint256[2],uint256,address)': new Func<[_amounts: Array, _min_mint_amount: bigint, _receiver: string], {_amounts: Array, _min_mint_amount: bigint, _receiver: string}, bigint>( + abi, '0x0c3e4b54' + ), + get_dy: new Func<[i: bigint, j: bigint, dx: bigint], {i: bigint, j: bigint, dx: bigint}, bigint>( + abi, '0x5e0d443f' + ), + 'exchange(int128,int128,uint256,uint256)': new Func<[i: bigint, j: bigint, _dx: bigint, _min_dy: bigint], {i: bigint, j: bigint, _dx: bigint, _min_dy: bigint}, bigint>( + abi, '0x3df02124' + ), + 'exchange(int128,int128,uint256,uint256,address)': new Func<[i: bigint, j: bigint, _dx: bigint, _min_dy: bigint, _receiver: string], {i: bigint, j: bigint, _dx: bigint, _min_dy: bigint, _receiver: string}, bigint>( + abi, '0xddc1f59d' + ), + 'remove_liquidity(uint256,uint256[2])': new Func<[_burn_amount: bigint, _min_amounts: Array], {_burn_amount: bigint, _min_amounts: Array}, Array>( + abi, '0x5b36389c' + ), + 'remove_liquidity(uint256,uint256[2],address)': new Func<[_burn_amount: bigint, _min_amounts: Array, _receiver: string], {_burn_amount: bigint, _min_amounts: Array, _receiver: string}, Array>( + abi, '0x3eb1719f' + ), + 'remove_liquidity_imbalance(uint256[2],uint256)': new Func<[_amounts: Array, _max_burn_amount: bigint], {_amounts: Array, _max_burn_amount: bigint}, bigint>( + abi, '0xe3103273' + ), + 'remove_liquidity_imbalance(uint256[2],uint256,address)': new Func<[_amounts: Array, _max_burn_amount: bigint, _receiver: string], {_amounts: Array, _max_burn_amount: bigint, _receiver: string}, bigint>( + abi, '0x52d2cfdd' + ), + calc_withdraw_one_coin: new Func<[_burn_amount: bigint, i: bigint], {_burn_amount: bigint, i: bigint}, bigint>( + abi, '0xcc2b27d7' + ), + 'remove_liquidity_one_coin(uint256,int128,uint256)': new Func<[_burn_amount: bigint, i: bigint, _min_received: bigint], {_burn_amount: bigint, i: bigint, _min_received: bigint}, bigint>( + abi, '0x1a4d01d2' + ), + 'remove_liquidity_one_coin(uint256,int128,uint256,address)': new Func<[_burn_amount: bigint, i: bigint, _min_received: bigint, _receiver: string], {_burn_amount: bigint, i: bigint, _min_received: bigint, _receiver: string}, bigint>( + abi, '0x081579a5' + ), + ramp_A: new Func<[_future_A: bigint, _future_time: bigint], {_future_A: bigint, _future_time: bigint}, []>( + abi, '0x3c157e64' + ), + stop_ramp_A: new Func<[], {}, []>( + abi, '0x551a6588' + ), + admin_balances: new Func<[i: bigint], {i: bigint}, bigint>( + abi, '0xe2e7d264' + ), + withdraw_admin_fees: new Func<[], {}, []>( + abi, '0x30c54085' + ), + commit_new_fee: new Func<[_new_fee: bigint], {_new_fee: bigint}, []>( + abi, '0xa48eac9d' + ), + apply_new_fee: new Func<[], {}, []>( + abi, '0x4f12fe97' + ), + set_ma_exp_time: new Func<[_ma_exp_time: bigint], {_ma_exp_time: bigint}, []>( + abi, '0x7f3e17cb' + ), + version: new Func<[], {}, string>( + abi, '0x54fd4d50' + ), + coins: new Func<[arg0: bigint], {arg0: bigint}, string>( + abi, '0xc6610657' + ), + balances: new Func<[arg0: bigint], {arg0: bigint}, bigint>( + abi, '0x4903b0d1' + ), + fee: new Func<[], {}, bigint>( + abi, '0xddca3f43' + ), + future_fee: new Func<[], {}, bigint>( + abi, '0x58680d0b' + ), + admin_action_deadline: new Func<[], {}, bigint>( + abi, '0xe66f43f5' + ), + initial_A: new Func<[], {}, bigint>( + abi, '0x5409491a' + ), + future_A: new Func<[], {}, bigint>( + abi, '0xb4b577ad' + ), + initial_A_time: new Func<[], {}, bigint>( + abi, '0x2081066c' + ), + future_A_time: new Func<[], {}, bigint>( + abi, '0x14052288' + ), + name: new Func<[], {}, string>( + abi, '0x06fdde03' + ), + symbol: new Func<[], {}, string>( + abi, '0x95d89b41' + ), + balanceOf: new Func<[arg0: string], {arg0: string}, bigint>( + abi, '0x70a08231' + ), + allowance: new Func<[arg0: string, arg1: string], {arg0: string, arg1: string}, bigint>( + abi, '0xdd62ed3e' + ), + totalSupply: new Func<[], {}, bigint>( + abi, '0x18160ddd' + ), + DOMAIN_SEPARATOR: new Func<[], {}, string>( + abi, '0x3644e515' + ), + nonces: new Func<[arg0: string], {arg0: string}, bigint>( + abi, '0x7ecebe00' + ), + ma_exp_time: new Func<[], {}, bigint>( + abi, '0x1be913a5' + ), + ma_last_time: new Func<[], {}, bigint>( + abi, '0x1ddc3b01' + ), +} + +export class Contract extends ContractBase { + + decimals(): Promise { + return this.eth_call(functions.decimals, []) + } + + last_price(): Promise { + return this.eth_call(functions.last_price, []) + } + + ema_price(): Promise { + return this.eth_call(functions.ema_price, []) + } + + get_balances(): Promise> { + return this.eth_call(functions.get_balances, []) + } + + admin_fee(): Promise { + return this.eth_call(functions.admin_fee, []) + } + + A(): Promise { + return this.eth_call(functions.A, []) + } + + A_precise(): Promise { + return this.eth_call(functions.A_precise, []) + } + + get_p(): Promise { + return this.eth_call(functions.get_p, []) + } + + price_oracle(): Promise { + return this.eth_call(functions.price_oracle, []) + } + + get_virtual_price(): Promise { + return this.eth_call(functions.get_virtual_price, []) + } + + calc_token_amount(_amounts: Array, _is_deposit: boolean): Promise { + return this.eth_call(functions.calc_token_amount, [_amounts, _is_deposit]) + } + + get_dy(i: bigint, j: bigint, dx: bigint): Promise { + return this.eth_call(functions.get_dy, [i, j, dx]) + } + + calc_withdraw_one_coin(_burn_amount: bigint, i: bigint): Promise { + return this.eth_call(functions.calc_withdraw_one_coin, [_burn_amount, i]) + } + + admin_balances(i: bigint): Promise { + return this.eth_call(functions.admin_balances, [i]) + } + + version(): Promise { + return this.eth_call(functions.version, []) + } + + coins(arg0: bigint): Promise { + return this.eth_call(functions.coins, [arg0]) + } + + balances(arg0: bigint): Promise { + return this.eth_call(functions.balances, [arg0]) + } + + fee(): Promise { + return this.eth_call(functions.fee, []) + } + + future_fee(): Promise { + return this.eth_call(functions.future_fee, []) + } + + admin_action_deadline(): Promise { + return this.eth_call(functions.admin_action_deadline, []) + } + + initial_A(): Promise { + return this.eth_call(functions.initial_A, []) + } + + future_A(): Promise { + return this.eth_call(functions.future_A, []) + } + + initial_A_time(): Promise { + return this.eth_call(functions.initial_A_time, []) + } + + future_A_time(): Promise { + return this.eth_call(functions.future_A_time, []) + } + + name(): Promise { + return this.eth_call(functions.name, []) + } + + symbol(): Promise { + return this.eth_call(functions.symbol, []) + } + + balanceOf(arg0: string): Promise { + return this.eth_call(functions.balanceOf, [arg0]) + } + + allowance(arg0: string, arg1: string): Promise { + return this.eth_call(functions.allowance, [arg0, arg1]) + } + + totalSupply(): Promise { + return this.eth_call(functions.totalSupply, []) + } + + DOMAIN_SEPARATOR(): Promise { + return this.eth_call(functions.DOMAIN_SEPARATOR, []) + } + + nonces(arg0: string): Promise { + return this.eth_call(functions.nonces, [arg0]) + } + + ma_exp_time(): Promise { + return this.eth_call(functions.ma_exp_time, []) + } + + ma_last_time(): Promise { + return this.eth_call(functions.ma_last_time, []) + } +} diff --git a/src/main.ts b/src/main.ts index abae6519..1ffbc988 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,15 +1,10 @@ import { run } from './processor' -import * as dripperProcessor from './processors/dripper' -import * as fraxStakingProcessor from './processors/frax-staking' -import * as morphoAaveProcessor from './processors/morpho-aave' -import * as oethProcessor from './processors/oeth' -import * as vaultProcessor from './processors/vault' +import * as curveLp from './processors/curve-lp' +import * as dripper from './processors/dripper' +import * as fraxStaking from './processors/frax-staking' +import * as morphoAave from './processors/morpho-aave' +import * as oeth from './processors/oeth' +import * as vault from './processors/vault' // The idea is that these processors have zero dependencies on one another and can be processed asynchronously. -run([ - oethProcessor, - vaultProcessor, - fraxStakingProcessor, - morphoAaveProcessor, - dripperProcessor, -]) +run([oeth, vault, fraxStaking, morphoAave, dripper, curveLp]) diff --git a/src/model/generated/curve.model.ts b/src/model/generated/curve.model.ts deleted file mode 100644 index ac9c91fd..00000000 --- a/src/model/generated/curve.model.ts +++ /dev/null @@ -1,30 +0,0 @@ -import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm" -import * as marshal from "./marshal" - -@Entity_() -export class Curve { - constructor(props?: Partial) { - Object.assign(this, props) - } - - @PrimaryColumn_() - id!: string - - @Index_() - @Column_("timestamp with time zone", {nullable: false}) - timestamp!: Date - - @Index_() - @Column_("int4", {nullable: false}) - blockNumber!: number - - @Index_() - @Column_("text", {nullable: false}) - txHash!: string - - @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) - eth!: bigint - - @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) - oeth!: bigint -} diff --git a/src/model/generated/financialStatement.model.ts b/src/model/generated/financialStatement.model.ts index eb7f7abf..5e372879 100644 --- a/src/model/generated/financialStatement.model.ts +++ b/src/model/generated/financialStatement.model.ts @@ -1,6 +1,6 @@ import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_, ManyToOne as ManyToOne_} from "typeorm" import {Vault} from "./vault.model" -import {Curve} from "./curve.model" +import {CurveLP} from "./curveLp.model" import {FraxStaking} from "./fraxStaking.model" import {MorphoAave} from "./morphoAave.model" import {Dripper} from "./dripper.model" @@ -31,8 +31,8 @@ export class FinancialStatement { vault!: Vault @Index_() - @ManyToOne_(() => Curve, {nullable: true}) - curve!: Curve + @ManyToOne_(() => CurveLP, {nullable: true}) + curve!: CurveLP @Index_() @ManyToOne_(() => FraxStaking, {nullable: true}) diff --git a/src/model/generated/index.ts b/src/model/generated/index.ts index d923dd14..58634b85 100644 --- a/src/model/generated/index.ts +++ b/src/model/generated/index.ts @@ -5,7 +5,7 @@ export * from "./rebaseOption.model" export * from "./apy.model" export * from "./financialStatement.model" export * from "./vault.model" -export * from "./curve.model" +export * from "./curveLp.model" export * from "./fraxStaking.model" export * from "./morphoAave.model" export * from "./dripper.model" diff --git a/src/processor.ts b/src/processor.ts index 54716614..083f9483 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -32,6 +32,7 @@ export const processor = new EvmBatchProcessor() .setFields({ transaction: { from: true, + to: true, hash: true, gasUsed: true, gas: true, @@ -46,10 +47,10 @@ export const processor = new EvmBatchProcessor() data: true, }, trace: { + callFrom: true, callTo: true, callSighash: true, callValue: true, - callFrom: true, callInput: true, createResultAddress: true, // action: true, diff --git a/src/processors/curve-lp/curve-lp.ts b/src/processors/curve-lp/curve-lp.ts new file mode 100644 index 00000000..06f1b4a4 --- /dev/null +++ b/src/processors/curve-lp/curve-lp.ts @@ -0,0 +1,260 @@ +import { EvmBatchProcessor } from '@subsquid/evm-processor' +import { hexToBigInt, pad } from 'viem' + +import * as curve_lp_token from '../../abi/curve_lp_token' +import * as erc20 from '../../abi/erc20' +import { CurveLP } from '../../model' +import { Context } from '../../processor' +import { + OETH_ADDRESS, + OETH_CURVE_LP_ADDRESS, + OETH_CURVE_LP_OWNER_ADDRESS, +} from '../../utils/addresses' +import { getLatest, trackAddressBalances } from '../utils' + +interface ProcessResult { + curveLPs: CurveLP[] +} + +export const from = 17130232 // https://etherscan.io/tx/0xbf9dca462a157215e744ba7f2c17f036ad4d5c708f0e9e49ec53e4069e87771f + +export const setup = (processor: EvmBatchProcessor) => { + processor.addLog({ + address: [OETH_CURVE_LP_ADDRESS], + topic0: [ + curve_lp_token.events.AddLiquidity.topic, + curve_lp_token.events.RemoveLiquidity.topic, + curve_lp_token.events.RemoveLiquidityImbalance.topic, + curve_lp_token.events.RemoveLiquidityOne.topic, + curve_lp_token.events.Transfer.topic, + curve_lp_token.events.TokenExchange.topic, + ], + }) + processor.addLog({ + address: [OETH_ADDRESS], + topic0: [curve_lp_token.events.Transfer.topic], + topic1: [pad(OETH_CURVE_LP_ADDRESS)], + }) + processor.addLog({ + address: [OETH_ADDRESS], + topic0: [curve_lp_token.events.Transfer.topic], + topic2: [pad(OETH_CURVE_LP_ADDRESS)], + }) + processor.addLog({ + address: [OETH_CURVE_LP_ADDRESS], + topic0: [curve_lp_token.events.Transfer.topic], + topic1: [pad(OETH_CURVE_LP_OWNER_ADDRESS)], + }) + processor.addLog({ + address: [OETH_CURVE_LP_ADDRESS], + topic0: [curve_lp_token.events.Transfer.topic], + topic2: [pad(OETH_CURVE_LP_OWNER_ADDRESS)], + }) + // processor.addTransaction({ + // from: [OETH_CURVE_LP_ADDRESS], + // }) + // processor.addTransaction({ + // to: [OETH_CURVE_LP_ADDRESS], + // }) +} + +export const process = async (ctx: Context) => { + const result: ProcessResult = { + curveLPs: [], + } + + for (const block of ctx.blocks) { + // for (const transaction of block.transactions) { + // await processNativeTransfers(ctx, result, block, transaction) + // } + for (const log of block.logs) { + await processHoldingsTransfer(ctx, result, block, log) + if (log.address === OETH_CURVE_LP_ADDRESS) { + await processLiquidityEvents(ctx, result, block, log) + await processCurveLPTransfer(ctx, result, block, log) + } + } + } + + await ctx.store.insert(result.curveLPs) +} + +const processNativeTransfers = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + transaction: Context['blocks']['0']['transactions']['0'], +) => { + if (!transaction) return + if (transaction.value > 0n) { + if ( + transaction.from.toLowerCase() === OETH_CURVE_LP_ADDRESS && + transaction.to?.toLowerCase() !== OETH_CURVE_LP_ADDRESS + ) { + const curveLP = await getLatestCurveLP(ctx, result, block, { + transactionHash: transaction.hash, + }) + curveLP.eth -= transaction.value + curveLP.ethOwned = curveLP.totalSupply + ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + } else if (transaction.to?.toLowerCase() === OETH_CURVE_LP_ADDRESS) { + const curveLP = await getLatestCurveLP(ctx, result, block, { + transactionHash: transaction.hash, + }) + curveLP.eth += transaction.value + curveLP.ethOwned = curveLP.totalSupply + ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + } + } +} + +const processHoldingsTransfer = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: Context['blocks']['0']['logs']['0'], +) => { + if (log.topics[0] === erc20.events.Transfer.topic) { + await trackAddressBalances({ + log, + address: OETH_CURVE_LP_ADDRESS, + tokens: [OETH_ADDRESS], + fn: async ({ log, change }) => { + const curveLP = await getLatestCurveLP(ctx, result, block, log) + curveLP.oeth += change + curveLP.oethOwned = curveLP.totalSupply + ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + }, + }) + } +} + +const processLiquidityEvents = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: Context['blocks']['0']['logs']['0'], +) => { + if (log.topics[0] === curve_lp_token.events.AddLiquidity.topic) { + const eth = await ctx._chain.client + .call('eth_getBalance', [OETH_CURVE_LP_ADDRESS, block.header.hash]) + .then((r: `0x${string}`) => hexToBigInt(r)) + const { token_supply } = curve_lp_token.events.AddLiquidity.decode(log) + const curveLP = await getLatestCurveLP(ctx, result, block, log) + curveLP.totalSupply = token_supply + curveLP.eth = eth + curveLP.ethOwned = curveLP.totalSupply + ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + curveLP.oethOwned = curveLP.totalSupply + ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + } else if ( + log.topics[0] === curve_lp_token.events.RemoveLiquidityImbalance.topic + ) { + const eth = await ctx._chain.client + .call('eth_getBalance', [OETH_CURVE_LP_ADDRESS, block.header.hash]) + .then((r: `0x${string}`) => hexToBigInt(r)) + const { token_supply } = + curve_lp_token.events.RemoveLiquidityImbalance.decode(log) + const curveLP = await getLatestCurveLP(ctx, result, block, log) + curveLP.totalSupply = token_supply + curveLP.eth = eth + curveLP.ethOwned = curveLP.totalSupply + ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + curveLP.oethOwned = curveLP.totalSupply + ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + } else if (log.topics[0] === curve_lp_token.events.RemoveLiquidityOne.topic) { + const eth = await ctx._chain.client + .call('eth_getBalance', [OETH_CURVE_LP_ADDRESS, block.header.hash]) + .then((r: `0x${string}`) => hexToBigInt(r)) + const { token_supply } = + curve_lp_token.events.RemoveLiquidityOne.decode(log) + const curveLP = await getLatestCurveLP(ctx, result, block, log) + curveLP.totalSupply = token_supply + curveLP.eth = eth + curveLP.ethOwned = curveLP.totalSupply + ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + curveLP.oethOwned = curveLP.totalSupply + ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + } else if (log.topics[0] === curve_lp_token.events.RemoveLiquidity.topic) { + const eth = await ctx._chain.client + .call('eth_getBalance', [OETH_CURVE_LP_ADDRESS, block.header.hash]) + .then((r: `0x${string}`) => hexToBigInt(r)) + const { token_supply } = curve_lp_token.events.RemoveLiquidity.decode(log) + const curveLP = await getLatestCurveLP(ctx, result, block, log) + curveLP.totalSupply = token_supply + curveLP.eth = eth + curveLP.ethOwned = curveLP.totalSupply + ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + curveLP.oethOwned = curveLP.totalSupply + ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + } +} + +const processCurveLPTransfer = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: Context['blocks']['0']['logs']['0'], +) => { + if (log.topics[0] === curve_lp_token.events.Transfer.topic) { + await trackAddressBalances({ + log, + address: OETH_CURVE_LP_OWNER_ADDRESS, + tokens: [OETH_CURVE_LP_ADDRESS], + fn: async ({ log, token, change }) => { + const curveLP = await getLatestCurveLP(ctx, result, block, log) + curveLP.totalSupplyOwned += change + curveLP.ethOwned = curveLP.totalSupply + ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + curveLP.oethOwned = curveLP.totalSupply + ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + }, + }) + } +} + +const getLatestCurveLP = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: { transactionHash: string }, +) => { + const dateId = new Date(block.header.timestamp).toISOString() + const { latest, current } = await getLatest( + ctx, + CurveLP, + result.curveLPs, + dateId, + ) + + let curveLP = current + if (!curveLP) { + curveLP = new CurveLP({ + id: dateId, + timestamp: new Date(block.header.timestamp), + blockNumber: block.header.height, + txHash: log.transactionHash, + totalSupply: latest?.totalSupply ?? 0n, + eth: latest?.eth ?? 0n, + oeth: latest?.oeth ?? 0n, + totalSupplyOwned: latest?.totalSupplyOwned ?? 0n, + ethOwned: latest?.ethOwned ?? 0n, + oethOwned: latest?.oethOwned ?? 0n, + }) + result.curveLPs.push(curveLP) + } + return curveLP +} diff --git a/src/processors/curve-lp/index.ts b/src/processors/curve-lp/index.ts new file mode 100644 index 00000000..35918631 --- /dev/null +++ b/src/processors/curve-lp/index.ts @@ -0,0 +1 @@ +export * from './curve-lp' diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts index 057541b9..c57096a3 100644 --- a/src/processors/vault/vault.ts +++ b/src/processors/vault/vault.ts @@ -7,10 +7,11 @@ import { Context } from '../../processor' import { ADDRESS_ZERO, FRXETH_ADDRESS, + OETH_CURVE_LP_ADDRESS, OETH_VAULT_ADDRESS, RETH_ADDRESS, STETH_ADDRESS, - VAULT_HOLDINGS_ADDRESSES, + VAULT_ERC20_ADDRESSES, WETH_ADDRESS, } from '../../utils/addresses' import { getLatest, trackAddressBalances } from '../utils' @@ -23,12 +24,12 @@ export const from = 17067001 // https://etherscan.io/tx/0x0b81a0e2b7d824ce493465 export const setup = (processor: EvmBatchProcessor) => { processor.addLog({ - address: VAULT_HOLDINGS_ADDRESSES, + address: VAULT_ERC20_ADDRESSES, topic0: [erc20.events.Transfer.topic], topic1: [pad(OETH_VAULT_ADDRESS)], }) processor.addLog({ - address: VAULT_HOLDINGS_ADDRESSES, + address: VAULT_ERC20_ADDRESSES, topic0: [erc20.events.Transfer.topic], topic2: [pad(OETH_VAULT_ADDRESS)], }) @@ -40,6 +41,9 @@ export const process = async (ctx: Context) => { } for (const block of ctx.blocks) { + for (const transaction of block.transactions) { + await processNativeTransfers(ctx, result, block, transaction) + } for (const log of block.logs) { await processTransfer(ctx, result, block, log) } @@ -48,45 +52,59 @@ export const process = async (ctx: Context) => { await ctx.store.insert(result.vaults) } +const processNativeTransfers = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + transaction: Context['blocks']['0']['transactions']['0'], +) => { + if (transaction.value > 0n) { + if ( + transaction.from.toLowerCase() === OETH_CURVE_LP_ADDRESS && + transaction.to?.toLowerCase() !== OETH_CURVE_LP_ADDRESS + ) { + const vault = await getLatestVault(ctx, result, block, { + transactionHash: transaction.hash, + }) + vault.eth -= transaction.value + } else if (transaction.to?.toLowerCase() === OETH_CURVE_LP_ADDRESS) { + const vault = await getLatestVault(ctx, result, block, { + transactionHash: transaction.hash, + }) + vault.eth += transaction.value + } + } +} + const processTransfer = async ( ctx: Context, result: ProcessResult, block: Context['blocks']['0'], log: Context['blocks']['0']['logs']['0'], ) => { + if (log.transaction) { + if (log.transaction.value > 0) { + if ( + log.transaction.from === OETH_VAULT_ADDRESS && + log.transaction.to !== OETH_VAULT_ADDRESS + ) { + const vault = await getLatestVault(ctx, result, block, log) + vault.eth -= log.transaction.value + } else if (log.transaction.to === OETH_VAULT_ADDRESS) { + const vault = await getLatestVault(ctx, result, block, log) + vault.eth += log.transaction.value + } + } + } + if (log.topics[0] === erc20.events.Transfer.topic) { await trackAddressBalances({ log, address: OETH_VAULT_ADDRESS, - tokens: VAULT_HOLDINGS_ADDRESSES, + tokens: VAULT_ERC20_ADDRESSES, fn: async ({ log, token, change }) => { - const dateId = new Date(block.header.timestamp).toISOString() - const { latest, current } = await getLatest( - ctx, - Vault, - result.vaults, - dateId, - ) - - let vault = current - if (!vault) { - vault = new Vault({ - id: dateId, - timestamp: new Date(block.header.timestamp), - blockNumber: block.header.height, - txHash: log.transactionHash, - eth: latest?.eth ?? 0n, - weth: latest?.weth ?? 0n, - rETH: latest?.rETH ?? 0n, - stETH: latest?.stETH ?? 0n, - frxETH: latest?.frxETH ?? 0n, - }) - result.vaults.push(vault) - } - - if (token === ADDRESS_ZERO) { - vault.eth += change - } else if (token === WETH_ADDRESS) { + const vault = await getLatestVault(ctx, result, block, log) + if (token === WETH_ADDRESS) { vault.weth += change } else if (token === RETH_ADDRESS) { vault.rETH += change @@ -99,3 +117,30 @@ const processTransfer = async ( }) } } + +const getLatestVault = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: { transactionHash: string }, +) => { + const dateId = new Date(block.header.timestamp).toISOString() + const { latest, current } = await getLatest(ctx, Vault, result.vaults, dateId) + + let vault = current + if (!vault) { + vault = new Vault({ + id: dateId, + timestamp: new Date(block.header.timestamp), + blockNumber: block.header.height, + txHash: log.transactionHash, + eth: latest?.eth ?? 0n, + weth: latest?.weth ?? 0n, + rETH: latest?.rETH ?? 0n, + stETH: latest?.stETH ?? 0n, + frxETH: latest?.frxETH ?? 0n, + }) + result.vaults.push(vault) + } + return vault +} diff --git a/src/utils/addresses.ts b/src/utils/addresses.ts index 96605182..6c9c2411 100644 --- a/src/utils/addresses.ts +++ b/src/utils/addresses.ts @@ -10,8 +10,7 @@ export const STETH_ADDRESS = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' export const RETH_ADDRESS = '0xae78736cd615f374d3085123a210448e74fc6393' export const FRXETH_ADDRESS = '0x5e8422345238f34275888049021821e8e08caa1f' -export const VAULT_HOLDINGS_ADDRESSES = [ - ADDRESS_ZERO, +export const VAULT_ERC20_ADDRESSES = [ WETH_ADDRESS, STETH_ADDRESS, RETH_ADDRESS, @@ -19,9 +18,13 @@ export const VAULT_HOLDINGS_ADDRESSES = [ ] export const OETH_CONVEX_ADDRESS = '0x1827f9ea98e0bf96550b2fc20f7233277fcd7e63' -export const CURVE_LP_ADDRESS = '0x94b17476a93b3262d87b9a326965d1e91f9c13e7' export const CONVEX_DEPOSIT = '0xf403c135812408bfbe8713b5a23a04b3d48aae31' +export const OETH_CURVE_LP_ADDRESS = + '0x94b17476a93b3262d87b9a326965d1e91f9c13e7' +export const OETH_CURVE_LP_OWNER_ADDRESS = + '0xd03be91b1932715709e18021734fcb91bb431715' + export const OETH_FRAX_STAKING_ADDRESS = '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5' export const SFRXETH_ADDRESS = '0xac3e018457b222d93114458476f3e3416abbe38f' From ad77399a118139d7f15c8f681709891d161e95e1 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Tue, 19 Sep 2023 10:29:06 -0700 Subject: [PATCH 18/31] accurate curve lp numbers --- src/processors/curve-lp/curve-lp.ts | 165 ++++++++++++++-------------- src/utils/getEthBalance.ts | 12 ++ 2 files changed, 97 insertions(+), 80 deletions(-) create mode 100644 src/utils/getEthBalance.ts diff --git a/src/processors/curve-lp/curve-lp.ts b/src/processors/curve-lp/curve-lp.ts index 06f1b4a4..a5575fbe 100644 --- a/src/processors/curve-lp/curve-lp.ts +++ b/src/processors/curve-lp/curve-lp.ts @@ -10,6 +10,7 @@ import { OETH_CURVE_LP_ADDRESS, OETH_CURVE_LP_OWNER_ADDRESS, } from '../../utils/addresses' +import { getEthBalance } from '../../utils/getEthBalance' import { getLatest, trackAddressBalances } from '../utils' interface ProcessResult { @@ -26,18 +27,17 @@ export const setup = (processor: EvmBatchProcessor) => { curve_lp_token.events.RemoveLiquidity.topic, curve_lp_token.events.RemoveLiquidityImbalance.topic, curve_lp_token.events.RemoveLiquidityOne.topic, - curve_lp_token.events.Transfer.topic, - curve_lp_token.events.TokenExchange.topic, + // curve_lp_token.events.TokenExchange.topic, // Not sure if including this helps get up-to-date eth balances. ], }) processor.addLog({ address: [OETH_ADDRESS], - topic0: [curve_lp_token.events.Transfer.topic], + topic0: [erc20.events.Transfer.topic], topic1: [pad(OETH_CURVE_LP_ADDRESS)], }) processor.addLog({ address: [OETH_ADDRESS], - topic0: [curve_lp_token.events.Transfer.topic], + topic0: [erc20.events.Transfer.topic], topic2: [pad(OETH_CURVE_LP_ADDRESS)], }) processor.addLog({ @@ -50,11 +50,18 @@ export const setup = (processor: EvmBatchProcessor) => { topic0: [curve_lp_token.events.Transfer.topic], topic2: [pad(OETH_CURVE_LP_OWNER_ADDRESS)], }) + // Not sure if this is needed to get up-to-date ETH balances. // processor.addTransaction({ // from: [OETH_CURVE_LP_ADDRESS], + // traces: false, + // logs: false, + // stateDiffs: false, // }) // processor.addTransaction({ // to: [OETH_CURVE_LP_ADDRESS], + // traces: false, + // logs: false, + // stateDiffs: false, // }) } @@ -64,50 +71,56 @@ export const process = async (ctx: Context) => { } for (const block of ctx.blocks) { - // for (const transaction of block.transactions) { - // await processNativeTransfers(ctx, result, block, transaction) - // } + let haveUpdatedEthBalance = false for (const log of block.logs) { await processHoldingsTransfer(ctx, result, block, log) if (log.address === OETH_CURVE_LP_ADDRESS) { await processLiquidityEvents(ctx, result, block, log) await processCurveLPTransfer(ctx, result, block, log) + if (!haveUpdatedEthBalance) { + haveUpdatedEthBalance = true + await updateETHBalance(ctx, result, block, log.transactionHash) + } } } + // Not sure if this is needed to get up-to-date ETH balances. + // const transaction = block.transactions.find( + // (transaction) => + // transaction.from === OETH_CURVE_LP_ADDRESS || + // transaction.to === OETH_CURVE_LP_ADDRESS, + // ) + // if (transaction) { + // await updateETHBalance(ctx, result, block, transaction.hash) + // } } await ctx.store.insert(result.curveLPs) } -const processNativeTransfers = async ( +const updateETHBalance = async ( ctx: Context, result: ProcessResult, block: Context['blocks']['0'], - transaction: Context['blocks']['0']['transactions']['0'], + transactionHash: string, ) => { - if (!transaction) return - if (transaction.value > 0n) { - if ( - transaction.from.toLowerCase() === OETH_CURVE_LP_ADDRESS && - transaction.to?.toLowerCase() !== OETH_CURVE_LP_ADDRESS - ) { - const curveLP = await getLatestCurveLP(ctx, result, block, { - transactionHash: transaction.hash, - }) - curveLP.eth -= transaction.value - curveLP.ethOwned = curveLP.totalSupply - ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply - : 0n - } else if (transaction.to?.toLowerCase() === OETH_CURVE_LP_ADDRESS) { - const curveLP = await getLatestCurveLP(ctx, result, block, { - transactionHash: transaction.hash, - }) - curveLP.eth += transaction.value - curveLP.ethOwned = curveLP.totalSupply - ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply - : 0n + const [eth, { curveLP, isNew }] = await Promise.all([ + getEthBalance(ctx, OETH_CURVE_LP_ADDRESS, block), + getLatestCurveLP(ctx, result, block, transactionHash), + ]) + if (curveLP.eth === eth) { + // No change, let's cancel what we're doing. + if (isNew) { + result.curveLPs.pop() } + return } + curveLP.eth = eth + curveLP.ethOwned = curveLP.totalSupply + ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n + curveLP.oethOwned = curveLP.totalSupply + ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply + : 0n } const processHoldingsTransfer = async ( @@ -122,7 +135,12 @@ const processHoldingsTransfer = async ( address: OETH_CURVE_LP_ADDRESS, tokens: [OETH_ADDRESS], fn: async ({ log, change }) => { - const curveLP = await getLatestCurveLP(ctx, result, block, log) + const { curveLP } = await getLatestCurveLP( + ctx, + result, + block, + log.transactionHash, + ) curveLP.oeth += change curveLP.oethOwned = curveLP.totalSupply ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply @@ -139,65 +157,45 @@ const processLiquidityEvents = async ( log: Context['blocks']['0']['logs']['0'], ) => { if (log.topics[0] === curve_lp_token.events.AddLiquidity.topic) { - const eth = await ctx._chain.client - .call('eth_getBalance', [OETH_CURVE_LP_ADDRESS, block.header.hash]) - .then((r: `0x${string}`) => hexToBigInt(r)) const { token_supply } = curve_lp_token.events.AddLiquidity.decode(log) - const curveLP = await getLatestCurveLP(ctx, result, block, log) + const { curveLP } = await getLatestCurveLP( + ctx, + result, + block, + log.transactionHash, + ) curveLP.totalSupply = token_supply - curveLP.eth = eth - curveLP.ethOwned = curveLP.totalSupply - ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply - : 0n - curveLP.oethOwned = curveLP.totalSupply - ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply - : 0n } else if ( log.topics[0] === curve_lp_token.events.RemoveLiquidityImbalance.topic ) { - const eth = await ctx._chain.client - .call('eth_getBalance', [OETH_CURVE_LP_ADDRESS, block.header.hash]) - .then((r: `0x${string}`) => hexToBigInt(r)) const { token_supply } = curve_lp_token.events.RemoveLiquidityImbalance.decode(log) - const curveLP = await getLatestCurveLP(ctx, result, block, log) + const { curveLP } = await getLatestCurveLP( + ctx, + result, + block, + log.transactionHash, + ) curveLP.totalSupply = token_supply - curveLP.eth = eth - curveLP.ethOwned = curveLP.totalSupply - ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply - : 0n - curveLP.oethOwned = curveLP.totalSupply - ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply - : 0n } else if (log.topics[0] === curve_lp_token.events.RemoveLiquidityOne.topic) { - const eth = await ctx._chain.client - .call('eth_getBalance', [OETH_CURVE_LP_ADDRESS, block.header.hash]) - .then((r: `0x${string}`) => hexToBigInt(r)) const { token_supply } = curve_lp_token.events.RemoveLiquidityOne.decode(log) - const curveLP = await getLatestCurveLP(ctx, result, block, log) + const { curveLP } = await getLatestCurveLP( + ctx, + result, + block, + log.transactionHash, + ) curveLP.totalSupply = token_supply - curveLP.eth = eth - curveLP.ethOwned = curveLP.totalSupply - ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply - : 0n - curveLP.oethOwned = curveLP.totalSupply - ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply - : 0n } else if (log.topics[0] === curve_lp_token.events.RemoveLiquidity.topic) { - const eth = await ctx._chain.client - .call('eth_getBalance', [OETH_CURVE_LP_ADDRESS, block.header.hash]) - .then((r: `0x${string}`) => hexToBigInt(r)) const { token_supply } = curve_lp_token.events.RemoveLiquidity.decode(log) - const curveLP = await getLatestCurveLP(ctx, result, block, log) + const { curveLP } = await getLatestCurveLP( + ctx, + result, + block, + log.transactionHash, + ) curveLP.totalSupply = token_supply - curveLP.eth = eth - curveLP.ethOwned = curveLP.totalSupply - ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply - : 0n - curveLP.oethOwned = curveLP.totalSupply - ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply - : 0n } } @@ -212,8 +210,13 @@ const processCurveLPTransfer = async ( log, address: OETH_CURVE_LP_OWNER_ADDRESS, tokens: [OETH_CURVE_LP_ADDRESS], - fn: async ({ log, token, change }) => { - const curveLP = await getLatestCurveLP(ctx, result, block, log) + fn: async ({ log, change }) => { + const { curveLP } = await getLatestCurveLP( + ctx, + result, + block, + log.transactionHash, + ) curveLP.totalSupplyOwned += change curveLP.ethOwned = curveLP.totalSupply ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply @@ -230,7 +233,7 @@ const getLatestCurveLP = async ( ctx: Context, result: ProcessResult, block: Context['blocks']['0'], - log: { transactionHash: string }, + transactionHash: string, ) => { const dateId = new Date(block.header.timestamp).toISOString() const { latest, current } = await getLatest( @@ -240,13 +243,14 @@ const getLatestCurveLP = async ( dateId, ) + let isNew = false let curveLP = current if (!curveLP) { curveLP = new CurveLP({ id: dateId, timestamp: new Date(block.header.timestamp), blockNumber: block.header.height, - txHash: log.transactionHash, + txHash: transactionHash, totalSupply: latest?.totalSupply ?? 0n, eth: latest?.eth ?? 0n, oeth: latest?.oeth ?? 0n, @@ -255,6 +259,7 @@ const getLatestCurveLP = async ( oethOwned: latest?.oethOwned ?? 0n, }) result.curveLPs.push(curveLP) + isNew = true } - return curveLP + return { curveLP, isNew } } diff --git a/src/utils/getEthBalance.ts b/src/utils/getEthBalance.ts new file mode 100644 index 00000000..9b19c691 --- /dev/null +++ b/src/utils/getEthBalance.ts @@ -0,0 +1,12 @@ +import { hexToBigInt } from 'viem' + +import { Context } from '../processor' + +export const getEthBalance = async ( + ctx: Context, + address: string, + block: Context['blocks']['0'], +) => + await ctx._chain.client + .call('eth_getBalance', [address, block.header.hash]) + .then((r: `0x${string}`) => hexToBigInt(r)) From 526de24ba461b5106ee50209bf312818c6dd7404 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Tue, 19 Sep 2023 10:36:50 -0700 Subject: [PATCH 19/31] accurate curve lp numbers --- src/model/generated/curveLp.model.ts | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/model/generated/curveLp.model.ts diff --git a/src/model/generated/curveLp.model.ts b/src/model/generated/curveLp.model.ts new file mode 100644 index 00000000..404e159d --- /dev/null +++ b/src/model/generated/curveLp.model.ts @@ -0,0 +1,42 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm" +import * as marshal from "./marshal" + +@Entity_() +export class CurveLP { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @Index_() + @Column_("timestamp with time zone", {nullable: false}) + timestamp!: Date + + @Index_() + @Column_("int4", {nullable: false}) + blockNumber!: number + + @Index_() + @Column_("text", {nullable: false}) + txHash!: string + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + totalSupply!: bigint + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + eth!: bigint + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + oeth!: bigint + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + totalSupplyOwned!: bigint + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + ethOwned!: bigint + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + oethOwned!: bigint +} From 75c39ecd504bbe9b9cc76522a0c7bee185c364ca Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Tue, 19 Sep 2023 14:10:57 -0700 Subject: [PATCH 20/31] compile the multiple financial statement components into FinancialStatement records remove txHash since it is inaccurate - multiple txs exist per block - we're storing by timestamp/block --- ...72381593-Data.js => 1695154585193-Data.js} | 36 ++--- schema.graphql | 8 +- src/main.ts | 13 +- src/model/generated/curveLp.model.ts | 4 - src/model/generated/dripper.model.ts | 4 - .../generated/financialStatement.model.ts | 6 +- src/model/generated/fraxStaking.model.ts | 4 - src/model/generated/morphoAave.model.ts | 4 - src/model/generated/vault.model.ts | 4 - src/processor.ts | 40 ++++-- src/processors/curve-lp/curve-lp.ts | 65 +++------ src/processors/dripper/dripper.ts | 13 +- .../financial-statement.ts | 130 ++++++++++++++++++ src/processors/financial-statement/index.ts | 1 + src/processors/frax-staking/frax-staking.ts | 15 +- src/processors/morpho-aave/morpho-aave.ts | 13 +- src/processors/vault/vault.ts | 33 +++-- src/utils/state.ts | 17 +++ 18 files changed, 260 insertions(+), 150 deletions(-) rename db/migrations/{1695072381593-Data.js => 1695154585193-Data.js} (79%) create mode 100644 src/processors/financial-statement/financial-statement.ts create mode 100644 src/processors/financial-statement/index.ts create mode 100644 src/utils/state.ts diff --git a/db/migrations/1695072381593-Data.js b/db/migrations/1695154585193-Data.js similarity index 79% rename from db/migrations/1695072381593-Data.js rename to db/migrations/1695154585193-Data.js index e505301c..e6944d52 100644 --- a/db/migrations/1695072381593-Data.js +++ b/db/migrations/1695154585193-Data.js @@ -1,5 +1,5 @@ -module.exports = class Data1695072381593 { - name = 'Data1695072381593' +module.exports = class Data1695154585193 { + name = 'Data1695154585193' async up(db) { await db.query(`CREATE TABLE "history" ("id" character varying NOT NULL, "value" numeric NOT NULL, "balance" numeric NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "type" text NOT NULL, "address_id" character varying, CONSTRAINT "PK_9384942edf4804b38ca0ee51416" PRIMARY KEY ("id"))`) @@ -21,32 +21,26 @@ module.exports = class Data1695072381593 { await db.query(`CREATE INDEX "IDX_e59c9a534fcf23a97a8ac92afa" ON "rebase_option" ("block_number") `) await db.query(`CREATE INDEX "IDX_6b6c08ec25dacd1a5bd6170152" ON "rebase_option" ("tx_hash") `) await db.query(`CREATE INDEX "IDX_66c04aee6855c74debae4add8f" ON "rebase_option" ("address_id") `) - await db.query(`CREATE TABLE "vault" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "eth" numeric NOT NULL, "weth" numeric NOT NULL, "st_eth" numeric NOT NULL, "r_eth" numeric NOT NULL, "frx_eth" numeric NOT NULL, CONSTRAINT "PK_dd0898234c77f9d97585171ac59" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "vault" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "eth" numeric NOT NULL, "weth" numeric NOT NULL, "st_eth" numeric NOT NULL, "r_eth" numeric NOT NULL, "frx_eth" numeric NOT NULL, CONSTRAINT "PK_dd0898234c77f9d97585171ac59" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_0f1a5b7e346813a4ec3a03010b" ON "vault" ("timestamp") `) await db.query(`CREATE INDEX "IDX_a9b314451a9001a7b0a222f68a" ON "vault" ("block_number") `) - await db.query(`CREATE INDEX "IDX_534a4b5cb80e57e6e7d138b869" ON "vault" ("tx_hash") `) - await db.query(`CREATE TABLE "curve_lp" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "total_supply" numeric NOT NULL, "eth" numeric NOT NULL, "oeth" numeric NOT NULL, "total_supply_owned" numeric NOT NULL, "eth_owned" numeric NOT NULL, "oeth_owned" numeric NOT NULL, CONSTRAINT "PK_78cd36e42a49ac6ca38349e93ca" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "curve_lp" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "total_supply" numeric NOT NULL, "eth" numeric NOT NULL, "oeth" numeric NOT NULL, "total_supply_owned" numeric NOT NULL, "eth_owned" numeric NOT NULL, "oeth_owned" numeric NOT NULL, CONSTRAINT "PK_78cd36e42a49ac6ca38349e93ca" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_330db36ce24d451bd225362497" ON "curve_lp" ("timestamp") `) await db.query(`CREATE INDEX "IDX_21dec6975ac5df4cb0cf36a117" ON "curve_lp" ("block_number") `) - await db.query(`CREATE INDEX "IDX_b20dd512c2ef32c92dd1d4fd1d" ON "curve_lp" ("tx_hash") `) - await db.query(`CREATE TABLE "frax_staking" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "frx_eth" numeric NOT NULL, CONSTRAINT "PK_8e4f242a30dc9aa67ce89dd9011" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "frax_staking" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "frx_eth" numeric NOT NULL, CONSTRAINT "PK_8e4f242a30dc9aa67ce89dd9011" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_c40e57574ecb23502fa6755b03" ON "frax_staking" ("timestamp") `) await db.query(`CREATE INDEX "IDX_ac105b3fae6f14114535b8d0e2" ON "frax_staking" ("block_number") `) - await db.query(`CREATE INDEX "IDX_a7ed335fc044ab5077cd1fa544" ON "frax_staking" ("tx_hash") `) - await db.query(`CREATE TABLE "morpho_aave" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "weth" numeric NOT NULL, CONSTRAINT "PK_8b9569518db5529db65205aaafe" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "morpho_aave" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "weth" numeric NOT NULL, CONSTRAINT "PK_8b9569518db5529db65205aaafe" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_3570ea91a91129f64a38665d39" ON "morpho_aave" ("timestamp") `) await db.query(`CREATE INDEX "IDX_1263cc804aa44983b8f146c2c4" ON "morpho_aave" ("block_number") `) - await db.query(`CREATE INDEX "IDX_f2dcb463ee37e7ea641de047df" ON "morpho_aave" ("tx_hash") `) - await db.query(`CREATE TABLE "dripper" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "weth" numeric NOT NULL, CONSTRAINT "PK_74fd102c8d1c60f4b1650a61ffc" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "dripper" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "weth" numeric NOT NULL, CONSTRAINT "PK_74fd102c8d1c60f4b1650a61ffc" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_88c58f8948c3294c2a9e2791dc" ON "dripper" ("timestamp") `) await db.query(`CREATE INDEX "IDX_06822c0a260797711acc9023d5" ON "dripper" ("block_number") `) - await db.query(`CREATE INDEX "IDX_00e3b19ec41de0785079baeca5" ON "dripper" ("tx_hash") `) - await db.query(`CREATE TABLE "financial_statement" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "vault_id" character varying, "curve_id" character varying, "frax_staking_id" character varying, "morpho_aave_id" character varying, "dripper_id" character varying, CONSTRAINT "PK_4e795d12a43006ece4788e13371" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "financial_statement" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "vault_id" character varying, "curve_lp_id" character varying, "frax_staking_id" character varying, "morpho_aave_id" character varying, "dripper_id" character varying, CONSTRAINT "PK_4e795d12a43006ece4788e13371" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_ef18e864908765e31b7232fe41" ON "financial_statement" ("timestamp") `) await db.query(`CREATE INDEX "IDX_0b50f0a8fca1f65659ce36feb4" ON "financial_statement" ("block_number") `) - await db.query(`CREATE INDEX "IDX_e1979157fdc9f59d396e8f8440" ON "financial_statement" ("tx_hash") `) await db.query(`CREATE INDEX "IDX_9f37653694923d2b62c6c01190" ON "financial_statement" ("vault_id") `) - await db.query(`CREATE INDEX "IDX_f809f02abcc22d9ef50c97b42c" ON "financial_statement" ("curve_id") `) + await db.query(`CREATE INDEX "IDX_4b9b21bbd516414896d4afed7f" ON "financial_statement" ("curve_lp_id") `) await db.query(`CREATE INDEX "IDX_b5c2c4b2d43680e3c6470d7f9d" ON "financial_statement" ("frax_staking_id") `) await db.query(`CREATE INDEX "IDX_a610e78431c0dd56724129f223" ON "financial_statement" ("morpho_aave_id") `) await db.query(`CREATE INDEX "IDX_7a506ebb6c720f35607810b734" ON "financial_statement" ("dripper_id") `) @@ -54,7 +48,7 @@ module.exports = class Data1695072381593 { await db.query(`ALTER TABLE "rebase" ADD CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2" FOREIGN KEY ("apy_id") REFERENCES "apy"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "rebase_option" ADD CONSTRAINT "FK_66c04aee6855c74debae4add8fe" FOREIGN KEY ("address_id") REFERENCES "address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_9f37653694923d2b62c6c01190b" FOREIGN KEY ("vault_id") REFERENCES "vault"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) - await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_f809f02abcc22d9ef50c97b42c8" FOREIGN KEY ("curve_id") REFERENCES "curve_lp"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_4b9b21bbd516414896d4afed7fe" FOREIGN KEY ("curve_lp_id") REFERENCES "curve_lp"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_b5c2c4b2d43680e3c6470d7f9df" FOREIGN KEY ("frax_staking_id") REFERENCES "frax_staking"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_a610e78431c0dd56724129f2236" FOREIGN KEY ("morpho_aave_id") REFERENCES "morpho_aave"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_7a506ebb6c720f35607810b7347" FOREIGN KEY ("dripper_id") REFERENCES "dripper"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) @@ -83,29 +77,23 @@ module.exports = class Data1695072381593 { await db.query(`DROP TABLE "vault"`) await db.query(`DROP INDEX "public"."IDX_0f1a5b7e346813a4ec3a03010b"`) await db.query(`DROP INDEX "public"."IDX_a9b314451a9001a7b0a222f68a"`) - await db.query(`DROP INDEX "public"."IDX_534a4b5cb80e57e6e7d138b869"`) await db.query(`DROP TABLE "curve_lp"`) await db.query(`DROP INDEX "public"."IDX_330db36ce24d451bd225362497"`) await db.query(`DROP INDEX "public"."IDX_21dec6975ac5df4cb0cf36a117"`) - await db.query(`DROP INDEX "public"."IDX_b20dd512c2ef32c92dd1d4fd1d"`) await db.query(`DROP TABLE "frax_staking"`) await db.query(`DROP INDEX "public"."IDX_c40e57574ecb23502fa6755b03"`) await db.query(`DROP INDEX "public"."IDX_ac105b3fae6f14114535b8d0e2"`) - await db.query(`DROP INDEX "public"."IDX_a7ed335fc044ab5077cd1fa544"`) await db.query(`DROP TABLE "morpho_aave"`) await db.query(`DROP INDEX "public"."IDX_3570ea91a91129f64a38665d39"`) await db.query(`DROP INDEX "public"."IDX_1263cc804aa44983b8f146c2c4"`) - await db.query(`DROP INDEX "public"."IDX_f2dcb463ee37e7ea641de047df"`) await db.query(`DROP TABLE "dripper"`) await db.query(`DROP INDEX "public"."IDX_88c58f8948c3294c2a9e2791dc"`) await db.query(`DROP INDEX "public"."IDX_06822c0a260797711acc9023d5"`) - await db.query(`DROP INDEX "public"."IDX_00e3b19ec41de0785079baeca5"`) await db.query(`DROP TABLE "financial_statement"`) await db.query(`DROP INDEX "public"."IDX_ef18e864908765e31b7232fe41"`) await db.query(`DROP INDEX "public"."IDX_0b50f0a8fca1f65659ce36feb4"`) - await db.query(`DROP INDEX "public"."IDX_e1979157fdc9f59d396e8f8440"`) await db.query(`DROP INDEX "public"."IDX_9f37653694923d2b62c6c01190"`) - await db.query(`DROP INDEX "public"."IDX_f809f02abcc22d9ef50c97b42c"`) + await db.query(`DROP INDEX "public"."IDX_4b9b21bbd516414896d4afed7f"`) await db.query(`DROP INDEX "public"."IDX_b5c2c4b2d43680e3c6470d7f9d"`) await db.query(`DROP INDEX "public"."IDX_a610e78431c0dd56724129f223"`) await db.query(`DROP INDEX "public"."IDX_7a506ebb6c720f35607810b734"`) @@ -113,7 +101,7 @@ module.exports = class Data1695072381593 { await db.query(`ALTER TABLE "rebase" DROP CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2"`) await db.query(`ALTER TABLE "rebase_option" DROP CONSTRAINT "FK_66c04aee6855c74debae4add8fe"`) await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_9f37653694923d2b62c6c01190b"`) - await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_f809f02abcc22d9ef50c97b42c8"`) + await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_4b9b21bbd516414896d4afed7fe"`) await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_b5c2c4b2d43680e3c6470d7f9df"`) await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_a610e78431c0dd56724129f2236"`) await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_7a506ebb6c720f35607810b7347"`) diff --git a/schema.graphql b/schema.graphql index eaf2b82f..21d230c0 100644 --- a/schema.graphql +++ b/schema.graphql @@ -57,9 +57,8 @@ type FinancialStatement @entity { id: ID! timestamp: DateTime! @index blockNumber: Int! @index - txHash: String! @index vault: Vault! - curve: CurveLP! + curveLP: CurveLP! fraxStaking: FraxStaking! morphoAave: MorphoAave! dripper: Dripper! @@ -70,7 +69,6 @@ type Vault @entity { id: ID! timestamp: DateTime! @index blockNumber: Int! @index - txHash: String! @index eth: BigInt! weth: BigInt! stETH: BigInt! @@ -85,7 +83,6 @@ type CurveLP @entity { id: ID! timestamp: DateTime! @index blockNumber: Int! @index - txHash: String! @index totalSupply: BigInt! eth: BigInt! oeth: BigInt! @@ -99,7 +96,6 @@ type FraxStaking @entity { id: ID! timestamp: DateTime! @index blockNumber: Int! @index - txHash: String! @index frxETH: BigInt! } @@ -108,7 +104,6 @@ type MorphoAave @entity { id: ID! timestamp: DateTime! @index blockNumber: Int! @index - txHash: String! @index weth: BigInt! } @@ -117,6 +112,5 @@ type Dripper @entity { id: ID! timestamp: DateTime! @index blockNumber: Int! @index - txHash: String! @index weth: BigInt! } diff --git a/src/main.ts b/src/main.ts index 1ffbc988..4bddbf1a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,10 +1,21 @@ import { run } from './processor' import * as curveLp from './processors/curve-lp' import * as dripper from './processors/dripper' +import * as financialStatement from './processors/financial-statement' import * as fraxStaking from './processors/frax-staking' import * as morphoAave from './processors/morpho-aave' import * as oeth from './processors/oeth' import * as vault from './processors/vault' // The idea is that these processors have zero dependencies on one another and can be processed asynchronously. -run([oeth, vault, fraxStaking, morphoAave, dripper, curveLp]) +run({ + processors: [ + // oeth, + vault, + fraxStaking, + morphoAave, + dripper, + curveLp, + ], + postProcessors: [financialStatement], +}) diff --git a/src/model/generated/curveLp.model.ts b/src/model/generated/curveLp.model.ts index 404e159d..37aef4fe 100644 --- a/src/model/generated/curveLp.model.ts +++ b/src/model/generated/curveLp.model.ts @@ -18,10 +18,6 @@ export class CurveLP { @Column_("int4", {nullable: false}) blockNumber!: number - @Index_() - @Column_("text", {nullable: false}) - txHash!: string - @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) totalSupply!: bigint diff --git a/src/model/generated/dripper.model.ts b/src/model/generated/dripper.model.ts index 08f04e1e..54f87d0f 100644 --- a/src/model/generated/dripper.model.ts +++ b/src/model/generated/dripper.model.ts @@ -18,10 +18,6 @@ export class Dripper { @Column_("int4", {nullable: false}) blockNumber!: number - @Index_() - @Column_("text", {nullable: false}) - txHash!: string - @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) weth!: bigint } diff --git a/src/model/generated/financialStatement.model.ts b/src/model/generated/financialStatement.model.ts index 5e372879..3a71e51b 100644 --- a/src/model/generated/financialStatement.model.ts +++ b/src/model/generated/financialStatement.model.ts @@ -22,17 +22,13 @@ export class FinancialStatement { @Column_("int4", {nullable: false}) blockNumber!: number - @Index_() - @Column_("text", {nullable: false}) - txHash!: string - @Index_() @ManyToOne_(() => Vault, {nullable: true}) vault!: Vault @Index_() @ManyToOne_(() => CurveLP, {nullable: true}) - curve!: CurveLP + curveLP!: CurveLP @Index_() @ManyToOne_(() => FraxStaking, {nullable: true}) diff --git a/src/model/generated/fraxStaking.model.ts b/src/model/generated/fraxStaking.model.ts index 51d1f748..7acd561a 100644 --- a/src/model/generated/fraxStaking.model.ts +++ b/src/model/generated/fraxStaking.model.ts @@ -18,10 +18,6 @@ export class FraxStaking { @Column_("int4", {nullable: false}) blockNumber!: number - @Index_() - @Column_("text", {nullable: false}) - txHash!: string - @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) frxETH!: bigint } diff --git a/src/model/generated/morphoAave.model.ts b/src/model/generated/morphoAave.model.ts index 0dc150aa..7361cae4 100644 --- a/src/model/generated/morphoAave.model.ts +++ b/src/model/generated/morphoAave.model.ts @@ -18,10 +18,6 @@ export class MorphoAave { @Column_("int4", {nullable: false}) blockNumber!: number - @Index_() - @Column_("text", {nullable: false}) - txHash!: string - @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) weth!: bigint } diff --git a/src/model/generated/vault.model.ts b/src/model/generated/vault.model.ts index 8eb594a2..ceab9baa 100644 --- a/src/model/generated/vault.model.ts +++ b/src/model/generated/vault.model.ts @@ -18,10 +18,6 @@ export class Vault { @Column_("int4", {nullable: false}) blockNumber!: number - @Index_() - @Column_("text", {nullable: false}) - txHash!: string - @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) eth!: bigint diff --git a/src/processor.ts b/src/processor.ts index 083f9483..2acbacca 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -9,6 +9,8 @@ import { } from '@subsquid/evm-processor' import { Store, TypeormDatabase } from '@subsquid/typeorm-store' +import { resetProcessorState } from './utils/state' + export const processor = new EvmBatchProcessor() .setDataSource({ // Change the Archive endpoints for run the squid @@ -57,25 +59,41 @@ export const processor = new EvmBatchProcessor() }, }) -export const run = ( - processors: { - name?: string - from: number - setup: (p: typeof processor) => void - process: (ctx: Context) => Promise - }[], -) => { - processor.setBlockRange({ from: Math.min(...processors.map((p) => p.from)) }) - processors.forEach((p) => p.setup(processor)) +interface Processor { + name?: string + from?: number + setup?: (p: typeof processor) => void + process: (ctx: Context) => Promise +} + +export const run = ({ + processors, + postProcessors = [], +}: { + processors: Processor[] + postProcessors: Processor[] +}) => { + processor.setBlockRange({ + from: Math.min( + ...(processors.map((p) => p.from).filter((x) => x) as number[]), + ), + }) + processors.forEach((p) => p.setup?.(processor)) processor.run( new TypeormDatabase({ supportHotBlocks: true }), async (ctx) => { + resetProcessorState() let start = Date.now() const time = (name: string) => () => ctx.log.info(`${name} ${Date.now() - start}ms`) await Promise.all( processors.map((p, index) => - p.process(ctx).then(time(p.name ?? `p${index}`)), + p.process(ctx).then(time(p.name ?? `processor-${index}`)), + ), + ) + await Promise.all( + postProcessors.map((p, index) => + p.process(ctx).then(time(p.name ?? `postProcessor-${index}`)), ), ) }, diff --git a/src/processors/curve-lp/curve-lp.ts b/src/processors/curve-lp/curve-lp.ts index a5575fbe..35e2b890 100644 --- a/src/processors/curve-lp/curve-lp.ts +++ b/src/processors/curve-lp/curve-lp.ts @@ -11,6 +11,7 @@ import { OETH_CURVE_LP_OWNER_ADDRESS, } from '../../utils/addresses' import { getEthBalance } from '../../utils/getEthBalance' +import { updateFinancialStatement } from '../financial-statement' import { getLatest, trackAddressBalances } from '../utils' interface ProcessResult { @@ -79,7 +80,7 @@ export const process = async (ctx: Context) => { await processCurveLPTransfer(ctx, result, block, log) if (!haveUpdatedEthBalance) { haveUpdatedEthBalance = true - await updateETHBalance(ctx, result, block, log.transactionHash) + await updateETHBalance(ctx, result, block) } } } @@ -101,11 +102,12 @@ const updateETHBalance = async ( ctx: Context, result: ProcessResult, block: Context['blocks']['0'], - transactionHash: string, ) => { const [eth, { curveLP, isNew }] = await Promise.all([ getEthBalance(ctx, OETH_CURVE_LP_ADDRESS, block), - getLatestCurveLP(ctx, result, block, transactionHash), + getLatestCurveLP(ctx, result, block, { + skipFinancialStatementUpdate: true, + }), ]) if (curveLP.eth === eth) { // No change, let's cancel what we're doing. @@ -114,6 +116,7 @@ const updateETHBalance = async ( } return } + await updateFinancialStatement(ctx, block, { curveLP }) curveLP.eth = eth curveLP.ethOwned = curveLP.totalSupply ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply @@ -135,12 +138,7 @@ const processHoldingsTransfer = async ( address: OETH_CURVE_LP_ADDRESS, tokens: [OETH_ADDRESS], fn: async ({ log, change }) => { - const { curveLP } = await getLatestCurveLP( - ctx, - result, - block, - log.transactionHash, - ) + const { curveLP } = await getLatestCurveLP(ctx, result, block) curveLP.oeth += change curveLP.oethOwned = curveLP.totalSupply ? (curveLP.oeth * curveLP.totalSupplyOwned) / curveLP.totalSupply @@ -158,43 +156,23 @@ const processLiquidityEvents = async ( ) => { if (log.topics[0] === curve_lp_token.events.AddLiquidity.topic) { const { token_supply } = curve_lp_token.events.AddLiquidity.decode(log) - const { curveLP } = await getLatestCurveLP( - ctx, - result, - block, - log.transactionHash, - ) + const { curveLP } = await getLatestCurveLP(ctx, result, block) curveLP.totalSupply = token_supply } else if ( log.topics[0] === curve_lp_token.events.RemoveLiquidityImbalance.topic ) { const { token_supply } = curve_lp_token.events.RemoveLiquidityImbalance.decode(log) - const { curveLP } = await getLatestCurveLP( - ctx, - result, - block, - log.transactionHash, - ) + const { curveLP } = await getLatestCurveLP(ctx, result, block) curveLP.totalSupply = token_supply } else if (log.topics[0] === curve_lp_token.events.RemoveLiquidityOne.topic) { const { token_supply } = curve_lp_token.events.RemoveLiquidityOne.decode(log) - const { curveLP } = await getLatestCurveLP( - ctx, - result, - block, - log.transactionHash, - ) + const { curveLP } = await getLatestCurveLP(ctx, result, block) curveLP.totalSupply = token_supply } else if (log.topics[0] === curve_lp_token.events.RemoveLiquidity.topic) { const { token_supply } = curve_lp_token.events.RemoveLiquidity.decode(log) - const { curveLP } = await getLatestCurveLP( - ctx, - result, - block, - log.transactionHash, - ) + const { curveLP } = await getLatestCurveLP(ctx, result, block) curveLP.totalSupply = token_supply } } @@ -210,13 +188,8 @@ const processCurveLPTransfer = async ( log, address: OETH_CURVE_LP_OWNER_ADDRESS, tokens: [OETH_CURVE_LP_ADDRESS], - fn: async ({ log, change }) => { - const { curveLP } = await getLatestCurveLP( - ctx, - result, - block, - log.transactionHash, - ) + fn: async ({ change }) => { + const { curveLP } = await getLatestCurveLP(ctx, result, block) curveLP.totalSupplyOwned += change curveLP.ethOwned = curveLP.totalSupply ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply @@ -233,24 +206,23 @@ const getLatestCurveLP = async ( ctx: Context, result: ProcessResult, block: Context['blocks']['0'], - transactionHash: string, + options?: { skipFinancialStatementUpdate: boolean }, ) => { - const dateId = new Date(block.header.timestamp).toISOString() + const timestampId = new Date(block.header.timestamp).toISOString() const { latest, current } = await getLatest( ctx, CurveLP, result.curveLPs, - dateId, + timestampId, ) let isNew = false let curveLP = current if (!curveLP) { curveLP = new CurveLP({ - id: dateId, + id: timestampId, timestamp: new Date(block.header.timestamp), blockNumber: block.header.height, - txHash: transactionHash, totalSupply: latest?.totalSupply ?? 0n, eth: latest?.eth ?? 0n, oeth: latest?.oeth ?? 0n, @@ -259,6 +231,9 @@ const getLatestCurveLP = async ( oethOwned: latest?.oethOwned ?? 0n, }) result.curveLPs.push(curveLP) + if (!options?.skipFinancialStatementUpdate) { + await updateFinancialStatement(ctx, block, { curveLP }) + } isNew = true } return { curveLP, isNew } diff --git a/src/processors/dripper/dripper.ts b/src/processors/dripper/dripper.ts index 5dad5654..8bfab47b 100644 --- a/src/processors/dripper/dripper.ts +++ b/src/processors/dripper/dripper.ts @@ -5,6 +5,7 @@ import * as erc20 from '../../abi/erc20' import { Dripper } from '../../model' import { Context } from '../../processor' import { OETH_DRIPPER_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' +import { updateFinancialStatement } from '../financial-statement' import { getLatest, trackAddressBalances } from '../utils' interface ProcessResult { @@ -52,29 +53,27 @@ const processTransfer = async ( address: OETH_DRIPPER_ADDRESS, tokens: [WETH_ADDRESS], fn: async ({ log, token, change }) => { - const dateId = new Date(block.header.timestamp).toISOString() + const timestampId = new Date(block.header.timestamp).toISOString() const { latest, current } = await getLatest( ctx, Dripper, result.drippers, - dateId, + timestampId, ) let dripper = current if (!dripper) { dripper = new Dripper({ - id: dateId, + id: timestampId, timestamp: new Date(block.header.timestamp), blockNumber: block.header.height, - txHash: log.transactionHash, weth: latest?.weth ?? 0n, }) result.drippers.push(dripper) + await updateFinancialStatement(ctx, block, { dripper }) } - if (token === WETH_ADDRESS) { - dripper.weth += change - } + dripper.weth += change }, }) } diff --git a/src/processors/financial-statement/financial-statement.ts b/src/processors/financial-statement/financial-statement.ts new file mode 100644 index 00000000..3cf4a1b3 --- /dev/null +++ b/src/processors/financial-statement/financial-statement.ts @@ -0,0 +1,130 @@ +import { LessThan, LessThanOrEqual } from 'typeorm' + +import { + CurveLP, + Dripper, + FinancialStatement, + FraxStaking, + MorphoAave, + Vault, +} from '../../model' +import { Context } from '../../processor' +import { useProcessorState } from '../../utils/state' + +export const useFinancialStatements = () => { + return useProcessorState>( + 'financial-statement', + new Map(), + ) +} + +export const updateFinancialStatement = async ( + ctx: Context, + block: Context['blocks']['0'], + partial: Partial< + Pick< + FinancialStatement, + 'vault' | 'curveLP' | 'dripper' | 'fraxStaking' | 'morphoAave' + > + >, +) => { + const timestamp = new Date(block.header.timestamp) + const timestampId = timestamp.toISOString() + const blockNumber = block.header.height + const [financialStatements] = useFinancialStatements() + + const lastFinancialStatement = await ctx.store.findOne(FinancialStatement, { + where: { id: LessThan(timestampId) }, + order: { id: 'desc' }, + relations: { + vault: true, + morphoAave: true, + dripper: true, + curveLP: true, + fraxStaking: true, + }, + }) + + ctx.log.info({ lastFinancialStatement }) + + let financialStatement: FinancialStatement + if (!lastFinancialStatement) { + financialStatement = new FinancialStatement({ + id: timestampId, + timestamp, + blockNumber, + ...partial, + }) + if (!financialStatement.curveLP) { + financialStatement.curveLP = new CurveLP({ + id: timestampId, + timestamp, + blockNumber, + eth: 0n, + ethOwned: 0n, + oeth: 0n, + oethOwned: 0n, + totalSupply: 0n, + totalSupplyOwned: 0n, + }) + await ctx.store.insert(financialStatement.curveLP) + } + if (!financialStatement.fraxStaking) { + financialStatement.fraxStaking = new FraxStaking({ + id: timestampId, + timestamp, + blockNumber, + frxETH: 0n, + }) + await ctx.store.insert(financialStatement.fraxStaking) + } + if (!financialStatement.dripper) { + financialStatement.dripper = new Dripper({ + id: timestampId, + timestamp, + blockNumber, + weth: 0n, + }) + await ctx.store.insert(financialStatement.dripper) + } + if (!financialStatement.morphoAave) { + financialStatement.morphoAave = new MorphoAave({ + id: timestampId, + timestamp, + blockNumber, + weth: 0n, + }) + await ctx.store.insert(financialStatement.morphoAave) + } + if (!financialStatement.vault) { + financialStatement.vault = new Vault({ + id: timestampId, + timestamp, + blockNumber, + eth: 0n, + weth: 0n, + frxETH: 0n, + rETH: 0n, + stETH: 0n, + }) + await ctx.store.insert(financialStatement.vault) + } + } else { + financialStatement = + financialStatements.get(timestampId) ?? + new FinancialStatement({ + ...lastFinancialStatement, + id: timestampId, + timestamp, + blockNumber, + ...partial, + }) + } + + financialStatements.set(timestampId, financialStatement) +} + +export const process = async (ctx: Context) => { + const [financialStatements] = useFinancialStatements() + await ctx.store.upsert([...financialStatements.values()]) +} diff --git a/src/processors/financial-statement/index.ts b/src/processors/financial-statement/index.ts new file mode 100644 index 00000000..1febb7b2 --- /dev/null +++ b/src/processors/financial-statement/index.ts @@ -0,0 +1 @@ +export * from './financial-statement' diff --git a/src/processors/frax-staking/frax-staking.ts b/src/processors/frax-staking/frax-staking.ts index 32e8435a..ef9c4b1d 100644 --- a/src/processors/frax-staking/frax-staking.ts +++ b/src/processors/frax-staking/frax-staking.ts @@ -8,6 +8,7 @@ import { OETH_FRAX_STAKING_ADDRESS, SFRXETH_ADDRESS, } from '../../utils/addresses' +import { updateFinancialStatement } from '../financial-statement' import { getLatest, trackAddressBalances } from '../utils' interface ProcessResult { @@ -54,30 +55,28 @@ const processTransfer = async ( log, address: OETH_FRAX_STAKING_ADDRESS, tokens: [SFRXETH_ADDRESS], - fn: async ({ log, token, change }) => { - const dateId = new Date(block.header.timestamp).toISOString() + fn: async ({ token, change }) => { + const timestampId = new Date(block.header.timestamp).toISOString() const { latest, current } = await getLatest( ctx, FraxStaking, result.fraxStakings, - dateId, + timestampId, ) let fraxStaking = current if (!fraxStaking) { fraxStaking = new FraxStaking({ - id: dateId, + id: timestampId, timestamp: new Date(block.header.timestamp), blockNumber: block.header.height, - txHash: log.transactionHash, frxETH: latest?.frxETH ?? 0n, }) result.fraxStakings.push(fraxStaking) + await updateFinancialStatement(ctx, block, { fraxStaking }) } - if (token === SFRXETH_ADDRESS) { - fraxStaking.frxETH += change - } + fraxStaking.frxETH += change }, }) } diff --git a/src/processors/morpho-aave/morpho-aave.ts b/src/processors/morpho-aave/morpho-aave.ts index b93ab9df..d1245c4f 100644 --- a/src/processors/morpho-aave/morpho-aave.ts +++ b/src/processors/morpho-aave/morpho-aave.ts @@ -5,6 +5,7 @@ import * as erc20 from '../../abi/erc20' import { MorphoAave } from '../../model' import { Context } from '../../processor' import { OETH_MORPHO_AAVE_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' +import { updateFinancialStatement } from '../financial-statement' import { getLatest, trackAddressBalances } from '../utils' interface ProcessResult { @@ -52,29 +53,27 @@ const processTransfer = async ( address: OETH_MORPHO_AAVE_ADDRESS, tokens: [WETH_ADDRESS], fn: async ({ log, token, change }) => { - const dateId = new Date(block.header.timestamp).toISOString() + const timestampId = new Date(block.header.timestamp).toISOString() const { latest, current } = await getLatest( ctx, MorphoAave, result.morphoAaves, - dateId, + timestampId, ) let morphoAave = current if (!morphoAave) { morphoAave = new MorphoAave({ - id: dateId, + id: timestampId, timestamp: new Date(block.header.timestamp), blockNumber: block.header.height, - txHash: log.transactionHash, weth: latest?.weth ?? 0n, }) result.morphoAaves.push(morphoAave) + await updateFinancialStatement(ctx, block, { morphoAave }) } - if (token === WETH_ADDRESS) { - morphoAave.weth += change - } + morphoAave.weth += change }, }) } diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts index c57096a3..01702ffb 100644 --- a/src/processors/vault/vault.ts +++ b/src/processors/vault/vault.ts @@ -14,6 +14,10 @@ import { VAULT_ERC20_ADDRESSES, WETH_ADDRESS, } from '../../utils/addresses' +import { + updateFinancialStatement, + useFinancialStatements, +} from '../financial-statement' import { getLatest, trackAddressBalances } from '../utils' interface ProcessResult { @@ -63,14 +67,10 @@ const processNativeTransfers = async ( transaction.from.toLowerCase() === OETH_CURVE_LP_ADDRESS && transaction.to?.toLowerCase() !== OETH_CURVE_LP_ADDRESS ) { - const vault = await getLatestVault(ctx, result, block, { - transactionHash: transaction.hash, - }) + const vault = await getLatestVault(ctx, result, block) vault.eth -= transaction.value } else if (transaction.to?.toLowerCase() === OETH_CURVE_LP_ADDRESS) { - const vault = await getLatestVault(ctx, result, block, { - transactionHash: transaction.hash, - }) + const vault = await getLatestVault(ctx, result, block) vault.eth += transaction.value } } @@ -88,10 +88,10 @@ const processTransfer = async ( log.transaction.from === OETH_VAULT_ADDRESS && log.transaction.to !== OETH_VAULT_ADDRESS ) { - const vault = await getLatestVault(ctx, result, block, log) + const vault = await getLatestVault(ctx, result, block) vault.eth -= log.transaction.value } else if (log.transaction.to === OETH_VAULT_ADDRESS) { - const vault = await getLatestVault(ctx, result, block, log) + const vault = await getLatestVault(ctx, result, block) vault.eth += log.transaction.value } } @@ -103,7 +103,7 @@ const processTransfer = async ( address: OETH_VAULT_ADDRESS, tokens: VAULT_ERC20_ADDRESSES, fn: async ({ log, token, change }) => { - const vault = await getLatestVault(ctx, result, block, log) + const vault = await getLatestVault(ctx, result, block) if (token === WETH_ADDRESS) { vault.weth += change } else if (token === RETH_ADDRESS) { @@ -122,18 +122,20 @@ const getLatestVault = async ( ctx: Context, result: ProcessResult, block: Context['blocks']['0'], - log: { transactionHash: string }, ) => { - const dateId = new Date(block.header.timestamp).toISOString() - const { latest, current } = await getLatest(ctx, Vault, result.vaults, dateId) - + const timestampId = new Date(block.header.timestamp).toISOString() + const { latest, current } = await getLatest( + ctx, + Vault, + result.vaults, + timestampId, + ) let vault = current if (!vault) { vault = new Vault({ - id: dateId, + id: timestampId, timestamp: new Date(block.header.timestamp), blockNumber: block.header.height, - txHash: log.transactionHash, eth: latest?.eth ?? 0n, weth: latest?.weth ?? 0n, rETH: latest?.rETH ?? 0n, @@ -141,6 +143,7 @@ const getLatestVault = async ( frxETH: latest?.frxETH ?? 0n, }) result.vaults.push(vault) + await updateFinancialStatement(ctx, block, { vault }) } return vault } diff --git a/src/utils/state.ts b/src/utils/state.ts new file mode 100644 index 00000000..b9d54444 --- /dev/null +++ b/src/utils/state.ts @@ -0,0 +1,17 @@ +let state = new Map() +export const resetProcessorState = () => { + state = new Map() +} +export const useProcessorState = (key: string, defaultValue: T) => { + let value = state.get(key) as T | undefined + if (!value) { + value = defaultValue + state.set(key, value) + } + return [ + value, + (value: T) => { + state.set(key, value) + }, + ] as const +} From c2edd2e99c457c20aad9641dcb92896716461df7 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Tue, 19 Sep 2023 14:51:21 -0700 Subject: [PATCH 21/31] change how eth value is calculated in vault --- src/processor.ts | 1 + .../financial-statement.ts | 4 +- src/processors/vault/vault.ts | 60 ++++++++++--------- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/processor.ts b/src/processor.ts index 2acbacca..c2a48980 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -91,6 +91,7 @@ export const run = ({ p.process(ctx).then(time(p.name ?? `processor-${index}`)), ), ) + start = Date.now() await Promise.all( postProcessors.map((p, index) => p.process(ctx).then(time(p.name ?? `postProcessor-${index}`)), diff --git a/src/processors/financial-statement/financial-statement.ts b/src/processors/financial-statement/financial-statement.ts index 3cf4a1b3..88e01e66 100644 --- a/src/processors/financial-statement/financial-statement.ts +++ b/src/processors/financial-statement/financial-statement.ts @@ -44,9 +44,7 @@ export const updateFinancialStatement = async ( fraxStaking: true, }, }) - - ctx.log.info({ lastFinancialStatement }) - + let financialStatement: FinancialStatement if (!lastFinancialStatement) { financialStatement = new FinancialStatement({ diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts index 01702ffb..45d07441 100644 --- a/src/processors/vault/vault.ts +++ b/src/processors/vault/vault.ts @@ -14,6 +14,7 @@ import { VAULT_ERC20_ADDRESSES, WETH_ADDRESS, } from '../../utils/addresses' +import { getEthBalance } from '../../utils/getEthBalance' import { updateFinancialStatement, useFinancialStatements, @@ -37,6 +38,12 @@ export const setup = (processor: EvmBatchProcessor) => { topic0: [erc20.events.Transfer.topic], topic2: [pad(OETH_VAULT_ADDRESS)], }) + processor.addTransaction({ + from: [OETH_VAULT_ADDRESS], + }) + processor.addTransaction({ + to: [OETH_VAULT_ADDRESS], + }) } export const process = async (ctx: Context) => { @@ -62,16 +69,21 @@ const processNativeTransfers = async ( block: Context['blocks']['0'], transaction: Context['blocks']['0']['transactions']['0'], ) => { - if (transaction.value > 0n) { - if ( - transaction.from.toLowerCase() === OETH_CURVE_LP_ADDRESS && - transaction.to?.toLowerCase() !== OETH_CURVE_LP_ADDRESS - ) { - const vault = await getLatestVault(ctx, result, block) - vault.eth -= transaction.value - } else if (transaction.to?.toLowerCase() === OETH_CURVE_LP_ADDRESS) { - const vault = await getLatestVault(ctx, result, block) - vault.eth += transaction.value + if ( + transaction.from === OETH_CURVE_LP_ADDRESS || + transaction.to === OETH_CURVE_LP_ADDRESS + ) { + const { vault, isNew } = await getLatestVault(ctx, result, block, { + skipFinancialStatementUpdate: true, + }) + const eth = await getEthBalance(ctx, OETH_CURVE_LP_ADDRESS, block) + if (vault.eth === eth) { + // Nothing to do, remove the new vault record if we created one. + if (isNew) { + result.vaults.pop() + } + } else { + vault.eth = eth } } } @@ -82,28 +94,13 @@ const processTransfer = async ( block: Context['blocks']['0'], log: Context['blocks']['0']['logs']['0'], ) => { - if (log.transaction) { - if (log.transaction.value > 0) { - if ( - log.transaction.from === OETH_VAULT_ADDRESS && - log.transaction.to !== OETH_VAULT_ADDRESS - ) { - const vault = await getLatestVault(ctx, result, block) - vault.eth -= log.transaction.value - } else if (log.transaction.to === OETH_VAULT_ADDRESS) { - const vault = await getLatestVault(ctx, result, block) - vault.eth += log.transaction.value - } - } - } - if (log.topics[0] === erc20.events.Transfer.topic) { await trackAddressBalances({ log, address: OETH_VAULT_ADDRESS, tokens: VAULT_ERC20_ADDRESSES, - fn: async ({ log, token, change }) => { - const vault = await getLatestVault(ctx, result, block) + fn: async ({ token, change }) => { + const { vault } = await getLatestVault(ctx, result, block) if (token === WETH_ADDRESS) { vault.weth += change } else if (token === RETH_ADDRESS) { @@ -122,7 +119,9 @@ const getLatestVault = async ( ctx: Context, result: ProcessResult, block: Context['blocks']['0'], + options?: { skipFinancialStatementUpdate: boolean }, ) => { + let isNew = false const timestampId = new Date(block.header.timestamp).toISOString() const { latest, current } = await getLatest( ctx, @@ -142,8 +141,11 @@ const getLatestVault = async ( stETH: latest?.stETH ?? 0n, frxETH: latest?.frxETH ?? 0n, }) + isNew = true result.vaults.push(vault) - await updateFinancialStatement(ctx, block, { vault }) + if (!options?.skipFinancialStatementUpdate) { + await updateFinancialStatement(ctx, block, { vault }) + } } - return vault + return { vault, isNew } } From 65e90439c586044c78a1e2fafaa605b536b9a8e1 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Tue, 19 Sep 2023 16:37:17 -0700 Subject: [PATCH 22/31] use enums instead of strings switch some floats to bigint apy was using some incorrect date calculations perf to run everything is around ~25-30 minutes on my wifi --- ...54585193-Data.js => 1695162784724-Data.js} | 10 ++-- package-lock.json | 6 +++ package.json | 1 + schema.graphql | 26 +++++++--- src/main.ts | 12 ++--- src/model/generated/_historyType.ts | 6 +++ src/model/generated/_rebasingOption.ts | 4 ++ src/model/generated/address.model.ts | 13 ++--- src/model/generated/history.model.ts | 13 ++--- src/model/generated/index.ts | 2 + src/model/generated/rebaseOption.model.ts | 5 +- src/processor.ts | 16 +++---- src/processors/oeth/oeth.ts | 35 +++++++++----- src/processors/oeth/utils.ts | 48 ++++++++----------- src/processors/vault/vault.ts | 37 +++++++------- src/utils/constants.ts | 1 + 16 files changed, 133 insertions(+), 102 deletions(-) rename db/migrations/{1695154585193-Data.js => 1695162784724-Data.js} (95%) create mode 100644 src/model/generated/_historyType.ts create mode 100644 src/model/generated/_rebasingOption.ts create mode 100644 src/utils/constants.ts diff --git a/db/migrations/1695154585193-Data.js b/db/migrations/1695162784724-Data.js similarity index 95% rename from db/migrations/1695154585193-Data.js rename to db/migrations/1695162784724-Data.js index e6944d52..f1f130b4 100644 --- a/db/migrations/1695154585193-Data.js +++ b/db/migrations/1695162784724-Data.js @@ -1,12 +1,12 @@ -module.exports = class Data1695154585193 { - name = 'Data1695154585193' +module.exports = class Data1695162784724 { + name = 'Data1695162784724' async up(db) { - await db.query(`CREATE TABLE "history" ("id" character varying NOT NULL, "value" numeric NOT NULL, "balance" numeric NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "type" text NOT NULL, "address_id" character varying, CONSTRAINT "PK_9384942edf4804b38ca0ee51416" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "history" ("id" character varying NOT NULL, "value" numeric NOT NULL, "balance" numeric NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "type" character varying(8) NOT NULL, "address_id" character varying, CONSTRAINT "PK_9384942edf4804b38ca0ee51416" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_59a55adcc59ddb69c297da693e" ON "history" ("address_id") `) await db.query(`CREATE INDEX "IDX_7a259431108a22e8ca2f375fc7" ON "history" ("block_number") `) await db.query(`CREATE INDEX "IDX_1b82c15d87635d95eaa4dd42ec" ON "history" ("tx_hash") `) - await db.query(`CREATE TABLE "address" ("id" character varying NOT NULL, "is_contract" boolean NOT NULL, "rebasing_option" text NOT NULL, "balance" numeric NOT NULL, "earned" numeric NOT NULL, "credits" numeric NOT NULL, "last_updated" TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT "PK_d92de1f82754668b5f5f5dd4fd5" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "address" ("id" character varying NOT NULL, "is_contract" boolean NOT NULL, "rebasing_option" character varying(6) NOT NULL, "balance" numeric NOT NULL, "earned" numeric NOT NULL, "credits" numeric NOT NULL, "last_updated" TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT "PK_d92de1f82754668b5f5f5dd4fd5" PRIMARY KEY ("id"))`) await db.query(`CREATE TABLE "apy" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "apr" numeric NOT NULL, "apy" numeric NOT NULL, "apy7_day_avg" numeric NOT NULL, "apy14_day_avg" numeric NOT NULL, "apy30_day_avg" numeric NOT NULL, "rebasing_credits_per_token" numeric NOT NULL, CONSTRAINT "PK_7826924ff9c029af7533753f6af" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_1f069a908b679be0b5fbc0b2e6" ON "apy" ("timestamp") `) await db.query(`CREATE INDEX "IDX_7fb752652a983d6629a722ae7a" ON "apy" ("block_number") `) @@ -16,7 +16,7 @@ module.exports = class Data1695154585193 { await db.query(`CREATE INDEX "IDX_a5955dbd9ac031314697cbd54f" ON "rebase" ("block_number") `) await db.query(`CREATE INDEX "IDX_7cd793b6c4bc15b9082e0eb97a" ON "rebase" ("tx_hash") `) await db.query(`CREATE INDEX "IDX_02d02f9022ef86e60f1a84b9dc" ON "rebase" ("apy_id") `) - await db.query(`CREATE TABLE "rebase_option" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "status" text NOT NULL, "address_id" character varying, CONSTRAINT "PK_426a38c91faad05465d687740ea" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "rebase_option" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "status" character varying(6) NOT NULL, "address_id" character varying, CONSTRAINT "PK_426a38c91faad05465d687740ea" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_751e6b6352737ddf4f0da0d6d8" ON "rebase_option" ("timestamp") `) await db.query(`CREATE INDEX "IDX_e59c9a534fcf23a97a8ac92afa" ON "rebase_option" ("block_number") `) await db.query(`CREATE INDEX "IDX_6b6c08ec25dacd1a5bd6170152" ON "rebase_option" ("tx_hash") `) diff --git a/package-lock.json b/package-lock.json index 0a008566..d0cd1474 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,7 @@ "@subsquid/graphql-server": "^4.2.0", "@subsquid/typeorm-migration": "^1.2.0", "@subsquid/typeorm-store": "^1.2.2", + "dayjs": "^1.11.10", "dotenv": "^16.1.4", "ethers": "^6.5.1", "pg": "^8.11.0", @@ -2264,6 +2265,11 @@ "url": "https://opencollective.com/date-fns" } }, + "node_modules/dayjs": { + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" + }, "node_modules/debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", diff --git a/package.json b/package.json index 2f99eef4..948e0d20 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@subsquid/graphql-server": "^4.2.0", "@subsquid/typeorm-migration": "^1.2.0", "@subsquid/typeorm-store": "^1.2.2", + "dayjs": "^1.11.10", "dotenv": "^16.1.4", "ethers": "^6.5.1", "pg": "^8.11.0", diff --git a/schema.graphql b/schema.graphql index 21d230c0..c1651de8 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1,23 +1,35 @@ +enum RebasingOption { + OptIn + OptOut +} + type Address @entity { id: ID! @index isContract: Boolean! - rebasingOption: String! # OptIn, OptOut - balance: Float! - earned: Float! + rebasingOption: RebasingOption! + balance: BigInt! + earned: BigInt! credits: BigInt! lastUpdated: DateTime! history: [History!]! @derivedFrom(field: "address") } +enum HistoryType { + Swap + Sent + Received + Yield +} + type History @entity { id: ID! address: Address! @index - value: Float! - balance: Float! + value: BigInt! + balance: BigInt! timestamp: DateTime! blockNumber: Int! @index txHash: String! @index - type: String! # Swap, Yield + type: HistoryType! } type Rebase @entity { @@ -37,7 +49,7 @@ type RebaseOption @entity { blockNumber: Int! @index txHash: String! @index address: Address! - status: String! + status: RebasingOption! } type APY @entity { diff --git a/src/main.ts b/src/main.ts index 4bddbf1a..843a92dd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,15 +7,9 @@ import * as morphoAave from './processors/morpho-aave' import * as oeth from './processors/oeth' import * as vault from './processors/vault' -// The idea is that these processors have zero dependencies on one another and can be processed asynchronously. run({ - processors: [ - // oeth, - vault, - fraxStaking, - morphoAave, - dripper, - curveLp, - ], + // The idea is that these processors have zero dependencies on one another and can be processed asynchronously. + processors: [oeth, vault, fraxStaking, morphoAave, dripper, curveLp], + // For processors which depend on results from other processors, post processors run after all processors have finished. postProcessors: [financialStatement], }) diff --git a/src/model/generated/_historyType.ts b/src/model/generated/_historyType.ts new file mode 100644 index 00000000..813557ec --- /dev/null +++ b/src/model/generated/_historyType.ts @@ -0,0 +1,6 @@ +export enum HistoryType { + Swap = "Swap", + Sent = "Sent", + Received = "Received", + Yield = "Yield", +} diff --git a/src/model/generated/_rebasingOption.ts b/src/model/generated/_rebasingOption.ts new file mode 100644 index 00000000..ea77587b --- /dev/null +++ b/src/model/generated/_rebasingOption.ts @@ -0,0 +1,4 @@ +export enum RebasingOption { + OptIn = "OptIn", + OptOut = "OptOut", +} diff --git a/src/model/generated/address.model.ts b/src/model/generated/address.model.ts index 0e5de5a4..882f3f3c 100644 --- a/src/model/generated/address.model.ts +++ b/src/model/generated/address.model.ts @@ -1,5 +1,6 @@ import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, OneToMany as OneToMany_} from "typeorm" import * as marshal from "./marshal" +import {RebasingOption} from "./_rebasingOption" import {History} from "./history.model" @Entity_() @@ -14,14 +15,14 @@ export class Address { @Column_("bool", {nullable: false}) isContract!: boolean - @Column_("text", {nullable: false}) - rebasingOption!: string + @Column_("varchar", {length: 6, nullable: false}) + rebasingOption!: RebasingOption - @Column_("numeric", {transformer: marshal.floatTransformer, nullable: false}) - balance!: number + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + balance!: bigint - @Column_("numeric", {transformer: marshal.floatTransformer, nullable: false}) - earned!: number + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + earned!: bigint @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) credits!: bigint diff --git a/src/model/generated/history.model.ts b/src/model/generated/history.model.ts index dc702c3d..3855ddff 100644 --- a/src/model/generated/history.model.ts +++ b/src/model/generated/history.model.ts @@ -1,6 +1,7 @@ import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, ManyToOne as ManyToOne_, Index as Index_} from "typeorm" import * as marshal from "./marshal" import {Address} from "./address.model" +import {HistoryType} from "./_historyType" @Entity_() export class History { @@ -15,11 +16,11 @@ export class History { @ManyToOne_(() => Address, {nullable: true}) address!: Address - @Column_("numeric", {transformer: marshal.floatTransformer, nullable: false}) - value!: number + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + value!: bigint - @Column_("numeric", {transformer: marshal.floatTransformer, nullable: false}) - balance!: number + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + balance!: bigint @Column_("timestamp with time zone", {nullable: false}) timestamp!: Date @@ -32,6 +33,6 @@ export class History { @Column_("text", {nullable: false}) txHash!: string - @Column_("text", {nullable: false}) - type!: string + @Column_("varchar", {length: 8, nullable: false}) + type!: HistoryType } diff --git a/src/model/generated/index.ts b/src/model/generated/index.ts index 58634b85..24ea7de2 100644 --- a/src/model/generated/index.ts +++ b/src/model/generated/index.ts @@ -1,5 +1,7 @@ export * from "./address.model" +export * from "./_rebasingOption" export * from "./history.model" +export * from "./_historyType" export * from "./rebase.model" export * from "./rebaseOption.model" export * from "./apy.model" diff --git a/src/model/generated/rebaseOption.model.ts b/src/model/generated/rebaseOption.model.ts index 341363e4..a1c09f4e 100644 --- a/src/model/generated/rebaseOption.model.ts +++ b/src/model/generated/rebaseOption.model.ts @@ -1,5 +1,6 @@ import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_, ManyToOne as ManyToOne_} from "typeorm" import {Address} from "./address.model" +import {RebasingOption} from "./_rebasingOption" @Entity_() export class RebaseOption { @@ -26,6 +27,6 @@ export class RebaseOption { @ManyToOne_(() => Address, {nullable: true}) address!: Address - @Column_("text", {nullable: false}) - status!: string + @Column_("varchar", {length: 6, nullable: false}) + status!: RebasingOption } diff --git a/src/processor.ts b/src/processor.ts index c2a48980..7933db7e 100644 --- a/src/processor.ts +++ b/src/processor.ts @@ -1,11 +1,8 @@ import { lookupArchive } from '@subsquid/archive-registry' import { - BlockHeader, DataHandlerContext, EvmBatchProcessor, EvmBatchProcessorFields, - Log as _Log, - Transaction as _Transaction, } from '@subsquid/evm-processor' import { Store, TypeormDatabase } from '@subsquid/typeorm-store' @@ -83,14 +80,17 @@ export const run = ({ new TypeormDatabase({ supportHotBlocks: true }), async (ctx) => { resetProcessorState() - let start = Date.now() + let start: number const time = (name: string) => () => ctx.log.info(`${name} ${Date.now() - start}ms`) + + start = Date.now() await Promise.all( processors.map((p, index) => p.process(ctx).then(time(p.name ?? `processor-${index}`)), ), ) + start = Date.now() await Promise.all( postProcessors.map((p, index) => @@ -103,7 +103,7 @@ export const run = ({ export type Fields = EvmBatchProcessorFields export type Context = DataHandlerContext -export type Block = BlockHeader -export type Log = _Log -export type Transaction = _Transaction -export type ProcessorContext = DataHandlerContext +export type Block = Context['blocks']['0'] +export type Log = Context['blocks']['0']['logs']['0'] +export type Transaction = Context['blocks']['0']['transactions']['0'] +export type Trace = Context['blocks']['0']['traces']['0'] diff --git a/src/processors/oeth/oeth.ts b/src/processors/oeth/oeth.ts index 659fbad0..d702f109 100644 --- a/src/processors/oeth/oeth.ts +++ b/src/processors/oeth/oeth.ts @@ -2,9 +2,18 @@ import { EvmBatchProcessor } from '@subsquid/evm-processor' import { v4 as uuidv4 } from 'uuid' import * as oeth from '../../abi/oeth' -import { APY, Address, History, Rebase, RebaseOption } from '../../model' +import { + APY, + Address, + History, + HistoryType, + Rebase, + RebaseOption, + RebasingOption, +} from '../../model' import { Context } from '../../processor' import { ADDRESS_ZERO, OETH_ADDRESS } from '../../utils/addresses' +import { DECIMALS_18 } from '../../utils/constants' import { createAddress, createRebaseAPY } from './utils' export const from = 16933090 // https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 @@ -111,7 +120,7 @@ const processTransfer = async ( await Promise.all( [addressSub, addressAdd].map(async (address) => { const credits = await token.creditsBalanceOfHighres(address.id) - const newBalance = Number(credits[0]) / Number(credits[1]) + const newBalance = (credits[0] * DECIMALS_18) / credits[1] result.history.push( new History({ // we can't use {t.id} because it's not unique @@ -123,14 +132,14 @@ const processTransfer = async ( blockNumber: block.header.height, txHash: log.transactionHash, type: isSwap - ? 'Swap' + ? HistoryType.Swap : addressSub === address - ? 'Sent' - : 'Received', + ? HistoryType.Sent + : HistoryType.Received, }), ) address.credits = BigInt(credits[0]) // token credits - address.balance = Number(credits[0]) / Number(credits[1]) // token balance + address.balance = newBalance // token balance }), ) } @@ -149,11 +158,11 @@ const processTotalSupplyUpdatedHighres = async ( // Rebase events let rebase = createRebaseAPY(ctx, result.apies, block, log, data) for (const address of result.owners.values()) { - if (address.rebasingOption === 'OptOut') { + if (address.rebasingOption === RebasingOption.OptOut) { continue } const newBalance = - Number(address.credits) / Number(data.rebasingCreditsPerToken) + (address.credits * DECIMALS_18) / data.rebasingCreditsPerToken const earned = newBalance - address.balance result.history.push( @@ -166,7 +175,7 @@ const processTotalSupplyUpdatedHighres = async ( timestamp: new Date(block.header.timestamp), blockNumber: block.header.height, txHash: log.transactionHash, - type: 'Yield', + type: HistoryType.Yield, }), ) @@ -210,12 +219,12 @@ const processRebaseOpt = async ( }) result.rebaseOptions.push(rebaseOption) if (trace.action.sighash === oeth.functions.rebaseOptIn.sighash) { - owner.rebasingOption = 'OptIn' - rebaseOption.status = 'OptIn' + owner.rebasingOption = RebasingOption.OptIn + rebaseOption.status = RebasingOption.OptIn } if (trace.action.sighash === oeth.functions.rebaseOptOut.sighash) { - owner.rebasingOption = 'OptOut' - rebaseOption.status = 'OptOut' + owner.rebasingOption = RebasingOption.OptOut + rebaseOption.status = RebasingOption.OptOut } } } diff --git a/src/processors/oeth/utils.ts b/src/processors/oeth/utils.ts index 7498391d..d431c46a 100644 --- a/src/processors/oeth/utils.ts +++ b/src/processors/oeth/utils.ts @@ -1,7 +1,9 @@ -import { Context } from '../../processor' -import { Address, APY, Rebase } from '../../model' +import dayjs from 'dayjs' import { LessThan, MoreThanOrEqual } from 'typeorm' + import * as oeth from '../../abi/oeth' +import { APY, Address, Rebase, RebasingOption } from '../../model' +import { Context } from '../../processor' /** * Create a new Address entity @@ -20,11 +22,11 @@ export async function createAddress( // ctx.log.info(`New address ${rawAddress}`); return new Address({ id: addr, - balance: 0, - earned: 0, + balance: 0n, + earned: 0n, credits: 0n, isContract, - rebasingOption: isContract ? 'OptOut' : 'OptIn', + rebasingOption: isContract ? RebasingOption.OptOut : RebasingOption.OptIn, lastUpdated, }) } @@ -52,25 +54,6 @@ export async function createRebaseAPY( // use date as id for APY const date = new Date(block.header.timestamp) const dateId = date.toISOString().substring(0, 10) - date.setDate(date.getDate() - 1) - const lastDateId = date.toISOString().substring(0, 10) - - // use date as id for APY - date.setDate(date.getDate() - 6) - const last7daysDateId = { - key: 'apy7DayAvg' as const, - value: date.toISOString().substring(0, 10), - } - date.setDate(date.getDate() - 14) - const last14daysDateId = { - key: 'apy14DayAvg' as const, - value: date.toISOString().substring(0, 10), - } - date.setDate(date.getDate() - 16) - const last30daysDateId = { - key: 'apy30DayAvg' as const, - value: date.toISOString().substring(0, 10), - } // get last APY to compare with current one let lastApy = @@ -117,9 +100,7 @@ export async function createRebaseAPY( apy.rebasingCreditsPerToken = rebaseEvent.rebasingCreditsPerToken // this should normally be 1 day but more secure to calculate it - const diffTime = Math.abs( - new Date(apy.id).getTime() - new Date(lastApy.id).getTime(), - ) + const diffTime = Math.abs(Date.parse(apy.id) - Date.parse(lastApy.id)) const dayDiff = Math.ceil(diffTime / (1000 * 60 * 60 * 24)) apy.apr = @@ -133,6 +114,19 @@ export async function createRebaseAPY( apy.apy = ((1 + apy.apr / periods_per_year / 100) ** periods_per_year - 1) * 100 + const last7daysDateId = { + key: 'apy7DayAvg' as const, + value: dayjs(date).subtract(7, 'days').toISOString().substring(0, 10), + } + const last14daysDateId = { + key: 'apy14DayAvg' as const, + value: dayjs(date).subtract(14, 'days').toISOString().substring(0, 10), + } + const last30daysDateId = { + key: 'apy30DayAvg' as const, + value: dayjs(date).subtract(30, 'days').toISOString().substring(0, 10), + } + // calculate average APY for the last 7, 14 and 30 days await Promise.all( [last7daysDateId, last14daysDateId, last30daysDateId].map(async (i) => { diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts index 45d07441..809c2550 100644 --- a/src/processors/vault/vault.ts +++ b/src/processors/vault/vault.ts @@ -52,8 +52,12 @@ export const process = async (ctx: Context) => { } for (const block of ctx.blocks) { - for (const transaction of block.transactions) { - await processNativeTransfers(ctx, result, block, transaction) + const transaction = block.transactions.find( + (t) => t.from === OETH_CURVE_LP_ADDRESS || t.to === OETH_CURVE_LP_ADDRESS, + ) + if (transaction) { + // We only want to do this once per block. + await updateETHBalance(ctx, result, block) } for (const log of block.logs) { await processTransfer(ctx, result, block, log) @@ -63,28 +67,23 @@ export const process = async (ctx: Context) => { await ctx.store.insert(result.vaults) } -const processNativeTransfers = async ( +const updateETHBalance = async ( ctx: Context, result: ProcessResult, block: Context['blocks']['0'], - transaction: Context['blocks']['0']['transactions']['0'], ) => { - if ( - transaction.from === OETH_CURVE_LP_ADDRESS || - transaction.to === OETH_CURVE_LP_ADDRESS - ) { - const { vault, isNew } = await getLatestVault(ctx, result, block, { - skipFinancialStatementUpdate: true, - }) - const eth = await getEthBalance(ctx, OETH_CURVE_LP_ADDRESS, block) - if (vault.eth === eth) { - // Nothing to do, remove the new vault record if we created one. - if (isNew) { - result.vaults.pop() - } - } else { - vault.eth = eth + const { vault, isNew } = await getLatestVault(ctx, result, block, { + skipFinancialStatementUpdate: true, + }) + const eth = await getEthBalance(ctx, OETH_CURVE_LP_ADDRESS, block) + if (vault.eth === eth) { + // Nothing to do, remove the new vault record if we created one. + if (isNew) { + result.vaults.pop() } + } else { + vault.eth = eth + await updateFinancialStatement(ctx, block, { vault }) } } diff --git a/src/utils/constants.ts b/src/utils/constants.ts new file mode 100644 index 00000000..c52f3ba7 --- /dev/null +++ b/src/utils/constants.ts @@ -0,0 +1 @@ +export const DECIMALS_18 = 1_000_000_000_000_000_000n From d5988f94d1aac3b4f5b6233dd318b48cb2aa6c37 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Wed, 20 Sep 2023 09:38:50 -0700 Subject: [PATCH 23/31] fix stETH value by pulling the balance when rebases occur --- ...urve_lp_token.json => curve-lp-token.json} | 0 abi/liquid-staked-eth-2.0.json | 1600 +++++++++++++++++ ..._lp_token.abi.ts => curve-lp-token.abi.ts} | 0 .../{curve_lp_token.ts => curve-lp-token.ts} | 2 +- src/abi/liquid-staked-eth-2.0.abi.ts | 1580 ++++++++++++++++ src/abi/liquid-staked-eth-2.0.ts | 474 +++++ src/processors/curve-lp/curve-lp.ts | 35 +- src/processors/vault/vault.ts | 40 +- 8 files changed, 3703 insertions(+), 28 deletions(-) rename abi/{curve_lp_token.json => curve-lp-token.json} (100%) create mode 100644 abi/liquid-staked-eth-2.0.json rename src/abi/{curve_lp_token.abi.ts => curve-lp-token.abi.ts} (100%) rename src/abi/{curve_lp_token.ts => curve-lp-token.ts} (99%) create mode 100644 src/abi/liquid-staked-eth-2.0.abi.ts create mode 100644 src/abi/liquid-staked-eth-2.0.ts diff --git a/abi/curve_lp_token.json b/abi/curve-lp-token.json similarity index 100% rename from abi/curve_lp_token.json rename to abi/curve-lp-token.json diff --git a/abi/liquid-staked-eth-2.0.json b/abi/liquid-staked-eth-2.0.json new file mode 100644 index 00000000..eaea0200 --- /dev/null +++ b/abi/liquid-staked-eth-2.0.json @@ -0,0 +1,1600 @@ +[ + { + "constant": false, + "inputs": [], + "name": "resume", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "stop", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "hasInitialized", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "STAKING_CONTROL_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_ethAmount", + "type": "uint256" + } + ], + "name": "getSharesByPooledEth", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isStakingPaused", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_sender", + "type": "address" + }, + { + "name": "_recipient", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_script", + "type": "bytes" + } + ], + "name": "getEVMScriptExecutor", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_maxStakeLimit", + "type": "uint256" + }, + { + "name": "_stakeLimitIncreasePerBlock", + "type": "uint256" + } + ], + "name": "setStakingLimit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "RESUME_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_lidoLocator", + "type": "address" + }, + { + "name": "_eip712StETH", + "type": "address" + } + ], + "name": "finalizeUpgrade_v2", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getRecoveryVault", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTotalPooledEther", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_newDepositedValidators", + "type": "uint256" + } + ], + "name": "unsafeChangeDepositedValidators", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "PAUSE_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTreasury", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isStopped", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBufferedEther", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_lidoLocator", + "type": "address" + }, + { + "name": "_eip712StETH", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "receiveELRewards", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getWithdrawalCredentials", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getCurrentStakeLimit", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getStakeLimitFullInfo", + "outputs": [ + { + "name": "isStakingPaused", + "type": "bool" + }, + { + "name": "isStakingLimitSet", + "type": "bool" + }, + { + "name": "currentStakeLimit", + "type": "uint256" + }, + { + "name": "maxStakeLimit", + "type": "uint256" + }, + { + "name": "maxStakeLimitGrowthBlocks", + "type": "uint256" + }, + { + "name": "prevStakeLimit", + "type": "uint256" + }, + { + "name": "prevStakeBlockNumber", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_sender", + "type": "address" + }, + { + "name": "_recipient", + "type": "address" + }, + { + "name": "_sharesAmount", + "type": "uint256" + } + ], + "name": "transferSharesFrom", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "resumeStaking", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getFeeDistribution", + "outputs": [ + { + "name": "treasuryFeeBasisPoints", + "type": "uint16" + }, + { + "name": "insuranceFeeBasisPoints", + "type": "uint16" + }, + { + "name": "operatorsFeeBasisPoints", + "type": "uint16" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "receiveWithdrawals", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_sharesAmount", + "type": "uint256" + } + ], + "name": "getPooledEthByShares", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "token", + "type": "address" + } + ], + "name": "allowRecoverability", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "appId", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getOracle", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "name": "name", + "type": "string" + }, + { + "name": "version", + "type": "string" + }, + { + "name": "chainId", + "type": "uint256" + }, + { + "name": "verifyingContract", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getContractVersion", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getInitializationBlock", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_recipient", + "type": "address" + }, + { + "name": "_sharesAmount", + "type": "uint256" + } + ], + "name": "transferShares", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getEIP712StETH", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "transferToVault", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_sender", + "type": "address" + }, + { + "name": "_role", + "type": "bytes32" + }, + { + "name": "_params", + "type": "uint256[]" + } + ], + "name": "canPerform", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_referral", + "type": "address" + } + ], + "name": "submit", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getEVMScriptRegistry", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_recipient", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_maxDepositsCount", + "type": "uint256" + }, + { + "name": "_stakingModuleId", + "type": "uint256" + }, + { + "name": "_depositCalldata", + "type": "bytes" + } + ], + "name": "deposit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBeaconStat", + "outputs": [ + { + "name": "depositedValidators", + "type": "uint256" + }, + { + "name": "beaconValidators", + "type": "uint256" + }, + { + "name": "beaconBalance", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "removeStakingLimit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_reportTimestamp", + "type": "uint256" + }, + { + "name": "_timeElapsed", + "type": "uint256" + }, + { + "name": "_clValidators", + "type": "uint256" + }, + { + "name": "_clBalance", + "type": "uint256" + }, + { + "name": "_withdrawalVaultBalance", + "type": "uint256" + }, + { + "name": "_elRewardsVaultBalance", + "type": "uint256" + }, + { + "name": "_sharesRequestedToBurn", + "type": "uint256" + }, + { + "name": "_withdrawalFinalizationBatches", + "type": "uint256[]" + }, + { + "name": "_simulatedShareRate", + "type": "uint256" + } + ], + "name": "handleOracleReport", + "outputs": [ + { + "name": "postRebaseAmounts", + "type": "uint256[4]" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getFee", + "outputs": [ + { + "name": "totalFee", + "type": "uint16" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "kernel", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTotalShares", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_deadline", + "type": "uint256" + }, + { + "name": "_v", + "type": "uint8" + }, + { + "name": "_r", + "type": "bytes32" + }, + { + "name": "_s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isPetrified", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getLidoLocator", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "canDeposit", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "STAKING_PAUSE_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getDepositableEther", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_account", + "type": "address" + } + ], + "name": "sharesOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "pauseStaking", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTotalELRewardsCollected", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [], + "name": "StakingPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "StakingResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "maxStakeLimit", + "type": "uint256" + }, + { + "indexed": false, + "name": "stakeLimitIncreasePerBlock", + "type": "uint256" + } + ], + "name": "StakingLimitSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "StakingLimitRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "reportTimestamp", + "type": "uint256" + }, + { + "indexed": false, + "name": "preCLValidators", + "type": "uint256" + }, + { + "indexed": false, + "name": "postCLValidators", + "type": "uint256" + } + ], + "name": "CLValidatorsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "depositedValidators", + "type": "uint256" + } + ], + "name": "DepositedValidatorsChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "reportTimestamp", + "type": "uint256" + }, + { + "indexed": false, + "name": "preCLBalance", + "type": "uint256" + }, + { + "indexed": false, + "name": "postCLBalance", + "type": "uint256" + }, + { + "indexed": false, + "name": "withdrawalsWithdrawn", + "type": "uint256" + }, + { + "indexed": false, + "name": "executionLayerRewardsWithdrawn", + "type": "uint256" + }, + { + "indexed": false, + "name": "postBufferedEther", + "type": "uint256" + } + ], + "name": "ETHDistributed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "reportTimestamp", + "type": "uint256" + }, + { + "indexed": false, + "name": "timeElapsed", + "type": "uint256" + }, + { + "indexed": false, + "name": "preTotalShares", + "type": "uint256" + }, + { + "indexed": false, + "name": "preTotalEther", + "type": "uint256" + }, + { + "indexed": false, + "name": "postTotalShares", + "type": "uint256" + }, + { + "indexed": false, + "name": "postTotalEther", + "type": "uint256" + }, + { + "indexed": false, + "name": "sharesMintedAsFees", + "type": "uint256" + } + ], + "name": "TokenRebased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "lidoLocator", + "type": "address" + } + ], + "name": "LidoLocatorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "ELRewardsReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "WithdrawalsReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "name": "referral", + "type": "address" + } + ], + "name": "Submitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "Unbuffered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "executor", + "type": "address" + }, + { + "indexed": false, + "name": "script", + "type": "bytes" + }, + { + "indexed": false, + "name": "input", + "type": "bytes" + }, + { + "indexed": false, + "name": "returnData", + "type": "bytes" + } + ], + "name": "ScriptResult", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "vault", + "type": "address" + }, + { + "indexed": true, + "name": "token", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "RecoverToVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "eip712StETH", + "type": "address" + } + ], + "name": "EIP712StETHInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "sharesValue", + "type": "uint256" + } + ], + "name": "TransferShares", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "account", + "type": "address" + }, + { + "indexed": false, + "name": "preRebaseTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "name": "postRebaseTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "name": "sharesAmount", + "type": "uint256" + } + ], + "name": "SharesBurnt", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Stopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Resumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "version", + "type": "uint256" + } + ], + "name": "ContractVersionSet", + "type": "event" + } +] \ No newline at end of file diff --git a/src/abi/curve_lp_token.abi.ts b/src/abi/curve-lp-token.abi.ts similarity index 100% rename from src/abi/curve_lp_token.abi.ts rename to src/abi/curve-lp-token.abi.ts diff --git a/src/abi/curve_lp_token.ts b/src/abi/curve-lp-token.ts similarity index 99% rename from src/abi/curve_lp_token.ts rename to src/abi/curve-lp-token.ts index 5cba5c52..4d67eacb 100644 --- a/src/abi/curve_lp_token.ts +++ b/src/abi/curve-lp-token.ts @@ -1,6 +1,6 @@ import * as ethers from 'ethers' import {LogEvent, Func, ContractBase} from './abi.support' -import {ABI_JSON} from './curve_lp_token.abi' +import {ABI_JSON} from './curve-lp-token.abi' export const abi = new ethers.Interface(ABI_JSON); diff --git a/src/abi/liquid-staked-eth-2.0.abi.ts b/src/abi/liquid-staked-eth-2.0.abi.ts new file mode 100644 index 00000000..8a5765e4 --- /dev/null +++ b/src/abi/liquid-staked-eth-2.0.abi.ts @@ -0,0 +1,1580 @@ +export const ABI_JSON = [ + { + "type": "function", + "name": "resume", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "name", + "constant": true, + "stateMutability": "pure", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "stop", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "hasInitialized", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "approve", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_spender" + }, + { + "type": "uint256", + "name": "_amount" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "STAKING_CONTROL_ROLE", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "totalSupply", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getSharesByPooledEth", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_ethAmount" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isStakingPaused", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "transferFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_sender" + }, + { + "type": "address", + "name": "_recipient" + }, + { + "type": "uint256", + "name": "_amount" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getEVMScriptExecutor", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "bytes", + "name": "_script" + } + ], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "setStakingLimit", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_maxStakeLimit" + }, + { + "type": "uint256", + "name": "_stakeLimitIncreasePerBlock" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "RESUME_ROLE", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "finalizeUpgrade_v2", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_lidoLocator" + }, + { + "type": "address", + "name": "_eip712StETH" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "decimals", + "constant": true, + "stateMutability": "pure", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint8", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getRecoveryVault", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "DOMAIN_SEPARATOR", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getTotalPooledEther", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "unsafeChangeDepositedValidators", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_newDepositedValidators" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "PAUSE_ROLE", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "increaseAllowance", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_spender" + }, + { + "type": "uint256", + "name": "_addedValue" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getTreasury", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isStopped", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getBufferedEther", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "initialize", + "constant": false, + "stateMutability": "payable", + "payable": true, + "inputs": [ + { + "type": "address", + "name": "_lidoLocator" + }, + { + "type": "address", + "name": "_eip712StETH" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "receiveELRewards", + "constant": false, + "stateMutability": "payable", + "payable": true, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "getWithdrawalCredentials", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getCurrentStakeLimit", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getStakeLimitFullInfo", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bool", + "name": "isStakingPaused" + }, + { + "type": "bool", + "name": "isStakingLimitSet" + }, + { + "type": "uint256", + "name": "currentStakeLimit" + }, + { + "type": "uint256", + "name": "maxStakeLimit" + }, + { + "type": "uint256", + "name": "maxStakeLimitGrowthBlocks" + }, + { + "type": "uint256", + "name": "prevStakeLimit" + }, + { + "type": "uint256", + "name": "prevStakeBlockNumber" + } + ] + }, + { + "type": "function", + "name": "transferSharesFrom", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_sender" + }, + { + "type": "address", + "name": "_recipient" + }, + { + "type": "uint256", + "name": "_sharesAmount" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "balanceOf", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_account" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "resumeStaking", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "getFeeDistribution", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint16", + "name": "treasuryFeeBasisPoints" + }, + { + "type": "uint16", + "name": "insuranceFeeBasisPoints" + }, + { + "type": "uint16", + "name": "operatorsFeeBasisPoints" + } + ] + }, + { + "type": "function", + "name": "receiveWithdrawals", + "constant": false, + "stateMutability": "payable", + "payable": true, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "getPooledEthByShares", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_sharesAmount" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "allowRecoverability", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "token" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "nonces", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "owner" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "appId", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getOracle", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "eip712Domain", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "name" + }, + { + "type": "string", + "name": "version" + }, + { + "type": "uint256", + "name": "chainId" + }, + { + "type": "address", + "name": "verifyingContract" + } + ] + }, + { + "type": "function", + "name": "getContractVersion", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getInitializationBlock", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "transferShares", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_recipient" + }, + { + "type": "uint256", + "name": "_sharesAmount" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "symbol", + "constant": true, + "stateMutability": "pure", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "string", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getEIP712StETH", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "transferToVault", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "canPerform", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_sender" + }, + { + "type": "bytes32", + "name": "_role" + }, + { + "type": "uint256[]", + "name": "_params" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "submit", + "constant": false, + "stateMutability": "payable", + "payable": true, + "inputs": [ + { + "type": "address", + "name": "_referral" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "decreaseAllowance", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_spender" + }, + { + "type": "uint256", + "name": "_subtractedValue" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getEVMScriptRegistry", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "transfer", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_recipient" + }, + { + "type": "uint256", + "name": "_amount" + } + ], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "deposit", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_maxDepositsCount" + }, + { + "type": "uint256", + "name": "_stakingModuleId" + }, + { + "type": "bytes", + "name": "_depositCalldata" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getBeaconStat", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "depositedValidators" + }, + { + "type": "uint256", + "name": "beaconValidators" + }, + { + "type": "uint256", + "name": "beaconBalance" + } + ] + }, + { + "type": "function", + "name": "removeStakingLimit", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "handleOracleReport", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "uint256", + "name": "_reportTimestamp" + }, + { + "type": "uint256", + "name": "_timeElapsed" + }, + { + "type": "uint256", + "name": "_clValidators" + }, + { + "type": "uint256", + "name": "_clBalance" + }, + { + "type": "uint256", + "name": "_withdrawalVaultBalance" + }, + { + "type": "uint256", + "name": "_elRewardsVaultBalance" + }, + { + "type": "uint256", + "name": "_sharesRequestedToBurn" + }, + { + "type": "uint256[]", + "name": "_withdrawalFinalizationBatches" + }, + { + "type": "uint256", + "name": "_simulatedShareRate" + } + ], + "outputs": [ + { + "type": "uint256[4]", + "name": "postRebaseAmounts" + } + ] + }, + { + "type": "function", + "name": "getFee", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint16", + "name": "totalFee" + } + ] + }, + { + "type": "function", + "name": "kernel", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getTotalShares", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "permit", + "constant": false, + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_owner" + }, + { + "type": "address", + "name": "_spender" + }, + { + "type": "uint256", + "name": "_value" + }, + { + "type": "uint256", + "name": "_deadline" + }, + { + "type": "uint8", + "name": "_v" + }, + { + "type": "bytes32", + "name": "_r" + }, + { + "type": "bytes32", + "name": "_s" + } + ], + "outputs": [] + }, + { + "type": "function", + "name": "allowance", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_owner" + }, + { + "type": "address", + "name": "_spender" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "isPetrified", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getLidoLocator", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "address", + "name": "" + } + ] + }, + { + "type": "function", + "name": "canDeposit", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bool", + "name": "" + } + ] + }, + { + "type": "function", + "name": "STAKING_PAUSE_ROLE", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "bytes32", + "name": "" + } + ] + }, + { + "type": "function", + "name": "getDepositableEther", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "sharesOf", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [ + { + "type": "address", + "name": "_account" + } + ], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "function", + "name": "pauseStaking", + "constant": false, + "payable": false, + "inputs": [], + "outputs": [] + }, + { + "type": "function", + "name": "getTotalELRewardsCollected", + "constant": true, + "stateMutability": "view", + "payable": false, + "inputs": [], + "outputs": [ + { + "type": "uint256", + "name": "" + } + ] + }, + { + "type": "fallback", + "stateMutability": "payable" + }, + { + "type": "event", + "anonymous": false, + "name": "StakingPaused", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "StakingResumed", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "StakingLimitSet", + "inputs": [ + { + "type": "uint256", + "name": "maxStakeLimit", + "indexed": false + }, + { + "type": "uint256", + "name": "stakeLimitIncreasePerBlock", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "StakingLimitRemoved", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "CLValidatorsUpdated", + "inputs": [ + { + "type": "uint256", + "name": "reportTimestamp", + "indexed": true + }, + { + "type": "uint256", + "name": "preCLValidators", + "indexed": false + }, + { + "type": "uint256", + "name": "postCLValidators", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "DepositedValidatorsChanged", + "inputs": [ + { + "type": "uint256", + "name": "depositedValidators", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "ETHDistributed", + "inputs": [ + { + "type": "uint256", + "name": "reportTimestamp", + "indexed": true + }, + { + "type": "uint256", + "name": "preCLBalance", + "indexed": false + }, + { + "type": "uint256", + "name": "postCLBalance", + "indexed": false + }, + { + "type": "uint256", + "name": "withdrawalsWithdrawn", + "indexed": false + }, + { + "type": "uint256", + "name": "executionLayerRewardsWithdrawn", + "indexed": false + }, + { + "type": "uint256", + "name": "postBufferedEther", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "TokenRebased", + "inputs": [ + { + "type": "uint256", + "name": "reportTimestamp", + "indexed": true + }, + { + "type": "uint256", + "name": "timeElapsed", + "indexed": false + }, + { + "type": "uint256", + "name": "preTotalShares", + "indexed": false + }, + { + "type": "uint256", + "name": "preTotalEther", + "indexed": false + }, + { + "type": "uint256", + "name": "postTotalShares", + "indexed": false + }, + { + "type": "uint256", + "name": "postTotalEther", + "indexed": false + }, + { + "type": "uint256", + "name": "sharesMintedAsFees", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "LidoLocatorSet", + "inputs": [ + { + "type": "address", + "name": "lidoLocator", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "ELRewardsReceived", + "inputs": [ + { + "type": "uint256", + "name": "amount", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "WithdrawalsReceived", + "inputs": [ + { + "type": "uint256", + "name": "amount", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Submitted", + "inputs": [ + { + "type": "address", + "name": "sender", + "indexed": true + }, + { + "type": "uint256", + "name": "amount", + "indexed": false + }, + { + "type": "address", + "name": "referral", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Unbuffered", + "inputs": [ + { + "type": "uint256", + "name": "amount", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "ScriptResult", + "inputs": [ + { + "type": "address", + "name": "executor", + "indexed": true + }, + { + "type": "bytes", + "name": "script", + "indexed": false + }, + { + "type": "bytes", + "name": "input", + "indexed": false + }, + { + "type": "bytes", + "name": "returnData", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "RecoverToVault", + "inputs": [ + { + "type": "address", + "name": "vault", + "indexed": true + }, + { + "type": "address", + "name": "token", + "indexed": true + }, + { + "type": "uint256", + "name": "amount", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "EIP712StETHInitialized", + "inputs": [ + { + "type": "address", + "name": "eip712StETH", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "TransferShares", + "inputs": [ + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "address", + "name": "to", + "indexed": true + }, + { + "type": "uint256", + "name": "sharesValue", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "SharesBurnt", + "inputs": [ + { + "type": "address", + "name": "account", + "indexed": true + }, + { + "type": "uint256", + "name": "preRebaseTokenAmount", + "indexed": false + }, + { + "type": "uint256", + "name": "postRebaseTokenAmount", + "indexed": false + }, + { + "type": "uint256", + "name": "sharesAmount", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Stopped", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "Resumed", + "inputs": [] + }, + { + "type": "event", + "anonymous": false, + "name": "Transfer", + "inputs": [ + { + "type": "address", + "name": "from", + "indexed": true + }, + { + "type": "address", + "name": "to", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "Approval", + "inputs": [ + { + "type": "address", + "name": "owner", + "indexed": true + }, + { + "type": "address", + "name": "spender", + "indexed": true + }, + { + "type": "uint256", + "name": "value", + "indexed": false + } + ] + }, + { + "type": "event", + "anonymous": false, + "name": "ContractVersionSet", + "inputs": [ + { + "type": "uint256", + "name": "version", + "indexed": false + } + ] + } +] diff --git a/src/abi/liquid-staked-eth-2.0.ts b/src/abi/liquid-staked-eth-2.0.ts new file mode 100644 index 00000000..5fc72ec8 --- /dev/null +++ b/src/abi/liquid-staked-eth-2.0.ts @@ -0,0 +1,474 @@ +import * as ethers from 'ethers' +import {LogEvent, Func, ContractBase} from './abi.support' +import {ABI_JSON} from './liquid-staked-eth-2.0.abi' + +export const abi = new ethers.Interface(ABI_JSON); + +export const events = { + StakingPaused: new LogEvent<[]>( + abi, '0x26d1807b479eaba249c1214b82e4b65bbb0cc73ee8a17901324b1ef1b5904e49' + ), + StakingResumed: new LogEvent<[]>( + abi, '0xedaeeae9aed70c4545d3ab0065713261c9cee8d6cf5c8b07f52f0a65fd91efda' + ), + StakingLimitSet: new LogEvent<([maxStakeLimit: bigint, stakeLimitIncreasePerBlock: bigint] & {maxStakeLimit: bigint, stakeLimitIncreasePerBlock: bigint})>( + abi, '0xce9fddf6179affa1ea7bf36d80a6bf0284e0f3b91f4b2fa6eea2af923e7fac2d' + ), + StakingLimitRemoved: new LogEvent<[]>( + abi, '0x9b2a687c198898fcc32a33bbc610d478f177a73ab7352023e6cc1de5bf12a3df' + ), + CLValidatorsUpdated: new LogEvent<([reportTimestamp: bigint, preCLValidators: bigint, postCLValidators: bigint] & {reportTimestamp: bigint, preCLValidators: bigint, postCLValidators: bigint})>( + abi, '0x1252331d4f3ee8a9f0a3484c4c2fb059c70a047b5dc5482a3ee6415f742d9f2e' + ), + DepositedValidatorsChanged: new LogEvent<([depositedValidators: bigint] & {depositedValidators: bigint})>( + abi, '0xe0aacfc334457703148118055ec794ac17654c6f918d29638ba3b18003cee5ff' + ), + ETHDistributed: new LogEvent<([reportTimestamp: bigint, preCLBalance: bigint, postCLBalance: bigint, withdrawalsWithdrawn: bigint, executionLayerRewardsWithdrawn: bigint, postBufferedEther: bigint] & {reportTimestamp: bigint, preCLBalance: bigint, postCLBalance: bigint, withdrawalsWithdrawn: bigint, executionLayerRewardsWithdrawn: bigint, postBufferedEther: bigint})>( + abi, '0x92dd3cb149a1eebd51fd8c2a3653fd96f30c4ac01d4f850fc16d46abd6c3e92f' + ), + TokenRebased: new LogEvent<([reportTimestamp: bigint, timeElapsed: bigint, preTotalShares: bigint, preTotalEther: bigint, postTotalShares: bigint, postTotalEther: bigint, sharesMintedAsFees: bigint] & {reportTimestamp: bigint, timeElapsed: bigint, preTotalShares: bigint, preTotalEther: bigint, postTotalShares: bigint, postTotalEther: bigint, sharesMintedAsFees: bigint})>( + abi, '0xff08c3ef606d198e316ef5b822193c489965899eb4e3c248cea1a4626c3eda50' + ), + LidoLocatorSet: new LogEvent<([lidoLocator: string] & {lidoLocator: string})>( + abi, '0x61f9416d3c29deb4e424342445a2b132738430becd9fa275e11297c90668b22e' + ), + ELRewardsReceived: new LogEvent<([amount: bigint] & {amount: bigint})>( + abi, '0xd27f9b0c98bdee27044afa149eadcd2047d6399cb6613a45c5b87e6aca76e6b5' + ), + WithdrawalsReceived: new LogEvent<([amount: bigint] & {amount: bigint})>( + abi, '0x6e5086f7e1ab04bd826e77faae35b1bcfe31bd144623361a40ea4af51670b1c3' + ), + Submitted: new LogEvent<([sender: string, amount: bigint, referral: string] & {sender: string, amount: bigint, referral: string})>( + abi, '0x96a25c8ce0baabc1fdefd93e9ed25d8e092a3332f3aa9a41722b5697231d1d1a' + ), + Unbuffered: new LogEvent<([amount: bigint] & {amount: bigint})>( + abi, '0x76a397bea5768d4fca97ef47792796e35f98dc81b16c1de84e28a818e1f97108' + ), + ScriptResult: new LogEvent<([executor: string, script: string, input: string, returnData: string] & {executor: string, script: string, input: string, returnData: string})>( + abi, '0x5229a5dba83a54ae8cb5b51bdd6de9474cacbe9dd332f5185f3a4f4f2e3f4ad9' + ), + RecoverToVault: new LogEvent<([vault: string, token: string, amount: bigint] & {vault: string, token: string, amount: bigint})>( + abi, '0x596caf56044b55fb8c4ca640089bbc2b63cae3e978b851f5745cbb7c5b288e02' + ), + EIP712StETHInitialized: new LogEvent<([eip712StETH: string] & {eip712StETH: string})>( + abi, '0xb80a5409082a3729c9fc139f8b41192c40e85252752df2c07caebd613086ca83' + ), + TransferShares: new LogEvent<([from: string, to: string, sharesValue: bigint] & {from: string, to: string, sharesValue: bigint})>( + abi, '0x9d9c909296d9c674451c0c24f02cb64981eb3b727f99865939192f880a755dcb' + ), + SharesBurnt: new LogEvent<([account: string, preRebaseTokenAmount: bigint, postRebaseTokenAmount: bigint, sharesAmount: bigint] & {account: string, preRebaseTokenAmount: bigint, postRebaseTokenAmount: bigint, sharesAmount: bigint})>( + abi, '0x8b2a1e1ad5e0578c3dd82494156e985dade827a87c573b5c1c7716a32162ad64' + ), + Stopped: new LogEvent<[]>( + abi, '0x7acc84e34091ae817647a4c49116f5cc07f319078ba80f8f5fde37ea7e25cbd6' + ), + Resumed: new LogEvent<[]>( + abi, '0x62451d457bc659158be6e6247f56ec1df424a5c7597f71c20c2bc44e0965c8f9' + ), + Transfer: new LogEvent<([from: string, to: string, value: bigint] & {from: string, to: string, value: bigint})>( + abi, '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' + ), + Approval: new LogEvent<([owner: string, spender: string, value: bigint] & {owner: string, spender: string, value: bigint})>( + abi, '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925' + ), + ContractVersionSet: new LogEvent<([version: bigint] & {version: bigint})>( + abi, '0xfddcded6b4f4730c226821172046b48372d3cd963c159701ae1b7c3bcac541bb' + ), +} + +export const functions = { + resume: new Func<[], {}, []>( + abi, '0x046f7da2' + ), + name: new Func<[], {}, string>( + abi, '0x06fdde03' + ), + stop: new Func<[], {}, []>( + abi, '0x07da68f5' + ), + hasInitialized: new Func<[], {}, boolean>( + abi, '0x0803fac0' + ), + approve: new Func<[_spender: string, _amount: bigint], {_spender: string, _amount: bigint}, boolean>( + abi, '0x095ea7b3' + ), + STAKING_CONTROL_ROLE: new Func<[], {}, string>( + abi, '0x136dd43c' + ), + totalSupply: new Func<[], {}, bigint>( + abi, '0x18160ddd' + ), + getSharesByPooledEth: new Func<[_ethAmount: bigint], {_ethAmount: bigint}, bigint>( + abi, '0x19208451' + ), + isStakingPaused: new Func<[], {}, boolean>( + abi, '0x1ea7ca89' + ), + transferFrom: new Func<[_sender: string, _recipient: string, _amount: bigint], {_sender: string, _recipient: string, _amount: bigint}, boolean>( + abi, '0x23b872dd' + ), + getEVMScriptExecutor: new Func<[_script: string], {_script: string}, string>( + abi, '0x2914b9bd' + ), + setStakingLimit: new Func<[_maxStakeLimit: bigint, _stakeLimitIncreasePerBlock: bigint], {_maxStakeLimit: bigint, _stakeLimitIncreasePerBlock: bigint}, []>( + abi, '0x2cb5f784' + ), + RESUME_ROLE: new Func<[], {}, string>( + abi, '0x2de03aa1' + ), + finalizeUpgrade_v2: new Func<[_lidoLocator: string, _eip712StETH: string], {_lidoLocator: string, _eip712StETH: string}, []>( + abi, '0x2f85e57c' + ), + decimals: new Func<[], {}, number>( + abi, '0x313ce567' + ), + getRecoveryVault: new Func<[], {}, string>( + abi, '0x32f0a3b5' + ), + DOMAIN_SEPARATOR: new Func<[], {}, string>( + abi, '0x3644e515' + ), + getTotalPooledEther: new Func<[], {}, bigint>( + abi, '0x37cfdaca' + ), + unsafeChangeDepositedValidators: new Func<[_newDepositedValidators: bigint], {_newDepositedValidators: bigint}, []>( + abi, '0x38998624' + ), + PAUSE_ROLE: new Func<[], {}, string>( + abi, '0x389ed267' + ), + increaseAllowance: new Func<[_spender: string, _addedValue: bigint], {_spender: string, _addedValue: bigint}, boolean>( + abi, '0x39509351' + ), + getTreasury: new Func<[], {}, string>( + abi, '0x3b19e84a' + ), + isStopped: new Func<[], {}, boolean>( + abi, '0x3f683b6a' + ), + getBufferedEther: new Func<[], {}, bigint>( + abi, '0x47b714e0' + ), + initialize: new Func<[_lidoLocator: string, _eip712StETH: string], {_lidoLocator: string, _eip712StETH: string}, []>( + abi, '0x485cc955' + ), + receiveELRewards: new Func<[], {}, []>( + abi, '0x4ad509b2' + ), + getWithdrawalCredentials: new Func<[], {}, string>( + abi, '0x56396715' + ), + getCurrentStakeLimit: new Func<[], {}, bigint>( + abi, '0x609c4c6c' + ), + getStakeLimitFullInfo: new Func<[], {}, ([isStakingPaused: boolean, isStakingLimitSet: boolean, currentStakeLimit: bigint, maxStakeLimit: bigint, maxStakeLimitGrowthBlocks: bigint, prevStakeLimit: bigint, prevStakeBlockNumber: bigint] & {isStakingPaused: boolean, isStakingLimitSet: boolean, currentStakeLimit: bigint, maxStakeLimit: bigint, maxStakeLimitGrowthBlocks: bigint, prevStakeLimit: bigint, prevStakeBlockNumber: bigint})>( + abi, '0x665b4b0b' + ), + transferSharesFrom: new Func<[_sender: string, _recipient: string, _sharesAmount: bigint], {_sender: string, _recipient: string, _sharesAmount: bigint}, bigint>( + abi, '0x6d780459' + ), + balanceOf: new Func<[_account: string], {_account: string}, bigint>( + abi, '0x70a08231' + ), + resumeStaking: new Func<[], {}, []>( + abi, '0x7475f913' + ), + getFeeDistribution: new Func<[], {}, ([treasuryFeeBasisPoints: number, insuranceFeeBasisPoints: number, operatorsFeeBasisPoints: number] & {treasuryFeeBasisPoints: number, insuranceFeeBasisPoints: number, operatorsFeeBasisPoints: number})>( + abi, '0x752f77f1' + ), + receiveWithdrawals: new Func<[], {}, []>( + abi, '0x78ffcfe2' + ), + getPooledEthByShares: new Func<[_sharesAmount: bigint], {_sharesAmount: bigint}, bigint>( + abi, '0x7a28fb88' + ), + allowRecoverability: new Func<[token: string], {token: string}, boolean>( + abi, '0x7e7db6e1' + ), + nonces: new Func<[owner: string], {owner: string}, bigint>( + abi, '0x7ecebe00' + ), + appId: new Func<[], {}, string>( + abi, '0x80afdea8' + ), + getOracle: new Func<[], {}, string>( + abi, '0x833b1fce' + ), + eip712Domain: new Func<[], {}, ([name: string, version: string, chainId: bigint, verifyingContract: string] & {name: string, version: string, chainId: bigint, verifyingContract: string})>( + abi, '0x84b0196e' + ), + getContractVersion: new Func<[], {}, bigint>( + abi, '0x8aa10435' + ), + getInitializationBlock: new Func<[], {}, bigint>( + abi, '0x8b3dd749' + ), + transferShares: new Func<[_recipient: string, _sharesAmount: bigint], {_recipient: string, _sharesAmount: bigint}, bigint>( + abi, '0x8fcb4e5b' + ), + symbol: new Func<[], {}, string>( + abi, '0x95d89b41' + ), + getEIP712StETH: new Func<[], {}, string>( + abi, '0x9861f8e5' + ), + transferToVault: new Func<[_: string], {}, []>( + abi, '0x9d4941d8' + ), + canPerform: new Func<[_sender: string, _role: string, _params: Array], {_sender: string, _role: string, _params: Array}, boolean>( + abi, '0xa1658fad' + ), + submit: new Func<[_referral: string], {_referral: string}, bigint>( + abi, '0xa1903eab' + ), + decreaseAllowance: new Func<[_spender: string, _subtractedValue: bigint], {_spender: string, _subtractedValue: bigint}, boolean>( + abi, '0xa457c2d7' + ), + getEVMScriptRegistry: new Func<[], {}, string>( + abi, '0xa479e508' + ), + transfer: new Func<[_recipient: string, _amount: bigint], {_recipient: string, _amount: bigint}, boolean>( + abi, '0xa9059cbb' + ), + deposit: new Func<[_maxDepositsCount: bigint, _stakingModuleId: bigint, _depositCalldata: string], {_maxDepositsCount: bigint, _stakingModuleId: bigint, _depositCalldata: string}, []>( + abi, '0xaa0b7db7' + ), + UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE: new Func<[], {}, string>( + abi, '0xad1394e9' + ), + getBeaconStat: new Func<[], {}, ([depositedValidators: bigint, beaconValidators: bigint, beaconBalance: bigint] & {depositedValidators: bigint, beaconValidators: bigint, beaconBalance: bigint})>( + abi, '0xae2e3538' + ), + removeStakingLimit: new Func<[], {}, []>( + abi, '0xb3320d9a' + ), + handleOracleReport: new Func<[_reportTimestamp: bigint, _timeElapsed: bigint, _clValidators: bigint, _clBalance: bigint, _withdrawalVaultBalance: bigint, _elRewardsVaultBalance: bigint, _sharesRequestedToBurn: bigint, _withdrawalFinalizationBatches: Array, _simulatedShareRate: bigint], {_reportTimestamp: bigint, _timeElapsed: bigint, _clValidators: bigint, _clBalance: bigint, _withdrawalVaultBalance: bigint, _elRewardsVaultBalance: bigint, _sharesRequestedToBurn: bigint, _withdrawalFinalizationBatches: Array, _simulatedShareRate: bigint}, Array>( + abi, '0xbac3f3c5' + ), + getFee: new Func<[], {}, number>( + abi, '0xced72f87' + ), + kernel: new Func<[], {}, string>( + abi, '0xd4aae0c4' + ), + getTotalShares: new Func<[], {}, bigint>( + abi, '0xd5002f2e' + ), + permit: new Func<[_owner: string, _spender: string, _value: bigint, _deadline: bigint, _v: number, _r: string, _s: string], {_owner: string, _spender: string, _value: bigint, _deadline: bigint, _v: number, _r: string, _s: string}, []>( + abi, '0xd505accf' + ), + allowance: new Func<[_owner: string, _spender: string], {_owner: string, _spender: string}, bigint>( + abi, '0xdd62ed3e' + ), + isPetrified: new Func<[], {}, boolean>( + abi, '0xde4796ed' + ), + getLidoLocator: new Func<[], {}, string>( + abi, '0xe654ff17' + ), + canDeposit: new Func<[], {}, boolean>( + abi, '0xe78a5875' + ), + STAKING_PAUSE_ROLE: new Func<[], {}, string>( + abi, '0xeb85262f' + ), + getDepositableEther: new Func<[], {}, bigint>( + abi, '0xf2cfa87d' + ), + sharesOf: new Func<[_account: string], {_account: string}, bigint>( + abi, '0xf5eb42dc' + ), + pauseStaking: new Func<[], {}, []>( + abi, '0xf999c506' + ), + getTotalELRewardsCollected: new Func<[], {}, bigint>( + abi, '0xfa64ebac' + ), +} + +export class Contract extends ContractBase { + + name(): Promise { + return this.eth_call(functions.name, []) + } + + hasInitialized(): Promise { + return this.eth_call(functions.hasInitialized, []) + } + + STAKING_CONTROL_ROLE(): Promise { + return this.eth_call(functions.STAKING_CONTROL_ROLE, []) + } + + totalSupply(): Promise { + return this.eth_call(functions.totalSupply, []) + } + + getSharesByPooledEth(_ethAmount: bigint): Promise { + return this.eth_call(functions.getSharesByPooledEth, [_ethAmount]) + } + + isStakingPaused(): Promise { + return this.eth_call(functions.isStakingPaused, []) + } + + getEVMScriptExecutor(_script: string): Promise { + return this.eth_call(functions.getEVMScriptExecutor, [_script]) + } + + RESUME_ROLE(): Promise { + return this.eth_call(functions.RESUME_ROLE, []) + } + + decimals(): Promise { + return this.eth_call(functions.decimals, []) + } + + getRecoveryVault(): Promise { + return this.eth_call(functions.getRecoveryVault, []) + } + + DOMAIN_SEPARATOR(): Promise { + return this.eth_call(functions.DOMAIN_SEPARATOR, []) + } + + getTotalPooledEther(): Promise { + return this.eth_call(functions.getTotalPooledEther, []) + } + + PAUSE_ROLE(): Promise { + return this.eth_call(functions.PAUSE_ROLE, []) + } + + getTreasury(): Promise { + return this.eth_call(functions.getTreasury, []) + } + + isStopped(): Promise { + return this.eth_call(functions.isStopped, []) + } + + getBufferedEther(): Promise { + return this.eth_call(functions.getBufferedEther, []) + } + + getWithdrawalCredentials(): Promise { + return this.eth_call(functions.getWithdrawalCredentials, []) + } + + getCurrentStakeLimit(): Promise { + return this.eth_call(functions.getCurrentStakeLimit, []) + } + + getStakeLimitFullInfo(): Promise<([isStakingPaused: boolean, isStakingLimitSet: boolean, currentStakeLimit: bigint, maxStakeLimit: bigint, maxStakeLimitGrowthBlocks: bigint, prevStakeLimit: bigint, prevStakeBlockNumber: bigint] & {isStakingPaused: boolean, isStakingLimitSet: boolean, currentStakeLimit: bigint, maxStakeLimit: bigint, maxStakeLimitGrowthBlocks: bigint, prevStakeLimit: bigint, prevStakeBlockNumber: bigint})> { + return this.eth_call(functions.getStakeLimitFullInfo, []) + } + + balanceOf(_account: string): Promise { + return this.eth_call(functions.balanceOf, [_account]) + } + + getFeeDistribution(): Promise<([treasuryFeeBasisPoints: number, insuranceFeeBasisPoints: number, operatorsFeeBasisPoints: number] & {treasuryFeeBasisPoints: number, insuranceFeeBasisPoints: number, operatorsFeeBasisPoints: number})> { + return this.eth_call(functions.getFeeDistribution, []) + } + + getPooledEthByShares(_sharesAmount: bigint): Promise { + return this.eth_call(functions.getPooledEthByShares, [_sharesAmount]) + } + + allowRecoverability(token: string): Promise { + return this.eth_call(functions.allowRecoverability, [token]) + } + + nonces(owner: string): Promise { + return this.eth_call(functions.nonces, [owner]) + } + + appId(): Promise { + return this.eth_call(functions.appId, []) + } + + getOracle(): Promise { + return this.eth_call(functions.getOracle, []) + } + + eip712Domain(): Promise<([name: string, version: string, chainId: bigint, verifyingContract: string] & {name: string, version: string, chainId: bigint, verifyingContract: string})> { + return this.eth_call(functions.eip712Domain, []) + } + + getContractVersion(): Promise { + return this.eth_call(functions.getContractVersion, []) + } + + getInitializationBlock(): Promise { + return this.eth_call(functions.getInitializationBlock, []) + } + + symbol(): Promise { + return this.eth_call(functions.symbol, []) + } + + getEIP712StETH(): Promise { + return this.eth_call(functions.getEIP712StETH, []) + } + + canPerform(_sender: string, _role: string, _params: Array): Promise { + return this.eth_call(functions.canPerform, [_sender, _role, _params]) + } + + getEVMScriptRegistry(): Promise { + return this.eth_call(functions.getEVMScriptRegistry, []) + } + + UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE(): Promise { + return this.eth_call(functions.UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE, []) + } + + getBeaconStat(): Promise<([depositedValidators: bigint, beaconValidators: bigint, beaconBalance: bigint] & {depositedValidators: bigint, beaconValidators: bigint, beaconBalance: bigint})> { + return this.eth_call(functions.getBeaconStat, []) + } + + getFee(): Promise { + return this.eth_call(functions.getFee, []) + } + + kernel(): Promise { + return this.eth_call(functions.kernel, []) + } + + getTotalShares(): Promise { + return this.eth_call(functions.getTotalShares, []) + } + + allowance(_owner: string, _spender: string): Promise { + return this.eth_call(functions.allowance, [_owner, _spender]) + } + + isPetrified(): Promise { + return this.eth_call(functions.isPetrified, []) + } + + getLidoLocator(): Promise { + return this.eth_call(functions.getLidoLocator, []) + } + + canDeposit(): Promise { + return this.eth_call(functions.canDeposit, []) + } + + STAKING_PAUSE_ROLE(): Promise { + return this.eth_call(functions.STAKING_PAUSE_ROLE, []) + } + + getDepositableEther(): Promise { + return this.eth_call(functions.getDepositableEther, []) + } + + sharesOf(_account: string): Promise { + return this.eth_call(functions.sharesOf, [_account]) + } + + getTotalELRewardsCollected(): Promise { + return this.eth_call(functions.getTotalELRewardsCollected, []) + } +} diff --git a/src/processors/curve-lp/curve-lp.ts b/src/processors/curve-lp/curve-lp.ts index 35e2b890..91d3b997 100644 --- a/src/processors/curve-lp/curve-lp.ts +++ b/src/processors/curve-lp/curve-lp.ts @@ -1,7 +1,7 @@ import { EvmBatchProcessor } from '@subsquid/evm-processor' -import { hexToBigInt, pad } from 'viem' +import { pad } from 'viem' -import * as curve_lp_token from '../../abi/curve_lp_token' +import * as curveLpToken from '../../abi/curve-lp-token' import * as erc20 from '../../abi/erc20' import { CurveLP } from '../../model' import { Context } from '../../processor' @@ -24,10 +24,10 @@ export const setup = (processor: EvmBatchProcessor) => { processor.addLog({ address: [OETH_CURVE_LP_ADDRESS], topic0: [ - curve_lp_token.events.AddLiquidity.topic, - curve_lp_token.events.RemoveLiquidity.topic, - curve_lp_token.events.RemoveLiquidityImbalance.topic, - curve_lp_token.events.RemoveLiquidityOne.topic, + curveLpToken.events.AddLiquidity.topic, + curveLpToken.events.RemoveLiquidity.topic, + curveLpToken.events.RemoveLiquidityImbalance.topic, + curveLpToken.events.RemoveLiquidityOne.topic, // curve_lp_token.events.TokenExchange.topic, // Not sure if including this helps get up-to-date eth balances. ], }) @@ -43,12 +43,12 @@ export const setup = (processor: EvmBatchProcessor) => { }) processor.addLog({ address: [OETH_CURVE_LP_ADDRESS], - topic0: [curve_lp_token.events.Transfer.topic], + topic0: [curveLpToken.events.Transfer.topic], topic1: [pad(OETH_CURVE_LP_OWNER_ADDRESS)], }) processor.addLog({ address: [OETH_CURVE_LP_ADDRESS], - topic0: [curve_lp_token.events.Transfer.topic], + topic0: [curveLpToken.events.Transfer.topic], topic2: [pad(OETH_CURVE_LP_OWNER_ADDRESS)], }) // Not sure if this is needed to get up-to-date ETH balances. @@ -154,24 +154,23 @@ const processLiquidityEvents = async ( block: Context['blocks']['0'], log: Context['blocks']['0']['logs']['0'], ) => { - if (log.topics[0] === curve_lp_token.events.AddLiquidity.topic) { - const { token_supply } = curve_lp_token.events.AddLiquidity.decode(log) + if (log.topics[0] === curveLpToken.events.AddLiquidity.topic) { + const { token_supply } = curveLpToken.events.AddLiquidity.decode(log) const { curveLP } = await getLatestCurveLP(ctx, result, block) curveLP.totalSupply = token_supply } else if ( - log.topics[0] === curve_lp_token.events.RemoveLiquidityImbalance.topic + log.topics[0] === curveLpToken.events.RemoveLiquidityImbalance.topic ) { const { token_supply } = - curve_lp_token.events.RemoveLiquidityImbalance.decode(log) + curveLpToken.events.RemoveLiquidityImbalance.decode(log) const { curveLP } = await getLatestCurveLP(ctx, result, block) curveLP.totalSupply = token_supply - } else if (log.topics[0] === curve_lp_token.events.RemoveLiquidityOne.topic) { - const { token_supply } = - curve_lp_token.events.RemoveLiquidityOne.decode(log) + } else if (log.topics[0] === curveLpToken.events.RemoveLiquidityOne.topic) { + const { token_supply } = curveLpToken.events.RemoveLiquidityOne.decode(log) const { curveLP } = await getLatestCurveLP(ctx, result, block) curveLP.totalSupply = token_supply - } else if (log.topics[0] === curve_lp_token.events.RemoveLiquidity.topic) { - const { token_supply } = curve_lp_token.events.RemoveLiquidity.decode(log) + } else if (log.topics[0] === curveLpToken.events.RemoveLiquidity.topic) { + const { token_supply } = curveLpToken.events.RemoveLiquidity.decode(log) const { curveLP } = await getLatestCurveLP(ctx, result, block) curveLP.totalSupply = token_supply } @@ -183,7 +182,7 @@ const processCurveLPTransfer = async ( block: Context['blocks']['0'], log: Context['blocks']['0']['logs']['0'], ) => { - if (log.topics[0] === curve_lp_token.events.Transfer.topic) { + if (log.topics[0] === curveLpToken.events.Transfer.topic) { await trackAddressBalances({ log, address: OETH_CURVE_LP_OWNER_ADDRESS, diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts index 809c2550..bdbdb66c 100644 --- a/src/processors/vault/vault.ts +++ b/src/processors/vault/vault.ts @@ -2,10 +2,10 @@ import { EvmBatchProcessor } from '@subsquid/evm-processor' import { pad } from 'viem' import * as erc20 from '../../abi/erc20' +import * as stEth from '../../abi/liquid-staked-eth-2.0' import { Vault } from '../../model' import { Context } from '../../processor' import { - ADDRESS_ZERO, FRXETH_ADDRESS, OETH_CURVE_LP_ADDRESS, OETH_VAULT_ADDRESS, @@ -15,10 +15,7 @@ import { WETH_ADDRESS, } from '../../utils/addresses' import { getEthBalance } from '../../utils/getEthBalance' -import { - updateFinancialStatement, - useFinancialStatements, -} from '../financial-statement' +import { updateFinancialStatement } from '../financial-statement' import { getLatest, trackAddressBalances } from '../utils' interface ProcessResult { @@ -38,6 +35,10 @@ export const setup = (processor: EvmBatchProcessor) => { topic0: [erc20.events.Transfer.topic], topic2: [pad(OETH_VAULT_ADDRESS)], }) + processor.addLog({ + address: [STETH_ADDRESS], + topic0: [stEth.events.TokenRebased.topic], + }) processor.addTransaction({ from: [OETH_VAULT_ADDRESS], }) @@ -61,6 +62,7 @@ export const process = async (ctx: Context) => { } for (const log of block.logs) { await processTransfer(ctx, result, block, log) + await processStEthRebase(ctx, result, block, log) } } @@ -72,10 +74,13 @@ const updateETHBalance = async ( result: ProcessResult, block: Context['blocks']['0'], ) => { - const { vault, isNew } = await getLatestVault(ctx, result, block, { - skipFinancialStatementUpdate: true, - }) - const eth = await getEthBalance(ctx, OETH_CURVE_LP_ADDRESS, block) + ctx.log.info('vault: updating eth balance') + const [{ vault, isNew }, eth] = await Promise.all([ + getLatestVault(ctx, result, block, { + skipFinancialStatementUpdate: true, + }), + getEthBalance(ctx, OETH_CURVE_LP_ADDRESS, block), + ]) if (vault.eth === eth) { // Nothing to do, remove the new vault record if we created one. if (isNew) { @@ -87,6 +92,23 @@ const updateETHBalance = async ( } } +const processStEthRebase = async ( + ctx: Context, + result: ProcessResult, + block: Context['blocks']['0'], + log: Context['blocks']['0']['logs']['0'], +) => { + if ( + log.address === STETH_ADDRESS && + log.topics[0] === stEth.events.TokenRebased.topic + ) { + ctx.log.info('vault: updating stETH balance') + const { vault } = await getLatestVault(ctx, result, block) + const contract = new stEth.Contract(ctx, block.header, STETH_ADDRESS) + vault.stETH = await contract.balanceOf(OETH_VAULT_ADDRESS) + } +} + const processTransfer = async ( ctx: Context, result: ProcessResult, From f026261b696a4c5271955d4623716ad0562f91e2 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Mon, 25 Sep 2023 13:59:32 -0700 Subject: [PATCH 24/31] update squid version and getLatest > getLatestEntity --- squid.yaml | 8 ++++---- src/processors/curve-lp/curve-lp.ts | 4 ++-- src/processors/dripper/dripper.ts | 4 ++-- src/processors/frax-staking/frax-staking.ts | 4 ++-- src/processors/morpho-aave/morpho-aave.ts | 4 ++-- src/processors/utils.ts | 7 ++++--- src/processors/vault/vault.ts | 4 ++-- 7 files changed, 18 insertions(+), 17 deletions(-) diff --git a/squid.yaml b/squid.yaml index a019d505..84b025d3 100644 --- a/squid.yaml +++ b/squid.yaml @@ -1,11 +1,11 @@ -manifestVersion: subsquid.io/v0.5 +manifestVersion: subsquid.io/v0.6 name: origin-squid -version: 5 +version: 6 description: 'The very first evm squid from manifest ' -build: +build: deploy: addons: - postgres: + postgres: secrets: - RPC_ENDPOINT processor: diff --git a/src/processors/curve-lp/curve-lp.ts b/src/processors/curve-lp/curve-lp.ts index 91d3b997..3f856926 100644 --- a/src/processors/curve-lp/curve-lp.ts +++ b/src/processors/curve-lp/curve-lp.ts @@ -12,7 +12,7 @@ import { } from '../../utils/addresses' import { getEthBalance } from '../../utils/getEthBalance' import { updateFinancialStatement } from '../financial-statement' -import { getLatest, trackAddressBalances } from '../utils' +import { getLatestEntity, trackAddressBalances } from '../utils' interface ProcessResult { curveLPs: CurveLP[] @@ -208,7 +208,7 @@ const getLatestCurveLP = async ( options?: { skipFinancialStatementUpdate: boolean }, ) => { const timestampId = new Date(block.header.timestamp).toISOString() - const { latest, current } = await getLatest( + const { latest, current } = await getLatestEntity( ctx, CurveLP, result.curveLPs, diff --git a/src/processors/dripper/dripper.ts b/src/processors/dripper/dripper.ts index 8bfab47b..1e1fdde2 100644 --- a/src/processors/dripper/dripper.ts +++ b/src/processors/dripper/dripper.ts @@ -6,7 +6,7 @@ import { Dripper } from '../../model' import { Context } from '../../processor' import { OETH_DRIPPER_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' import { updateFinancialStatement } from '../financial-statement' -import { getLatest, trackAddressBalances } from '../utils' +import { getLatestEntity, trackAddressBalances } from '../utils' interface ProcessResult { drippers: Dripper[] @@ -54,7 +54,7 @@ const processTransfer = async ( tokens: [WETH_ADDRESS], fn: async ({ log, token, change }) => { const timestampId = new Date(block.header.timestamp).toISOString() - const { latest, current } = await getLatest( + const { latest, current } = await getLatestEntity( ctx, Dripper, result.drippers, diff --git a/src/processors/frax-staking/frax-staking.ts b/src/processors/frax-staking/frax-staking.ts index ef9c4b1d..d4b6c4eb 100644 --- a/src/processors/frax-staking/frax-staking.ts +++ b/src/processors/frax-staking/frax-staking.ts @@ -9,7 +9,7 @@ import { SFRXETH_ADDRESS, } from '../../utils/addresses' import { updateFinancialStatement } from '../financial-statement' -import { getLatest, trackAddressBalances } from '../utils' +import { getLatestEntity, trackAddressBalances } from '../utils' interface ProcessResult { fraxStakings: FraxStaking[] @@ -57,7 +57,7 @@ const processTransfer = async ( tokens: [SFRXETH_ADDRESS], fn: async ({ token, change }) => { const timestampId = new Date(block.header.timestamp).toISOString() - const { latest, current } = await getLatest( + const { latest, current } = await getLatestEntity( ctx, FraxStaking, result.fraxStakings, diff --git a/src/processors/morpho-aave/morpho-aave.ts b/src/processors/morpho-aave/morpho-aave.ts index d1245c4f..a6d37c6f 100644 --- a/src/processors/morpho-aave/morpho-aave.ts +++ b/src/processors/morpho-aave/morpho-aave.ts @@ -6,7 +6,7 @@ import { MorphoAave } from '../../model' import { Context } from '../../processor' import { OETH_MORPHO_AAVE_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' import { updateFinancialStatement } from '../financial-statement' -import { getLatest, trackAddressBalances } from '../utils' +import { getLatestEntity, trackAddressBalances } from '../utils' interface ProcessResult { morphoAaves: MorphoAave[] @@ -54,7 +54,7 @@ const processTransfer = async ( tokens: [WETH_ADDRESS], fn: async ({ log, token, change }) => { const timestampId = new Date(block.header.timestamp).toISOString() - const { latest, current } = await getLatest( + const { latest, current } = await getLatestEntity( ctx, MorphoAave, result.morphoAaves, diff --git a/src/processors/utils.ts b/src/processors/utils.ts index c9aff3dd..fe80d0a4 100644 --- a/src/processors/utils.ts +++ b/src/processors/utils.ts @@ -1,9 +1,10 @@ -import { Context } from '../processor' -import * as erc20 from '../abi/erc20' import { Entity, EntityClass } from '@subsquid/typeorm-store' import { LessThanOrEqual } from 'typeorm' import { pad } from 'viem' +import * as erc20 from '../abi/erc20' +import { Context } from '../processor' + export const trackAddressBalances = async ({ log, address, @@ -36,7 +37,7 @@ export const trackAddressBalances = async ({ } } -export const getLatest = async ( +export const getLatestEntity = async ( ctx: Context, entity: EntityClass, memory: T[], diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts index bdbdb66c..b32a9532 100644 --- a/src/processors/vault/vault.ts +++ b/src/processors/vault/vault.ts @@ -16,7 +16,7 @@ import { } from '../../utils/addresses' import { getEthBalance } from '../../utils/getEthBalance' import { updateFinancialStatement } from '../financial-statement' -import { getLatest, trackAddressBalances } from '../utils' +import { getLatestEntity, trackAddressBalances } from '../utils' interface ProcessResult { vaults: Vault[] @@ -144,7 +144,7 @@ const getLatestVault = async ( ) => { let isNew = false const timestampId = new Date(block.header.timestamp).toISOString() - const { latest, current } = await getLatest( + const { latest, current } = await getLatestEntity( ctx, Vault, result.vaults, From 6921157ed49b3c7c420abb87643015e2be4cd675 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Tue, 26 Sep 2023 15:03:41 -0700 Subject: [PATCH 25/31] fix which eth balance vault is looking at --- src/processors/vault/vault.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts index b32a9532..66808fd6 100644 --- a/src/processors/vault/vault.ts +++ b/src/processors/vault/vault.ts @@ -7,7 +7,6 @@ import { Vault } from '../../model' import { Context } from '../../processor' import { FRXETH_ADDRESS, - OETH_CURVE_LP_ADDRESS, OETH_VAULT_ADDRESS, RETH_ADDRESS, STETH_ADDRESS, @@ -54,7 +53,7 @@ export const process = async (ctx: Context) => { for (const block of ctx.blocks) { const transaction = block.transactions.find( - (t) => t.from === OETH_CURVE_LP_ADDRESS || t.to === OETH_CURVE_LP_ADDRESS, + (t) => t.from === OETH_VAULT_ADDRESS || t.to === OETH_VAULT_ADDRESS, ) if (transaction) { // We only want to do this once per block. @@ -79,7 +78,7 @@ const updateETHBalance = async ( getLatestVault(ctx, result, block, { skipFinancialStatementUpdate: true, }), - getEthBalance(ctx, OETH_CURVE_LP_ADDRESS, block), + getEthBalance(ctx, OETH_VAULT_ADDRESS, block), ]) if (vault.eth === eth) { // Nothing to do, remove the new vault record if we created one. From 00230d0eb358aa663a184af899cc1b035ef8955b Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Tue, 26 Sep 2023 17:33:31 -0700 Subject: [PATCH 26/31] remove eth from vault and add OETH object to track OETH total supply to represent the 'Token Supply' liability which i forgot --- ...62784724-Data.js => 1695774521380-Data.js} | 18 +++++++-- schema.graphql | 9 ++++- squid.yaml | 2 +- .../generated/financialStatement.model.ts | 5 +++ src/model/generated/index.ts | 1 + src/model/generated/vault.model.ts | 3 -- .../financial-statement.ts | 15 ++++++-- src/processors/oeth/oeth.ts | 29 +++++++++++++++ src/processors/vault/vault.ts | 37 ------------------- 9 files changed, 70 insertions(+), 49 deletions(-) rename db/migrations/{1695162784724-Data.js => 1695774521380-Data.js} (87%) diff --git a/db/migrations/1695162784724-Data.js b/db/migrations/1695774521380-Data.js similarity index 87% rename from db/migrations/1695162784724-Data.js rename to db/migrations/1695774521380-Data.js index f1f130b4..c8a0ea1d 100644 --- a/db/migrations/1695162784724-Data.js +++ b/db/migrations/1695774521380-Data.js @@ -1,7 +1,10 @@ -module.exports = class Data1695162784724 { - name = 'Data1695162784724' +module.exports = class Data1695774521380 { + name = 'Data1695774521380' async up(db) { + await db.query(`CREATE TABLE "oeth" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "total_supply" numeric NOT NULL, CONSTRAINT "PK_de1d885501070dbd1ab6f8577ba" PRIMARY KEY ("id"))`) + await db.query(`CREATE INDEX "IDX_5b81a67229bac2d68e0dc92cc4" ON "oeth" ("timestamp") `) + await db.query(`CREATE INDEX "IDX_408e5f79f83093aa5cf2b0ea32" ON "oeth" ("block_number") `) await db.query(`CREATE TABLE "history" ("id" character varying NOT NULL, "value" numeric NOT NULL, "balance" numeric NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "tx_hash" text NOT NULL, "type" character varying(8) NOT NULL, "address_id" character varying, CONSTRAINT "PK_9384942edf4804b38ca0ee51416" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_59a55adcc59ddb69c297da693e" ON "history" ("address_id") `) await db.query(`CREATE INDEX "IDX_7a259431108a22e8ca2f375fc7" ON "history" ("block_number") `) @@ -21,7 +24,7 @@ module.exports = class Data1695162784724 { await db.query(`CREATE INDEX "IDX_e59c9a534fcf23a97a8ac92afa" ON "rebase_option" ("block_number") `) await db.query(`CREATE INDEX "IDX_6b6c08ec25dacd1a5bd6170152" ON "rebase_option" ("tx_hash") `) await db.query(`CREATE INDEX "IDX_66c04aee6855c74debae4add8f" ON "rebase_option" ("address_id") `) - await db.query(`CREATE TABLE "vault" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "eth" numeric NOT NULL, "weth" numeric NOT NULL, "st_eth" numeric NOT NULL, "r_eth" numeric NOT NULL, "frx_eth" numeric NOT NULL, CONSTRAINT "PK_dd0898234c77f9d97585171ac59" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "vault" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "weth" numeric NOT NULL, "st_eth" numeric NOT NULL, "r_eth" numeric NOT NULL, "frx_eth" numeric NOT NULL, CONSTRAINT "PK_dd0898234c77f9d97585171ac59" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_0f1a5b7e346813a4ec3a03010b" ON "vault" ("timestamp") `) await db.query(`CREATE INDEX "IDX_a9b314451a9001a7b0a222f68a" ON "vault" ("block_number") `) await db.query(`CREATE TABLE "curve_lp" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "total_supply" numeric NOT NULL, "eth" numeric NOT NULL, "oeth" numeric NOT NULL, "total_supply_owned" numeric NOT NULL, "eth_owned" numeric NOT NULL, "oeth_owned" numeric NOT NULL, CONSTRAINT "PK_78cd36e42a49ac6ca38349e93ca" PRIMARY KEY ("id"))`) @@ -36,9 +39,10 @@ module.exports = class Data1695162784724 { await db.query(`CREATE TABLE "dripper" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "weth" numeric NOT NULL, CONSTRAINT "PK_74fd102c8d1c60f4b1650a61ffc" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_88c58f8948c3294c2a9e2791dc" ON "dripper" ("timestamp") `) await db.query(`CREATE INDEX "IDX_06822c0a260797711acc9023d5" ON "dripper" ("block_number") `) - await db.query(`CREATE TABLE "financial_statement" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "vault_id" character varying, "curve_lp_id" character varying, "frax_staking_id" character varying, "morpho_aave_id" character varying, "dripper_id" character varying, CONSTRAINT "PK_4e795d12a43006ece4788e13371" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "financial_statement" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "oeth_id" character varying, "vault_id" character varying, "curve_lp_id" character varying, "frax_staking_id" character varying, "morpho_aave_id" character varying, "dripper_id" character varying, CONSTRAINT "PK_4e795d12a43006ece4788e13371" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_ef18e864908765e31b7232fe41" ON "financial_statement" ("timestamp") `) await db.query(`CREATE INDEX "IDX_0b50f0a8fca1f65659ce36feb4" ON "financial_statement" ("block_number") `) + await db.query(`CREATE INDEX "IDX_d331341d76e723609791afdb3a" ON "financial_statement" ("oeth_id") `) await db.query(`CREATE INDEX "IDX_9f37653694923d2b62c6c01190" ON "financial_statement" ("vault_id") `) await db.query(`CREATE INDEX "IDX_4b9b21bbd516414896d4afed7f" ON "financial_statement" ("curve_lp_id") `) await db.query(`CREATE INDEX "IDX_b5c2c4b2d43680e3c6470d7f9d" ON "financial_statement" ("frax_staking_id") `) @@ -47,6 +51,7 @@ module.exports = class Data1695162784724 { await db.query(`ALTER TABLE "history" ADD CONSTRAINT "FK_59a55adcc59ddb69c297da693e5" FOREIGN KEY ("address_id") REFERENCES "address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "rebase" ADD CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2" FOREIGN KEY ("apy_id") REFERENCES "apy"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "rebase_option" ADD CONSTRAINT "FK_66c04aee6855c74debae4add8fe" FOREIGN KEY ("address_id") REFERENCES "address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) + await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_d331341d76e723609791afdb3a1" FOREIGN KEY ("oeth_id") REFERENCES "oeth"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_9f37653694923d2b62c6c01190b" FOREIGN KEY ("vault_id") REFERENCES "vault"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_4b9b21bbd516414896d4afed7fe" FOREIGN KEY ("curve_lp_id") REFERENCES "curve_lp"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_b5c2c4b2d43680e3c6470d7f9df" FOREIGN KEY ("frax_staking_id") REFERENCES "frax_staking"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) @@ -55,6 +60,9 @@ module.exports = class Data1695162784724 { } async down(db) { + await db.query(`DROP TABLE "oeth"`) + await db.query(`DROP INDEX "public"."IDX_5b81a67229bac2d68e0dc92cc4"`) + await db.query(`DROP INDEX "public"."IDX_408e5f79f83093aa5cf2b0ea32"`) await db.query(`DROP TABLE "history"`) await db.query(`DROP INDEX "public"."IDX_59a55adcc59ddb69c297da693e"`) await db.query(`DROP INDEX "public"."IDX_7a259431108a22e8ca2f375fc7"`) @@ -92,6 +100,7 @@ module.exports = class Data1695162784724 { await db.query(`DROP TABLE "financial_statement"`) await db.query(`DROP INDEX "public"."IDX_ef18e864908765e31b7232fe41"`) await db.query(`DROP INDEX "public"."IDX_0b50f0a8fca1f65659ce36feb4"`) + await db.query(`DROP INDEX "public"."IDX_d331341d76e723609791afdb3a"`) await db.query(`DROP INDEX "public"."IDX_9f37653694923d2b62c6c01190"`) await db.query(`DROP INDEX "public"."IDX_4b9b21bbd516414896d4afed7f"`) await db.query(`DROP INDEX "public"."IDX_b5c2c4b2d43680e3c6470d7f9d"`) @@ -100,6 +109,7 @@ module.exports = class Data1695162784724 { await db.query(`ALTER TABLE "history" DROP CONSTRAINT "FK_59a55adcc59ddb69c297da693e5"`) await db.query(`ALTER TABLE "rebase" DROP CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2"`) await db.query(`ALTER TABLE "rebase_option" DROP CONSTRAINT "FK_66c04aee6855c74debae4add8fe"`) + await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_d331341d76e723609791afdb3a1"`) await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_9f37653694923d2b62c6c01190b"`) await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_4b9b21bbd516414896d4afed7fe"`) await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_b5c2c4b2d43680e3c6470d7f9df"`) diff --git a/schema.graphql b/schema.graphql index c1651de8..4416134d 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1,3 +1,10 @@ +type OETH @entity { + id: ID! @index + timestamp: DateTime! @index + blockNumber: Int! @index + totalSupply: BigInt! +} + enum RebasingOption { OptIn OptOut @@ -69,6 +76,7 @@ type FinancialStatement @entity { id: ID! timestamp: DateTime! @index blockNumber: Int! @index + oeth: OETH! vault: Vault! curveLP: CurveLP! fraxStaking: FraxStaking! @@ -81,7 +89,6 @@ type Vault @entity { id: ID! timestamp: DateTime! @index blockNumber: Int! @index - eth: BigInt! weth: BigInt! stETH: BigInt! rETH: BigInt! diff --git a/squid.yaml b/squid.yaml index 84b025d3..f027e6af 100644 --- a/squid.yaml +++ b/squid.yaml @@ -1,4 +1,4 @@ -manifestVersion: subsquid.io/v0.6 +manifestVersion: subsquid.io/v0.1 name: origin-squid version: 6 description: 'The very first evm squid from manifest ' diff --git a/src/model/generated/financialStatement.model.ts b/src/model/generated/financialStatement.model.ts index 3a71e51b..e98fb436 100644 --- a/src/model/generated/financialStatement.model.ts +++ b/src/model/generated/financialStatement.model.ts @@ -1,4 +1,5 @@ import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_, ManyToOne as ManyToOne_} from "typeorm" +import {OETH} from "./oeth.model" import {Vault} from "./vault.model" import {CurveLP} from "./curveLp.model" import {FraxStaking} from "./fraxStaking.model" @@ -22,6 +23,10 @@ export class FinancialStatement { @Column_("int4", {nullable: false}) blockNumber!: number + @Index_() + @ManyToOne_(() => OETH, {nullable: true}) + oeth!: OETH + @Index_() @ManyToOne_(() => Vault, {nullable: true}) vault!: Vault diff --git a/src/model/generated/index.ts b/src/model/generated/index.ts index 24ea7de2..b038b3bf 100644 --- a/src/model/generated/index.ts +++ b/src/model/generated/index.ts @@ -1,3 +1,4 @@ +export * from "./oeth.model" export * from "./address.model" export * from "./_rebasingOption" export * from "./history.model" diff --git a/src/model/generated/vault.model.ts b/src/model/generated/vault.model.ts index ceab9baa..d49b15c6 100644 --- a/src/model/generated/vault.model.ts +++ b/src/model/generated/vault.model.ts @@ -18,9 +18,6 @@ export class Vault { @Column_("int4", {nullable: false}) blockNumber!: number - @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) - eth!: bigint - @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) weth!: bigint diff --git a/src/processors/financial-statement/financial-statement.ts b/src/processors/financial-statement/financial-statement.ts index 88e01e66..3844f3b8 100644 --- a/src/processors/financial-statement/financial-statement.ts +++ b/src/processors/financial-statement/financial-statement.ts @@ -6,6 +6,7 @@ import { FinancialStatement, FraxStaking, MorphoAave, + OETH, Vault, } from '../../model' import { Context } from '../../processor' @@ -24,7 +25,7 @@ export const updateFinancialStatement = async ( partial: Partial< Pick< FinancialStatement, - 'vault' | 'curveLP' | 'dripper' | 'fraxStaking' | 'morphoAave' + 'oeth' | 'vault' | 'curveLP' | 'dripper' | 'fraxStaking' | 'morphoAave' > >, ) => { @@ -44,7 +45,7 @@ export const updateFinancialStatement = async ( fraxStaking: true, }, }) - + let financialStatement: FinancialStatement if (!lastFinancialStatement) { financialStatement = new FinancialStatement({ @@ -99,7 +100,6 @@ export const updateFinancialStatement = async ( id: timestampId, timestamp, blockNumber, - eth: 0n, weth: 0n, frxETH: 0n, rETH: 0n, @@ -107,6 +107,15 @@ export const updateFinancialStatement = async ( }) await ctx.store.insert(financialStatement.vault) } + if (!financialStatement.oeth) { + financialStatement.oeth = new OETH({ + id: timestampId, + timestamp, + blockNumber, + totalSupply: 0n, + }) + await ctx.store.insert(financialStatement.oeth) + } } else { financialStatement = financialStatements.get(timestampId) ?? diff --git a/src/processors/oeth/oeth.ts b/src/processors/oeth/oeth.ts index d702f109..9e492a21 100644 --- a/src/processors/oeth/oeth.ts +++ b/src/processors/oeth/oeth.ts @@ -5,8 +5,10 @@ import * as oeth from '../../abi/oeth' import { APY, Address, + CurveLP, History, HistoryType, + OETH, Rebase, RebaseOption, RebasingOption, @@ -14,6 +16,8 @@ import { import { Context } from '../../processor' import { ADDRESS_ZERO, OETH_ADDRESS } from '../../utils/addresses' import { DECIMALS_18 } from '../../utils/constants' +import { updateFinancialStatement } from '../financial-statement' +import { getLatestEntity } from '../utils' import { createAddress, createRebaseAPY } from './utils' export const from = 16933090 // https://etherscan.io/tx/0x3b4ece4f5fef04bf7ceaec4f6c6edf700540d7597589f8da0e3a8c94264a3b50 @@ -40,6 +44,7 @@ export const setup = (processor: EvmBatchProcessor) => { interface ProcessResult { initialized: boolean initialize: () => Promise + oeths: OETH[] history: History[] rebases: Rebase[] rebaseOptions: RebaseOption[] @@ -58,6 +63,7 @@ export const process = async (ctx: Context) => { .find(Address) .then((q) => new Map(q.map((i) => [i.id, i]))) }, + oeths: [], history: [], rebases: [], rebaseOptions: [], @@ -81,6 +87,7 @@ export const process = async (ctx: Context) => { await ctx.store.upsert([...result.owners.values()]) } await ctx.store.upsert(result.apies) + await ctx.store.insert(result.oeths) await ctx.store.insert(result.history) await ctx.store.insert(result.rebases) await ctx.store.insert(result.rebaseOptions) @@ -155,6 +162,28 @@ const processTotalSupplyUpdatedHighres = async ( if (log.topics[0] === oeth.events.TotalSupplyUpdatedHighres.topic) { await result.initialize() const data = oeth.events.TotalSupplyUpdatedHighres.decode(log) + // OETH Object + const timestampId = new Date(block.header.timestamp).toISOString() + const { latest, current } = await getLatestEntity( + ctx, + OETH, + result.oeths, + timestampId, + ) + + let oethObject = current + if (!oethObject) { + oethObject = new CurveLP({ + id: timestampId, + timestamp: new Date(block.header.timestamp), + blockNumber: block.header.height, + totalSupply: latest?.totalSupply ?? 0n, + }) + result.oeths.push(oethObject) + await updateFinancialStatement(ctx, block, { oeth: oethObject }) + } + oethObject.totalSupply = data.totalSupply + // Rebase events let rebase = createRebaseAPY(ctx, result.apies, block, log, data) for (const address of result.owners.values()) { diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts index 66808fd6..9ce1f25d 100644 --- a/src/processors/vault/vault.ts +++ b/src/processors/vault/vault.ts @@ -38,12 +38,6 @@ export const setup = (processor: EvmBatchProcessor) => { address: [STETH_ADDRESS], topic0: [stEth.events.TokenRebased.topic], }) - processor.addTransaction({ - from: [OETH_VAULT_ADDRESS], - }) - processor.addTransaction({ - to: [OETH_VAULT_ADDRESS], - }) } export const process = async (ctx: Context) => { @@ -52,13 +46,6 @@ export const process = async (ctx: Context) => { } for (const block of ctx.blocks) { - const transaction = block.transactions.find( - (t) => t.from === OETH_VAULT_ADDRESS || t.to === OETH_VAULT_ADDRESS, - ) - if (transaction) { - // We only want to do this once per block. - await updateETHBalance(ctx, result, block) - } for (const log of block.logs) { await processTransfer(ctx, result, block, log) await processStEthRebase(ctx, result, block, log) @@ -68,29 +55,6 @@ export const process = async (ctx: Context) => { await ctx.store.insert(result.vaults) } -const updateETHBalance = async ( - ctx: Context, - result: ProcessResult, - block: Context['blocks']['0'], -) => { - ctx.log.info('vault: updating eth balance') - const [{ vault, isNew }, eth] = await Promise.all([ - getLatestVault(ctx, result, block, { - skipFinancialStatementUpdate: true, - }), - getEthBalance(ctx, OETH_VAULT_ADDRESS, block), - ]) - if (vault.eth === eth) { - // Nothing to do, remove the new vault record if we created one. - if (isNew) { - result.vaults.pop() - } - } else { - vault.eth = eth - await updateFinancialStatement(ctx, block, { vault }) - } -} - const processStEthRebase = async ( ctx: Context, result: ProcessResult, @@ -155,7 +119,6 @@ const getLatestVault = async ( id: timestampId, timestamp: new Date(block.header.timestamp), blockNumber: block.header.height, - eth: latest?.eth ?? 0n, weth: latest?.weth ?? 0n, rETH: latest?.rETH ?? 0n, stETH: latest?.stETH ?? 0n, From fd13ea5f84d29f997e93792c4ca76e4aecb566d5 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Tue, 26 Sep 2023 17:43:36 -0700 Subject: [PATCH 27/31] fix --- src/processors/financial-statement/financial-statement.ts | 1 + src/processors/oeth/oeth.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/processors/financial-statement/financial-statement.ts b/src/processors/financial-statement/financial-statement.ts index 3844f3b8..b5e70658 100644 --- a/src/processors/financial-statement/financial-statement.ts +++ b/src/processors/financial-statement/financial-statement.ts @@ -38,6 +38,7 @@ export const updateFinancialStatement = async ( where: { id: LessThan(timestampId) }, order: { id: 'desc' }, relations: { + oeth: true, vault: true, morphoAave: true, dripper: true, diff --git a/src/processors/oeth/oeth.ts b/src/processors/oeth/oeth.ts index 9e492a21..4017e80e 100644 --- a/src/processors/oeth/oeth.ts +++ b/src/processors/oeth/oeth.ts @@ -162,6 +162,7 @@ const processTotalSupplyUpdatedHighres = async ( if (log.topics[0] === oeth.events.TotalSupplyUpdatedHighres.topic) { await result.initialize() const data = oeth.events.TotalSupplyUpdatedHighres.decode(log) + // OETH Object const timestampId = new Date(block.header.timestamp).toISOString() const { latest, current } = await getLatestEntity( From d6328822a411a2860e67e52166d48fd992dcf82c Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Tue, 26 Sep 2023 17:51:42 -0700 Subject: [PATCH 28/31] fix --- src/processors/oeth/oeth.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/processors/oeth/oeth.ts b/src/processors/oeth/oeth.ts index 4017e80e..d9b867e3 100644 --- a/src/processors/oeth/oeth.ts +++ b/src/processors/oeth/oeth.ts @@ -5,7 +5,6 @@ import * as oeth from '../../abi/oeth' import { APY, Address, - CurveLP, History, HistoryType, OETH, @@ -162,7 +161,7 @@ const processTotalSupplyUpdatedHighres = async ( if (log.topics[0] === oeth.events.TotalSupplyUpdatedHighres.topic) { await result.initialize() const data = oeth.events.TotalSupplyUpdatedHighres.decode(log) - + // OETH Object const timestampId = new Date(block.header.timestamp).toISOString() const { latest, current } = await getLatestEntity( @@ -174,7 +173,7 @@ const processTotalSupplyUpdatedHighres = async ( let oethObject = current if (!oethObject) { - oethObject = new CurveLP({ + oethObject = new OETH({ id: timestampId, timestamp: new Date(block.header.timestamp), blockNumber: block.header.height, From e880d51853253d73a9cc01bc9dc51c4dc50012ac Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Tue, 26 Sep 2023 19:36:19 -0700 Subject: [PATCH 29/31] missed --- src/model/generated/oeth.model.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/model/generated/oeth.model.ts diff --git a/src/model/generated/oeth.model.ts b/src/model/generated/oeth.model.ts new file mode 100644 index 00000000..ee84fcf1 --- /dev/null +++ b/src/model/generated/oeth.model.ts @@ -0,0 +1,23 @@ +import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm" +import * as marshal from "./marshal" + +@Entity_() +export class OETH { + constructor(props?: Partial) { + Object.assign(this, props) + } + + @PrimaryColumn_() + id!: string + + @Index_() + @Column_("timestamp with time zone", {nullable: false}) + timestamp!: Date + + @Index_() + @Column_("int4", {nullable: false}) + blockNumber!: number + + @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) + totalSupply!: bigint +} From c1edb0fb7c8339939a907becb85f9d84ef74ed12 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Tue, 26 Sep 2023 21:00:57 -0700 Subject: [PATCH 30/31] attempt to fix, but still no good --- ...74521380-Data.js => 1695785490114-Data.js} | 4 ++-- .../financial-statement.ts | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) rename db/migrations/{1695774521380-Data.js => 1695785490114-Data.js} (99%) diff --git a/db/migrations/1695774521380-Data.js b/db/migrations/1695785490114-Data.js similarity index 99% rename from db/migrations/1695774521380-Data.js rename to db/migrations/1695785490114-Data.js index c8a0ea1d..ad31467e 100644 --- a/db/migrations/1695774521380-Data.js +++ b/db/migrations/1695785490114-Data.js @@ -1,5 +1,5 @@ -module.exports = class Data1695774521380 { - name = 'Data1695774521380' +module.exports = class Data1695785490114 { + name = 'Data1695785490114' async up(db) { await db.query(`CREATE TABLE "oeth" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "total_supply" numeric NOT NULL, CONSTRAINT "PK_de1d885501070dbd1ab6f8577ba" PRIMARY KEY ("id"))`) diff --git a/src/processors/financial-statement/financial-statement.ts b/src/processors/financial-statement/financial-statement.ts index b5e70658..ad23e63a 100644 --- a/src/processors/financial-statement/financial-statement.ts +++ b/src/processors/financial-statement/financial-statement.ts @@ -117,16 +117,17 @@ export const updateFinancialStatement = async ( }) await ctx.store.insert(financialStatement.oeth) } + } else if (financialStatements.has(timestampId)) { + financialStatement = financialStatements.get(timestampId)! + Object.assign(financialStatement, partial) } else { - financialStatement = - financialStatements.get(timestampId) ?? - new FinancialStatement({ - ...lastFinancialStatement, - id: timestampId, - timestamp, - blockNumber, - ...partial, - }) + financialStatement = new FinancialStatement({ + ...lastFinancialStatement, + id: timestampId, + timestamp, + blockNumber, + ...partial, + }) } financialStatements.set(timestampId, financialStatement) From c2f2fed0d5e2f479aa237b730d5f87d7038140e5 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Wed, 27 Sep 2023 11:25:49 -0700 Subject: [PATCH 31/31] remove FinancialStatement and defer logic to the view --- ...85490114-Data.js => 1695839072092-Data.js} | 34 +---- schema.graphql | 12 -- src/main.ts | 3 +- .../generated/financialStatement.model.ts | 49 ------ src/model/generated/index.ts | 1 - src/processors/curve-lp/curve-lp.ts | 10 +- src/processors/dripper/dripper.ts | 2 - .../financial-statement.ts | 139 ------------------ src/processors/financial-statement/index.ts | 1 - src/processors/frax-staking/frax-staking.ts | 2 - src/processors/morpho-aave/morpho-aave.ts | 2 - src/processors/oeth/oeth.ts | 2 - src/processors/vault/vault.ts | 6 - 13 files changed, 4 insertions(+), 259 deletions(-) rename db/migrations/{1695785490114-Data.js => 1695839072092-Data.js} (71%) delete mode 100644 src/model/generated/financialStatement.model.ts delete mode 100644 src/processors/financial-statement/financial-statement.ts delete mode 100644 src/processors/financial-statement/index.ts diff --git a/db/migrations/1695785490114-Data.js b/db/migrations/1695839072092-Data.js similarity index 71% rename from db/migrations/1695785490114-Data.js rename to db/migrations/1695839072092-Data.js index ad31467e..daa92e53 100644 --- a/db/migrations/1695785490114-Data.js +++ b/db/migrations/1695839072092-Data.js @@ -1,5 +1,5 @@ -module.exports = class Data1695785490114 { - name = 'Data1695785490114' +module.exports = class Data1695839072092 { + name = 'Data1695839072092' async up(db) { await db.query(`CREATE TABLE "oeth" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "total_supply" numeric NOT NULL, CONSTRAINT "PK_de1d885501070dbd1ab6f8577ba" PRIMARY KEY ("id"))`) @@ -39,24 +39,9 @@ module.exports = class Data1695785490114 { await db.query(`CREATE TABLE "dripper" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "weth" numeric NOT NULL, CONSTRAINT "PK_74fd102c8d1c60f4b1650a61ffc" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_88c58f8948c3294c2a9e2791dc" ON "dripper" ("timestamp") `) await db.query(`CREATE INDEX "IDX_06822c0a260797711acc9023d5" ON "dripper" ("block_number") `) - await db.query(`CREATE TABLE "financial_statement" ("id" character varying NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "oeth_id" character varying, "vault_id" character varying, "curve_lp_id" character varying, "frax_staking_id" character varying, "morpho_aave_id" character varying, "dripper_id" character varying, CONSTRAINT "PK_4e795d12a43006ece4788e13371" PRIMARY KEY ("id"))`) - await db.query(`CREATE INDEX "IDX_ef18e864908765e31b7232fe41" ON "financial_statement" ("timestamp") `) - await db.query(`CREATE INDEX "IDX_0b50f0a8fca1f65659ce36feb4" ON "financial_statement" ("block_number") `) - await db.query(`CREATE INDEX "IDX_d331341d76e723609791afdb3a" ON "financial_statement" ("oeth_id") `) - await db.query(`CREATE INDEX "IDX_9f37653694923d2b62c6c01190" ON "financial_statement" ("vault_id") `) - await db.query(`CREATE INDEX "IDX_4b9b21bbd516414896d4afed7f" ON "financial_statement" ("curve_lp_id") `) - await db.query(`CREATE INDEX "IDX_b5c2c4b2d43680e3c6470d7f9d" ON "financial_statement" ("frax_staking_id") `) - await db.query(`CREATE INDEX "IDX_a610e78431c0dd56724129f223" ON "financial_statement" ("morpho_aave_id") `) - await db.query(`CREATE INDEX "IDX_7a506ebb6c720f35607810b734" ON "financial_statement" ("dripper_id") `) await db.query(`ALTER TABLE "history" ADD CONSTRAINT "FK_59a55adcc59ddb69c297da693e5" FOREIGN KEY ("address_id") REFERENCES "address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "rebase" ADD CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2" FOREIGN KEY ("apy_id") REFERENCES "apy"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) await db.query(`ALTER TABLE "rebase_option" ADD CONSTRAINT "FK_66c04aee6855c74debae4add8fe" FOREIGN KEY ("address_id") REFERENCES "address"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) - await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_d331341d76e723609791afdb3a1" FOREIGN KEY ("oeth_id") REFERENCES "oeth"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) - await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_9f37653694923d2b62c6c01190b" FOREIGN KEY ("vault_id") REFERENCES "vault"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) - await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_4b9b21bbd516414896d4afed7fe" FOREIGN KEY ("curve_lp_id") REFERENCES "curve_lp"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) - await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_b5c2c4b2d43680e3c6470d7f9df" FOREIGN KEY ("frax_staking_id") REFERENCES "frax_staking"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) - await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_a610e78431c0dd56724129f2236" FOREIGN KEY ("morpho_aave_id") REFERENCES "morpho_aave"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) - await db.query(`ALTER TABLE "financial_statement" ADD CONSTRAINT "FK_7a506ebb6c720f35607810b7347" FOREIGN KEY ("dripper_id") REFERENCES "dripper"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) } async down(db) { @@ -97,23 +82,8 @@ module.exports = class Data1695785490114 { await db.query(`DROP TABLE "dripper"`) await db.query(`DROP INDEX "public"."IDX_88c58f8948c3294c2a9e2791dc"`) await db.query(`DROP INDEX "public"."IDX_06822c0a260797711acc9023d5"`) - await db.query(`DROP TABLE "financial_statement"`) - await db.query(`DROP INDEX "public"."IDX_ef18e864908765e31b7232fe41"`) - await db.query(`DROP INDEX "public"."IDX_0b50f0a8fca1f65659ce36feb4"`) - await db.query(`DROP INDEX "public"."IDX_d331341d76e723609791afdb3a"`) - await db.query(`DROP INDEX "public"."IDX_9f37653694923d2b62c6c01190"`) - await db.query(`DROP INDEX "public"."IDX_4b9b21bbd516414896d4afed7f"`) - await db.query(`DROP INDEX "public"."IDX_b5c2c4b2d43680e3c6470d7f9d"`) - await db.query(`DROP INDEX "public"."IDX_a610e78431c0dd56724129f223"`) - await db.query(`DROP INDEX "public"."IDX_7a506ebb6c720f35607810b734"`) await db.query(`ALTER TABLE "history" DROP CONSTRAINT "FK_59a55adcc59ddb69c297da693e5"`) await db.query(`ALTER TABLE "rebase" DROP CONSTRAINT "FK_02d02f9022ef86e60f1a84b9dc2"`) await db.query(`ALTER TABLE "rebase_option" DROP CONSTRAINT "FK_66c04aee6855c74debae4add8fe"`) - await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_d331341d76e723609791afdb3a1"`) - await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_9f37653694923d2b62c6c01190b"`) - await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_4b9b21bbd516414896d4afed7fe"`) - await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_b5c2c4b2d43680e3c6470d7f9df"`) - await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_a610e78431c0dd56724129f2236"`) - await db.query(`ALTER TABLE "financial_statement" DROP CONSTRAINT "FK_7a506ebb6c720f35607810b7347"`) } } diff --git a/schema.graphql b/schema.graphql index 4416134d..37e7ff79 100644 --- a/schema.graphql +++ b/schema.graphql @@ -72,18 +72,6 @@ type APY @entity { rebasingCreditsPerToken: BigInt! } -type FinancialStatement @entity { - id: ID! - timestamp: DateTime! @index - blockNumber: Int! @index - oeth: OETH! - vault: Vault! - curveLP: CurveLP! - fraxStaking: FraxStaking! - morphoAave: MorphoAave! - dripper: Dripper! -} - # OETH Vault: 0x39254033945AA2E4809Cc2977E7087BEE48bd7Ab type Vault @entity { id: ID! diff --git a/src/main.ts b/src/main.ts index 843a92dd..bf711675 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,6 @@ import { run } from './processor' import * as curveLp from './processors/curve-lp' import * as dripper from './processors/dripper' -import * as financialStatement from './processors/financial-statement' import * as fraxStaking from './processors/frax-staking' import * as morphoAave from './processors/morpho-aave' import * as oeth from './processors/oeth' @@ -11,5 +10,5 @@ run({ // The idea is that these processors have zero dependencies on one another and can be processed asynchronously. processors: [oeth, vault, fraxStaking, morphoAave, dripper, curveLp], // For processors which depend on results from other processors, post processors run after all processors have finished. - postProcessors: [financialStatement], + postProcessors: [], }) diff --git a/src/model/generated/financialStatement.model.ts b/src/model/generated/financialStatement.model.ts deleted file mode 100644 index e98fb436..00000000 --- a/src/model/generated/financialStatement.model.ts +++ /dev/null @@ -1,49 +0,0 @@ -import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_, ManyToOne as ManyToOne_} from "typeorm" -import {OETH} from "./oeth.model" -import {Vault} from "./vault.model" -import {CurveLP} from "./curveLp.model" -import {FraxStaking} from "./fraxStaking.model" -import {MorphoAave} from "./morphoAave.model" -import {Dripper} from "./dripper.model" - -@Entity_() -export class FinancialStatement { - constructor(props?: Partial) { - Object.assign(this, props) - } - - @PrimaryColumn_() - id!: string - - @Index_() - @Column_("timestamp with time zone", {nullable: false}) - timestamp!: Date - - @Index_() - @Column_("int4", {nullable: false}) - blockNumber!: number - - @Index_() - @ManyToOne_(() => OETH, {nullable: true}) - oeth!: OETH - - @Index_() - @ManyToOne_(() => Vault, {nullable: true}) - vault!: Vault - - @Index_() - @ManyToOne_(() => CurveLP, {nullable: true}) - curveLP!: CurveLP - - @Index_() - @ManyToOne_(() => FraxStaking, {nullable: true}) - fraxStaking!: FraxStaking - - @Index_() - @ManyToOne_(() => MorphoAave, {nullable: true}) - morphoAave!: MorphoAave - - @Index_() - @ManyToOne_(() => Dripper, {nullable: true}) - dripper!: Dripper -} diff --git a/src/model/generated/index.ts b/src/model/generated/index.ts index b038b3bf..eda24cf2 100644 --- a/src/model/generated/index.ts +++ b/src/model/generated/index.ts @@ -6,7 +6,6 @@ export * from "./_historyType" export * from "./rebase.model" export * from "./rebaseOption.model" export * from "./apy.model" -export * from "./financialStatement.model" export * from "./vault.model" export * from "./curveLp.model" export * from "./fraxStaking.model" diff --git a/src/processors/curve-lp/curve-lp.ts b/src/processors/curve-lp/curve-lp.ts index 3f856926..45df2018 100644 --- a/src/processors/curve-lp/curve-lp.ts +++ b/src/processors/curve-lp/curve-lp.ts @@ -11,7 +11,6 @@ import { OETH_CURVE_LP_OWNER_ADDRESS, } from '../../utils/addresses' import { getEthBalance } from '../../utils/getEthBalance' -import { updateFinancialStatement } from '../financial-statement' import { getLatestEntity, trackAddressBalances } from '../utils' interface ProcessResult { @@ -105,9 +104,7 @@ const updateETHBalance = async ( ) => { const [eth, { curveLP, isNew }] = await Promise.all([ getEthBalance(ctx, OETH_CURVE_LP_ADDRESS, block), - getLatestCurveLP(ctx, result, block, { - skipFinancialStatementUpdate: true, - }), + getLatestCurveLP(ctx, result, block), ]) if (curveLP.eth === eth) { // No change, let's cancel what we're doing. @@ -116,7 +113,6 @@ const updateETHBalance = async ( } return } - await updateFinancialStatement(ctx, block, { curveLP }) curveLP.eth = eth curveLP.ethOwned = curveLP.totalSupply ? (curveLP.eth * curveLP.totalSupplyOwned) / curveLP.totalSupply @@ -205,7 +201,6 @@ const getLatestCurveLP = async ( ctx: Context, result: ProcessResult, block: Context['blocks']['0'], - options?: { skipFinancialStatementUpdate: boolean }, ) => { const timestampId = new Date(block.header.timestamp).toISOString() const { latest, current } = await getLatestEntity( @@ -230,9 +225,6 @@ const getLatestCurveLP = async ( oethOwned: latest?.oethOwned ?? 0n, }) result.curveLPs.push(curveLP) - if (!options?.skipFinancialStatementUpdate) { - await updateFinancialStatement(ctx, block, { curveLP }) - } isNew = true } return { curveLP, isNew } diff --git a/src/processors/dripper/dripper.ts b/src/processors/dripper/dripper.ts index 1e1fdde2..c1f26222 100644 --- a/src/processors/dripper/dripper.ts +++ b/src/processors/dripper/dripper.ts @@ -5,7 +5,6 @@ import * as erc20 from '../../abi/erc20' import { Dripper } from '../../model' import { Context } from '../../processor' import { OETH_DRIPPER_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' -import { updateFinancialStatement } from '../financial-statement' import { getLatestEntity, trackAddressBalances } from '../utils' interface ProcessResult { @@ -70,7 +69,6 @@ const processTransfer = async ( weth: latest?.weth ?? 0n, }) result.drippers.push(dripper) - await updateFinancialStatement(ctx, block, { dripper }) } dripper.weth += change diff --git a/src/processors/financial-statement/financial-statement.ts b/src/processors/financial-statement/financial-statement.ts deleted file mode 100644 index ad23e63a..00000000 --- a/src/processors/financial-statement/financial-statement.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { LessThan, LessThanOrEqual } from 'typeorm' - -import { - CurveLP, - Dripper, - FinancialStatement, - FraxStaking, - MorphoAave, - OETH, - Vault, -} from '../../model' -import { Context } from '../../processor' -import { useProcessorState } from '../../utils/state' - -export const useFinancialStatements = () => { - return useProcessorState>( - 'financial-statement', - new Map(), - ) -} - -export const updateFinancialStatement = async ( - ctx: Context, - block: Context['blocks']['0'], - partial: Partial< - Pick< - FinancialStatement, - 'oeth' | 'vault' | 'curveLP' | 'dripper' | 'fraxStaking' | 'morphoAave' - > - >, -) => { - const timestamp = new Date(block.header.timestamp) - const timestampId = timestamp.toISOString() - const blockNumber = block.header.height - const [financialStatements] = useFinancialStatements() - - const lastFinancialStatement = await ctx.store.findOne(FinancialStatement, { - where: { id: LessThan(timestampId) }, - order: { id: 'desc' }, - relations: { - oeth: true, - vault: true, - morphoAave: true, - dripper: true, - curveLP: true, - fraxStaking: true, - }, - }) - - let financialStatement: FinancialStatement - if (!lastFinancialStatement) { - financialStatement = new FinancialStatement({ - id: timestampId, - timestamp, - blockNumber, - ...partial, - }) - if (!financialStatement.curveLP) { - financialStatement.curveLP = new CurveLP({ - id: timestampId, - timestamp, - blockNumber, - eth: 0n, - ethOwned: 0n, - oeth: 0n, - oethOwned: 0n, - totalSupply: 0n, - totalSupplyOwned: 0n, - }) - await ctx.store.insert(financialStatement.curveLP) - } - if (!financialStatement.fraxStaking) { - financialStatement.fraxStaking = new FraxStaking({ - id: timestampId, - timestamp, - blockNumber, - frxETH: 0n, - }) - await ctx.store.insert(financialStatement.fraxStaking) - } - if (!financialStatement.dripper) { - financialStatement.dripper = new Dripper({ - id: timestampId, - timestamp, - blockNumber, - weth: 0n, - }) - await ctx.store.insert(financialStatement.dripper) - } - if (!financialStatement.morphoAave) { - financialStatement.morphoAave = new MorphoAave({ - id: timestampId, - timestamp, - blockNumber, - weth: 0n, - }) - await ctx.store.insert(financialStatement.morphoAave) - } - if (!financialStatement.vault) { - financialStatement.vault = new Vault({ - id: timestampId, - timestamp, - blockNumber, - weth: 0n, - frxETH: 0n, - rETH: 0n, - stETH: 0n, - }) - await ctx.store.insert(financialStatement.vault) - } - if (!financialStatement.oeth) { - financialStatement.oeth = new OETH({ - id: timestampId, - timestamp, - blockNumber, - totalSupply: 0n, - }) - await ctx.store.insert(financialStatement.oeth) - } - } else if (financialStatements.has(timestampId)) { - financialStatement = financialStatements.get(timestampId)! - Object.assign(financialStatement, partial) - } else { - financialStatement = new FinancialStatement({ - ...lastFinancialStatement, - id: timestampId, - timestamp, - blockNumber, - ...partial, - }) - } - - financialStatements.set(timestampId, financialStatement) -} - -export const process = async (ctx: Context) => { - const [financialStatements] = useFinancialStatements() - await ctx.store.upsert([...financialStatements.values()]) -} diff --git a/src/processors/financial-statement/index.ts b/src/processors/financial-statement/index.ts deleted file mode 100644 index 1febb7b2..00000000 --- a/src/processors/financial-statement/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './financial-statement' diff --git a/src/processors/frax-staking/frax-staking.ts b/src/processors/frax-staking/frax-staking.ts index d4b6c4eb..8c775133 100644 --- a/src/processors/frax-staking/frax-staking.ts +++ b/src/processors/frax-staking/frax-staking.ts @@ -8,7 +8,6 @@ import { OETH_FRAX_STAKING_ADDRESS, SFRXETH_ADDRESS, } from '../../utils/addresses' -import { updateFinancialStatement } from '../financial-statement' import { getLatestEntity, trackAddressBalances } from '../utils' interface ProcessResult { @@ -73,7 +72,6 @@ const processTransfer = async ( frxETH: latest?.frxETH ?? 0n, }) result.fraxStakings.push(fraxStaking) - await updateFinancialStatement(ctx, block, { fraxStaking }) } fraxStaking.frxETH += change diff --git a/src/processors/morpho-aave/morpho-aave.ts b/src/processors/morpho-aave/morpho-aave.ts index a6d37c6f..51629e88 100644 --- a/src/processors/morpho-aave/morpho-aave.ts +++ b/src/processors/morpho-aave/morpho-aave.ts @@ -5,7 +5,6 @@ import * as erc20 from '../../abi/erc20' import { MorphoAave } from '../../model' import { Context } from '../../processor' import { OETH_MORPHO_AAVE_ADDRESS, WETH_ADDRESS } from '../../utils/addresses' -import { updateFinancialStatement } from '../financial-statement' import { getLatestEntity, trackAddressBalances } from '../utils' interface ProcessResult { @@ -70,7 +69,6 @@ const processTransfer = async ( weth: latest?.weth ?? 0n, }) result.morphoAaves.push(morphoAave) - await updateFinancialStatement(ctx, block, { morphoAave }) } morphoAave.weth += change diff --git a/src/processors/oeth/oeth.ts b/src/processors/oeth/oeth.ts index d9b867e3..eed1b429 100644 --- a/src/processors/oeth/oeth.ts +++ b/src/processors/oeth/oeth.ts @@ -15,7 +15,6 @@ import { import { Context } from '../../processor' import { ADDRESS_ZERO, OETH_ADDRESS } from '../../utils/addresses' import { DECIMALS_18 } from '../../utils/constants' -import { updateFinancialStatement } from '../financial-statement' import { getLatestEntity } from '../utils' import { createAddress, createRebaseAPY } from './utils' @@ -180,7 +179,6 @@ const processTotalSupplyUpdatedHighres = async ( totalSupply: latest?.totalSupply ?? 0n, }) result.oeths.push(oethObject) - await updateFinancialStatement(ctx, block, { oeth: oethObject }) } oethObject.totalSupply = data.totalSupply diff --git a/src/processors/vault/vault.ts b/src/processors/vault/vault.ts index 9ce1f25d..d888f116 100644 --- a/src/processors/vault/vault.ts +++ b/src/processors/vault/vault.ts @@ -13,8 +13,6 @@ import { VAULT_ERC20_ADDRESSES, WETH_ADDRESS, } from '../../utils/addresses' -import { getEthBalance } from '../../utils/getEthBalance' -import { updateFinancialStatement } from '../financial-statement' import { getLatestEntity, trackAddressBalances } from '../utils' interface ProcessResult { @@ -103,7 +101,6 @@ const getLatestVault = async ( ctx: Context, result: ProcessResult, block: Context['blocks']['0'], - options?: { skipFinancialStatementUpdate: boolean }, ) => { let isNew = false const timestampId = new Date(block.header.timestamp).toISOString() @@ -126,9 +123,6 @@ const getLatestVault = async ( }) isNew = true result.vaults.push(vault) - if (!options?.skipFinancialStatementUpdate) { - await updateFinancialStatement(ctx, block, { vault }) - } } return { vault, isNew } }