@superfluid-finance/metadata 1.1.11-dev.a4baccf.0 → 1.1.11-dev.f6d4226.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +36 -45
  3. package/package.json +4 -6
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@ All notable changes to the metadata will be documented in this file.
3
3
 
4
4
  This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [Unreleased]
7
+
8
+ - Node dependency updates.
9
+
6
10
  ## [v1.1.10] - 2023-07-25
7
11
  - Fixed address of SuperTokenFactory for polygon-zkevm-testnet
8
12
 
package/README.md CHANGED
@@ -1,17 +1,13 @@
1
1
  # Superfluid Metadata
2
2
 
3
3
  Contains metadata around the Superfluid framework.
4
- The goal of this repository is to make it as easy as possible to reference contained metadata from various contexts (e.g. backend script or browser page) and independently of the tech stack used there. Convenience wrappers are provided for JS/TS, other environments can fall back to parsing plain JSON files.
5
-
6
- ## Making Changes
7
-
8
- When adding new changes (new addresses), add it to `networks.json` and make sure to run `./build.sh` before pushing so that both the list files in `main` and `module` are updated.
9
- If you are adding a new property, please also modify the .d.ts files in the module folder accordingly as well.
4
+ The goal of this package is to make it as easy as possible to reference contained metadata from various contexts (e.g. backend script or browser page) and independently of the tech stack used there. Convenience wrappers are provided for JS/TS, other environments can fall back to parsing plain JSON files, or autogenerate language specific representations.
10
5
 
11
6
  ## Networks
12
7
 
13
8
  List of EVM networks with the Superfluid protocol deployed.
14
- Example uses
9
+
10
+ Example uses:
15
11
 
16
12
  ### Use in an HTML page
17
13
 
@@ -20,7 +16,7 @@ You can of course also self-host a copy or use another service, anything signall
20
16
 
21
17
  ```html
22
18
  <script type="module">
23
- import networks from "https://cdn.jsdelivr.net/gh/superfluid-finance/metadata/module/networks/index.js";
19
+ import networks from "https://cdn.jsdelivr.net/npm/@superfluid-finance/metadata/module/networks/index.js";
24
20
  // example use
25
21
  const network = networks.getNetworkByChainId(networkId);
26
22
  ```
@@ -39,70 +35,55 @@ If that's the case, you can use the networks metadata like this:
39
35
  import sfMeta from "@superfluid-finance/metadata";
40
36
 
41
37
  // example use
