@snapshot-labs/snapshot.js 0.3.49 → 0.3.52
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.
- package/dist/snapshot.cjs.js +5 -3
- package/dist/snapshot.esm.js +5 -3
- package/dist/snapshot.min.js +15 -5
- package/package.json +2 -1
- package/src/networks.json +1 -0
- package/src/utils.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@snapshot-labs/snapshot.js",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.52",
|
|
4
4
|
"repository": "snapshot-labs/snapshot.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/snapshot.cjs.js",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"browser": "dist/snapshot.min.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
+
"@ensdomains/eth-ens-namehash": "^2.0.15",
|
|
11
12
|
"@ethersproject/abi": "^5.0.4",
|
|
12
13
|
"@ethersproject/bytes": "^5.0.8",
|
|
13
14
|
"@ethersproject/contracts": "^5.0.3",
|
package/src/networks.json
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"user": "balancer_user",
|
|
13
13
|
"password": "balancerAnkr20201015"
|
|
14
14
|
},
|
|
15
|
+
"https://rpc.ankr.com/eth",
|
|
15
16
|
"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/eth/mainnet/archive",
|
|
16
17
|
"https://apis.ankr.com/e62bc219f9c9462b8749defe472d2dc5/6106d4a3ec1d1bcc87ec72158f8fd089/eth/archive/main",
|
|
17
18
|
"https://eth-archival.gateway.pokt.network/v1/5f76124fb90218002e9ce985",
|
package/src/utils.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fetch from 'cross-fetch';
|
|
2
2
|
import { Interface } from '@ethersproject/abi';
|
|
3
3
|
import { Contract } from '@ethersproject/contracts';
|
|
4
|
-
import {
|
|
4
|
+
import { hash, normalize } from '@ensdomains/eth-ens-namehash';
|
|
5
5
|
import { jsonToGraphQLQuery } from 'json-to-graphql-query';
|
|
6
6
|
import Ajv from 'ajv';
|
|
7
7
|
import addFormats from 'ajv-formats';
|
|
@@ -183,9 +183,9 @@ export function validateSchema(schema, data) {
|
|
|
183
183
|
|
|
184
184
|
export function getEnsTextRecord(ens: string, record: string, network = '1') {
|
|
185
185
|
const address = networks[network].ensResolver || networks['1'].ensResolver;
|
|
186
|
-
const
|
|
186
|
+
const ensHash = hash(normalize(ens));
|
|
187
187
|
const provider = getProvider(network);
|
|
188
|
-
return call(provider, ENS_RESOLVER_ABI, [address, 'text', [
|
|
188
|
+
return call(provider, ENS_RESOLVER_ABI, [address, 'text', [ensHash, record]]);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
export async function getSpaceUri(id, network = '1') {
|