@snapshot-labs/snapshot.js 0.12.57 → 0.12.59

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.
@@ -2624,6 +2624,22 @@ var networks = {
2624
2624
  },
2625
2625
  start: 859041,
2626
2626
  logo: "ipfs://QmeGbNTU2Jqwg8qLTMGW8n8HSi2VdgCncAaeGzLx6gYnD7"
2627
+ },
2628
+ "1315": {
2629
+ key: "1315",
2630
+ name: "Story Aeneid Testnet",
2631
+ shortName: "testnet",
2632
+ chainId: 1315,
2633
+ network: "testnet",
2634
+ multicall: "0xcA11bde05977b3631167028862bE2a173976CA11",
2635
+ rpc: [
2636
+ ],
2637
+ explorer: {
2638
+ url: "https://aeneid.storyscan.io"
2639
+ },
2640
+ start: 1792,
2641
+ logo: "ipfs://bafkreiaicdywqkmej6htv4e4lnq5fzajb3qfoxslkrbf5byvqc2aalxcne",
2642
+ testnet: true
2627
2643
  },
2628
2644
  "1328": {
2629
2645
  key: "1328",
@@ -2670,6 +2686,21 @@ var networks = {
2670
2686
  },
2671
2687
  start: 716763,
2672
2688
  logo: "ipfs://bafkreibotel3dmc5og5rf3tpt7l74awkene7x6q3oxtwhptt4y4rpa7vsa"
2689
+ },
2690
+ "1514": {
2691
+ key: "1514",
2692
+ name: "Story",
2693
+ shortName: "mainnet",
2694
+ chainId: 1514,
2695
+ network: "mainnet",
2696
+ multicall: "0xcA11bde05977b3631167028862bE2a173976CA11",
2697
+ rpc: [
2698
+ ],
2699
+ explorer: {
2700
+ url: "https://www.storyscan.io"
2701
+ },
2702
+ start: 340998,
2703
+ logo: "ipfs://bafkreiaicdywqkmej6htv4e4lnq5fzajb3qfoxslkrbf5byvqc2aalxcne"
2673
2704
  },
2674
2705
  "1559": {
2675
2706
  key: "1559",
@@ -4873,8 +4904,8 @@ function getEnsOwner(ens_1) {
4873
4904
  return owner || EMPTY_ADDRESS;
4874
4905
  });
4875
4906
  }