42
- const network = sfMeta.getNetworkByName("eth-goerli");
38
+ const network = sfMeta.getNetworkByName("eth-sepolia");
43
39
  ```
44
40
 
45
41
  ### Use in a nodejs project using CommonJS (legacy)
46
42
 
47
- Nodejs projects still using CommonJS (if you're unsure, check [the docs](https://nodejs.org/api/packages.html#determining-module-system)), can use ES modules using the syntax of [dynamic imports](https://nodejs.org/api/esm.html#import-expressions):
48
- ```js
49
- import("@superfluid-finance/metadata").then(module => {
50
- const sfMeta = module;
51
-
52
- // example use
53
- const network = sfMeta.getNetworkByName("eth-goerli");
54
- }
55
- ```
56
-
57
- Alternative using await:
58
43
  ```js
59
- const sfMetaPromise = import("@superfluid-finance/metadata");
60
- (async () => {
61
- const sfMeta = (await sfMetaPromise).default;
44
+ const sfMeta = require("@superfluid-finance/metadata");
62
45
 
63
- // example use
64
- const network = sfMeta.getNetworkByName("eth-goerli");
46
+ // example use
47
+ const network = sfMeta.getNetworkByName("eth-sepolia");
65
48
  }
66
49
  ```
67
50
 
68
- ### Use in a node REPL:
69
-
70
- The repl uses CommonJS too, thus usage looks like this:
51
+ ### Use in a nodejs REPL:
71
52
 
72
53
  ```js
73
- let sfMeta
74
- import("@superfluid-finance/metadata").then(module => sfMeta = module)
54
+ > sfMeta = require("@superfluid-finance/metadata")
75
55
  > sfMeta.networks.length
76
- 12
56
+ 17
77
57
  > sfMeta.testnets.length
78
- 7
58
+ 8
79
59
  > sfMeta.mainnets.length
80
- 5
60
+ 9
81
61
  > sfMeta.mainnets.filter(n => n.nativeTokenSymbol === "ETH").map(n => n.name)
82
- [
83
- 'eth-goerli',
84
- 'optimism-goerli',
85
- 'arbitrum-goerli',
86
- 'optimism-mainnet',
87
- 'arbitrum-one'
88
- ]
89
- > m.getNetworkByChainId(10)
62
+ [ 'optimism-mainnet', 'arbitrum-one', 'eth-mainnet', 'base-mainnet' ]
63
+ > sfMeta.getNetworkByChainId(10)
90
64
  {
91
65
  name: 'optimism-mainnet',
92
66
  isTestnet: false,
93
67
  networkId: 10,
94
68
  chainId: 10,
95
69
  shortName: 'optimism',
70
+ uppercaseName: 'OPTIMISM_MAINNET',
71
+ humanReadableName: 'Optimism',
96
72
  nativeTokenSymbol: 'ETH',
73
+ nativeTokenWrapper: '0x4ac8bD1bDaE47beeF2D1c6Aa62229509b962Aa0d',
97
74
  contractsV1: {
98
75
  resolver: '0x743B5f46BC86caF41bE4956d9275721E0531B186',
99
76
  host: '0x567c4B141ED61923967cA25Ef4906C8781069a10',
100
77
  governance: '0x0170FFCC75d178d426EBad5b1a31451d00Ddbd0D',
101
78
  cfaV1: '0x204C6f131bb7F258b2Ea1593f5309911d8E458eD',
79
+ cfaV1Forwarder: '0xcfA132E353cB4E398080B9700609bb008eceB125',
102
80
  idaV1: '0xc4ce5118C3B20950ee288f086cb7FC166d222D4c',
103
81
  superTokenFactory: '0x8276469A443D5C6B7146BED45e2abCaD3B6adad9',
104
82
  superfluidLoader: '0x8E310ce29Ab7Fa2878944A65BB0eaF97B1853d40',
105
- toga: '0xA3c8502187fD7a7118eAD59dc811281448946C8f'
83
+ toga: '0xA3c8502187fD7a7118eAD59dc811281448946C8f',
84
+ batchLiquidator: '0x36Df169DBf5CE3c6f58D46f0addeF58F01381232',
85
+ flowScheduler: '0x55c8fc400833eEa791087cF343Ff2409A39DeBcC',
86
+ vestingScheduler: '0x65377d4dfE9c01639A41952B5083D58964782892'
106
87
  },
107
88
  startBlockV1: 4300000,
108
89
  logsQueryRange: 50000,
@@ -110,14 +91,18 @@ import("@superfluid-finance/metadata").then(module => sfMeta = module)
110
91
  subgraphV1: {
111
92
  name: 'protocol-v1-optimism-mainnet',
112
93
  hostedEndpoint: 'https://api.thegraph.com/subgraphs/name/superfluid-finance/protocol-v1-optimism-mainnet'
113
- }
94
+ },
95
+ publicRPCs: [ 'https://mainnet.optimism.io', 'https://rpc.ankr.com/optimism' ],
96
+ coinGeckoId: 'optimistic-ethereum'
114
97
  }
98
+
115
99
  ```
116
100
 
117
101
  ### Use in a bash script
118
102
 
119
103
  With the help of [jq](https://jqlang.github.io/jq/), it's also possible to parse metadata from within a bash script.
120
- Here's an example:
104
+ Here's an example for a script which iterates through all testnets and prints the addresses of the host contract and of the
105
+ native token wrapper to the console:
121
106
 
122
107
  ```sh
123
108
  #!/bin/bash
@@ -125,7 +110,7 @@ Here's an example:
125
110
  # exit on error or undefined var
126
111
  set -eu
127
112
 
128
- metadata=$(curl -f -s "https://raw.githubusercontent.com/superfluid-finance/metadata/master/networks.json")
113
+ metadata=$(curl -f -s "https://raw.githubusercontent.com/superfluid-finance/protocol-monorepo/dev/packages/metadata/networks.json")
129
114
  testnets=$(echo "$metadata" | jq -r '.[] | select(.isTestnet == false).name')
130
115
 
131
116
  for network in $testnets; do
@@ -135,3 +120,9 @@ for network in $testnets; do
135
120
  echo "$network | host address: $host, native token wrapper address: $native_token_wrapper"
136
121
  done
137
122
  ```
123
+
124
+ ### Making Changes
125
+
126
+ When changing the metadata of a network or adding/remoing a network, only modify `networks.json` and then run `./build.sh`.
127
+ This updates the autogenerated files derived from that json file.
128
+ If you add a new property, also modify the .d.ts files in the module folder accordingly.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superfluid-finance/metadata",
3
- "version": "1.1.11-dev.a4baccf.0",
3
+ "version": "1.1.11-dev.f6d4226.0",
4
4
  "description": "Superfluid Metadata",
5
5
  "main": "main/index.cjs",
6
6
  "module": "module/index.js",
@@ -23,12 +23,10 @@
23
23
  "lint": "run-s lint:*",
24
24
  "lint:js-eslint": "eslint . --max-warnings=0 --report-unused-disable-directives && echo '✔ Your .js files look good.'",
25
25
  "fix": "run-s fix:*",
26
- "fix:eslint": "yarn lint:js-eslint --fix"
26
+ "fix:eslint": "yarn lint:js-eslint --fix",
27
+ "check-updates": "ncu --target minor"
27
28
  },
28
29
  "author": "Superfluid",
29
30
  "license": "MIT",
30
- "homepage": "https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/metadata#readme",
31
- "devDependencies": {
32
- "@netlify/functions": "^1.2.0"
33
- }
31
+ "homepage": "https://github.com/superfluid-finance/protocol-monorepo/tree/dev/packages/metadata#readme"
34
32
  }