@snapshot-labs/snapshot.js 0.3.48 → 0.3.50

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.
@@ -4,13 +4,14 @@ var fetch = require('cross-fetch');
4
4
  var bytes = require('@ethersproject/bytes');
5
5
  var abi = require('@ethersproject/abi');
6
6
  var contracts = require('@ethersproject/contracts');
7
- var hash = require('@ethersproject/hash');
7
+ var ethEnsNamehash = require('@ensdomains/eth-ens-namehash');
8
8
  var jsonToGraphqlQuery = require('json-to-graphql-query');
9
9
  var Ajv = require('ajv');
10
10
  var addFormats = require('ajv-formats');
11
11
  var set = require('lodash.set');
12
12
  var providers$1 = require('@ethersproject/providers');
13
13
  var wallet = require('@ethersproject/wallet');
14
+ var hash = require('@ethersproject/hash');
14
15
 
15
16
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
17
 
@@ -1670,6 +1671,23 @@ var networks = {
1670
1671
  explorer: "https://www.wanscan.org",
1671
1672
  start: 11302663,
1672
1673
  imageIPFS: "QmewFFN44rkxESFsHG8edaLt1znr62hjvZhGynfXqruzX3"
1674
+ },
1675
+ "940": {
1676
+ key: "940",
1677
+ name: "PulseChain Testnet",
1678
+ shortName: "pulsechain",
1679
+ chainId: 940,
1680
+ network: "Testnet",
1681
+ multicall: "0x5e67901C2Dd1915E9Ef49aF39B62C28DF8C2c529",
1682
+ rpc: [
1683
+ "https://rpc.testnet.pulsedisco.net"
1684
+ ],
1685
+ ws: [
1686
+ "wss://ws.rpc.testnet.pulsedisco.net"
1687
+ ],
1688
+ explorer: "https://scan.v2.testnet.pulsechain.com",
1689
+ start: 15123138,
1690
+ imageIPFS: "QmYqkn8pJUaV9KcEPYEvRPwgbfeozLEvcQ9aEwKNRUL3cR"
1673
1691
  },
1674
1692
  "1088": {
1675
1693
  key: "1088",
@@ -2754,9 +2772,9 @@ function validateSchema(schema, data) {
2754
2772
  function getEnsTextRecord(ens, record, network) {
2755
2773
  if (network === void 0) { network = '1'; }
2756
2774
  var address = networks[network].ensResolver || networks['1'].ensResolver;
2757
- var hash$1 = hash.namehash(ens);
2775
+ var ensHash = ethEnsNamehash.hash(ethEnsNamehash.normalize(ens));
2758
2776
  var provider = getProvider(network);
2759
- return call(provider, ENS_RESOLVER_ABI, [address, 'text', [hash$1, record]]);
2777
+ return call(provider, ENS_RESOLVER_ABI, [address, 'text', [ensHash, record]]);
2760
2778
  }
2761
2779
  function getSpaceUri(id, network) {
2762
2780
  if (network === void 0) { network = '1'; }
@@ -2,13 +2,14 @@ import fetch from 'cross-fetch';
2
2
  import { hexlify, arrayify } from '@ethersproject/bytes';
3
3
  import { Interface } from '@ethersproject/abi';
4
4
  import { Contract } from '@ethersproject/contracts';
5
- import { _TypedDataEncoder, namehash } from '@ethersproject/hash';
5
+ import { hash, normalize } from '@ensdomains/eth-ens-namehash';
6
6
  import { jsonToGraphQLQuery } from 'json-to-graphql-query';
7
7
  import Ajv from 'ajv';
8
8
  import addFormats from 'ajv-formats';
9
9
  import set from 'lodash.set';
10
10
  import { StaticJsonRpcProvider } from '@ethersproject/providers';
11
11
  import { verifyTypedData } from '@ethersproject/wallet';
12
+ import { _TypedDataEncoder } from '@ethersproject/hash';
12
13
 
13
14
  /*! *****************************************************************************
14
15
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1661,6 +1662,23 @@ var networks = {
1661
1662
  explorer: "https://www.wanscan.org",
1662
1663
  start: 11302663,
1663
1664
  imageIPFS: "QmewFFN44rkxESFsHG8edaLt1znr62hjvZhGynfXqruzX3"
1665
+ },
1666
+ "940": {
1667
+ key: "940",
1668
+ name: "PulseChain Testnet",
1669
+ shortName: "pulsechain",
1670
+ chainId: 940,
1671
+ network: "Testnet",
1672
+ multicall: "0x5e67901C2Dd1915E9Ef49aF39B62C28DF8C2c529",
1673
+ rpc: [
1674
+ "https://rpc.testnet.pulsedisco.net"
1675
+ ],
1676
+ ws: [
1677
+ "wss://ws.rpc.testnet.pulsedisco.net"
1678
+ ],
1679
+ explorer: "https://scan.v2.testnet.pulsechain.com",
1680
+ start: 15123138,
1681
+ imageIPFS: "QmYqkn8pJUaV9KcEPYEvRPwgbfeozLEvcQ9aEwKNRUL3cR"
1664
1682
  },
1665
1683
  "1088": {
1666
1684
  key: "1088",
@@ -2745,9 +2763,9 @@ function validateSchema(schema, data) {
2745
2763
  function getEnsTextRecord(ens, record, network) {
2746
2764
  if (network === void 0) { network = '1'; }
2747
2765
  var address = networks[network].ensResolver || networks['1'].ensResolver;
2748
- var hash = namehash(ens);
2766
+ var ensHash = hash(normalize(ens));
2749
2767
  var provider = getProvider(network);
2750
- return call(provider, ENS_RESOLVER_ABI, [address, 'text', [hash, record]]);
2768
+ return call(provider, ENS_RESOLVER_ABI, [address, 'text', [ensHash, record]]);
2751
2769
  }
2752
2770
  function getSpaceUri(id, network) {
2753
2771
  if (network === void 0) { network = '1'; }