4876
- function getSpaceController(id_1) {
4877
- return __awaiter(this, arguments, void 0, function* (id, network = '1', options = {}) {
4907
+ function getEnsSpaceController(id_1, network_1) {
4908
+ return __awaiter(this, arguments, void 0, function* (id, network, options = {}) {
4878
4909
  const spaceUri = yield getSpaceUri(id, network, options);
4879
4910
  if (spaceUri) {
4880
4911
  let isUriAddress = address.isAddress(spaceUri);
@@ -4890,6 +4921,37 @@ function getSpaceController(id_1) {
4890
4921
  return yield getEnsOwner(id, network, options);
4891
4922
  });
4892
4923
  }
4924
+ function getShibariumNameOwner(id, network) {
4925
+ return __awaiter(this, void 0, void 0, function* () {
4926
+ if (!id.endsWith('.shib')) {
4927
+ return EMPTY_ADDRESS;
4928
+ }
4929
+ const response = yield fetch__default['default']('https://stamp.fyi', {
4930
+ method: 'POST',
4931
+ headers: {
4932
+ 'Content-Type': 'application/json'
4933
+ },
4934
+ body: JSON.stringify({
4935
+ method: 'get_owner',
4936
+ params: id,
4937
+ network
4938
+ })
4939
+ });
4940
+ const data = yield response.json();
4941
+ return data.result;
4942
+ });
4943
+ }
4944
+ function getSpaceController(id_1) {
4945
+ return __awaiter(this, arguments, void 0, function* (id, network = '1', options = {}) {
4946
+ if (['1', '11155111'].includes(network)) {
4947
+ return getEnsSpaceController(id, network, options);
4948
+ }
4949
+ else if (['109', '157'].includes(network)) {
4950
+ return getShibariumNameOwner(id, network);
4951
+ }
4952
+ throw new Error(`Network not supported: ${network}`);
4953
+ });
4954
+ }
4893
4955
  function clone(item) {
4894
4956
  return JSON.parse(JSON.stringify(item));
4895
4957
  }
@@ -2614,6 +2614,22 @@ var networks = {
2614
2614
  },
2615
2615
  start: 859041,
2616
2616
  logo: "ipfs://QmeGbNTU2Jqwg8qLTMGW8n8HSi2VdgCncAaeGzLx6gYnD7"
2617
+ },
2618
+ "1315": {
2619
+ key: "1315",
2620
+ name: "Story Aeneid Testnet",
2621
+ shortName: "testnet",
2622
+ chainId: 1315,
2623
+ network: "testnet",
2624
+ multicall: "0xcA11bde05977b3631167028862bE2a173976CA11",
2625
+ rpc: [
2626
+ ],
2627
+ explorer: {
2628
+ url: "https://aeneid.storyscan.io"
2629
+ },
2630
+ start: 1792,
2631
+ logo: "ipfs://bafkreiaicdywqkmej6htv4e4lnq5fzajb3qfoxslkrbf5byvqc2aalxcne",
2632
+ testnet: true
2617
2633
  },
2618
2634
  "1328": {
2619
2635
  key: "1328",
@@ -2660,6 +2676,21 @@ var networks = {
2660
2676
  },
2661
2677
  start: 716763,
2662
2678
  logo: "ipfs://bafkreibotel3dmc5og5rf3tpt7l74awkene7x6q3oxtwhptt4y4rpa7vsa"
2679
+ },
2680
+ "1514": {
2681
+ key: "1514",
2682
+ name: "Story",
2683
+ shortName: "mainnet",
2684
+ chainId: 1514,
2685
+ network: "mainnet",
2686
+ multicall: "0xcA11bde05977b3631167028862bE2a173976CA11",
2687
+ rpc: [
2688
+ ],
2689
+ explorer: {
2690
+ url: "https://www.storyscan.io"
2691
+ },
2692
+ start: 340998,
2693
+ logo: "ipfs://bafkreiaicdywqkmej6htv4e4lnq5fzajb3qfoxslkrbf5byvqc2aalxcne"
2663
2694
  },
2664
2695
  "1559": {
2665
2696
  key: "1559",
@@ -4863,8 +4894,8 @@ function getEnsOwner(ens_1) {
4863
4894
  return owner || EMPTY_ADDRESS;
4864
4895
  });
4865
4896
  }
4866
- function getSpaceController(id_1) {
4867
- return __awaiter(this, arguments, void 0, function* (id, network = '1', options = {}) {
4897
+ function getEnsSpaceController(id_1, network_1) {
4898
+ return __awaiter(this, arguments, void 0, function* (id, network, options = {}) {
4868
4899
  const spaceUri = yield getSpaceUri(id, network, options);
4869
4900
  if (spaceUri) {
4870
4901
  let isUriAddress = isAddress(spaceUri);
@@ -4880,6 +4911,37 @@ function getSpaceController(id_1) {
4880
4911
  return yield getEnsOwner(id, network, options);
4881
4912
  });
4882
4913
  }
4914
+ function getShibariumNameOwner(id, network) {
4915
+ return __awaiter(this, void 0, void 0, function* () {
4916
+ if (!id.endsWith('.shib')) {
4917
+ return EMPTY_ADDRESS;
4918
+ }
4919
+ const response = yield fetch('https://stamp.fyi', {
4920
+ method: 'POST',
4921
+ headers: {
4922
+ 'Content-Type': 'application/json'
4923
+ },
4924
+ body: JSON.stringify({
4925
+ method: 'get_owner',
4926
+ params: id,
4927
+ network
4928
+ })
4929
+ });
4930
+ const data = yield response.json();
4931
+ return data.result;
4932
+ });
4933
+ }
4934
+ function getSpaceController(id_1) {
4935
+ return __awaiter(this, arguments, void 0, function* (id, network = '1', options = {}) {
4936
+ if (['1', '11155111'].includes(network)) {
4937
+ return getEnsSpaceController(id, network, options);
4938
+ }
4939
+ else if (['109', '157'].includes(network)) {
4940
+ return getShibariumNameOwner(id, network);
4941
+ }
4942
+ throw new Error(`Network not supported: ${network}`);
4943
+ });
4944
+ }
4883
4945
  function clone(item) {
4884
4946
  return JSON.parse(JSON.stringify(item));
4885
4947
  }