@snapshot-labs/snapshot.js 0.12.56 → 0.12.58

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.
@@ -2284,6 +2284,22 @@ var networks = {
2284
2284
  },
2285
2285
  start: 13960096,
2286
2286
  logo: "ipfs://QmU7f1MyRz8rLELFfypnWZQjGbDGYgZtC9rjw47jYMYrnu"
2287
+ },
2288
+ "296": {
2289
+ key: "296",
2290
+ name: "Hedera Testnet",
2291
+ shortName: "testnet",
2292
+ chainId: 296,
2293
+ network: "testnet",
2294
+ multicall: "0xADE3166b0afA89b2CDB64870D70ADeD330Eab015",
2295
+ rpc: [
2296
+ ],
2297
+ explorer: {
2298
+ url: "https://hashscan.io/testnet"
2299
+ },
2300
+ start: 17561901,
2301
+ logo: "ipfs://bafkreia5gpitwgo4sspvvtwqcxosq2krrqo5dbrnvylgibvmypzotfmbuu",
2302
+ testnet: true
2287
2303
  },
2288
2304
  "300": {
2289
2305
  key: "300",
@@ -4857,8 +4873,8 @@ function getEnsOwner(ens_1) {
4857
4873
  return owner || EMPTY_ADDRESS;
4858
4874
  });
4859
4875
  }
4860
- function getSpaceController(id_1) {
4861
- return __awaiter(this, arguments, void 0, function* (id, network = '1', options = {}) {
4876
+ function getEnsSpaceController(id_1, network_1) {
4877
+ return __awaiter(this, arguments, void 0, function* (id, network, options = {}) {
4862
4878
  const spaceUri = yield getSpaceUri(id, network, options);
4863
4879
  if (spaceUri) {
4864
4880
  let isUriAddress = address.isAddress(spaceUri);
@@ -4874,6 +4890,37 @@ function getSpaceController(id_1) {
4874
4890
  return yield getEnsOwner(id, network, options);
4875
4891
  });
4876
4892
  }
4893
+ function getShibariumNameOwner(id, network) {
4894
+ return __awaiter(this, void 0, void 0, function* () {
4895
+ if (!id.endsWith('.shib')) {
4896
+ return EMPTY_ADDRESS;
4897
+ }
4898
+ const response = yield fetch__default['default']('https://stamp.fyi', {
4899
+ method: 'POST',
4900
+ headers: {
4901
+ 'Content-Type': 'application/json'
4902
+ },
4903
+ body: JSON.stringify({
4904
+ method: 'get_owner',
4905
+ params: id,
4906
+ network
4907
+ })
4908
+ });
4909
+ const data = yield response.json();
4910
+ return data.result;
4911
+ });
4912
+ }
4913
+ function getSpaceController(id_1) {
4914
+ return __awaiter(this, arguments, void 0, function* (id, network = '1', options = {}) {
4915
+ if (['1', '11155111'].includes(network)) {
4916
+ return getEnsSpaceController(id, network, options);
4917
+ }
4918
+ else if (['109', '157'].includes(network)) {
4919
+ return getShibariumNameOwner(id, network);
4920
+ }
4921
+ throw new Error(`Network not supported: ${network}`);
4922
+ });
4923
+ }
4877
4924
  function clone(item) {
4878
4925
  return JSON.parse(JSON.stringify(item));
4879
4926
  }
@@ -2274,6 +2274,22 @@ var networks = {
2274
2274
  },
2275
2275
  start: 13960096,
2276
2276
  logo: "ipfs://QmU7f1MyRz8rLELFfypnWZQjGbDGYgZtC9rjw47jYMYrnu"
2277
+ },
2278
+ "296": {
2279
+ key: "296",
2280
+ name: "Hedera Testnet",
2281
+ shortName: "testnet",
2282
+ chainId: 296,
2283
+ network: "testnet",
2284
+ multicall: "0xADE3166b0afA89b2CDB64870D70ADeD330Eab015",
2285
+ rpc: [
2286
+ ],
2287
+ explorer: {
2288
+ url: "https://hashscan.io/testnet"
2289
+ },
2290
+ start: 17561901,
2291
+ logo: "ipfs://bafkreia5gpitwgo4sspvvtwqcxosq2krrqo5dbrnvylgibvmypzotfmbuu",
2292
+ testnet: true
2277
2293
  },
2278
2294
  "300": {
2279
2295
  key: "300",
@@ -4847,8 +4863,8 @@ function getEnsOwner(ens_1) {
4847
4863
  return owner || EMPTY_ADDRESS;
4848
4864
  });
4849
4865
  }
4850
- function getSpaceController(id_1) {
4851
- return __awaiter(this, arguments, void 0, function* (id, network = '1', options = {}) {
4866
+ function getEnsSpaceController(id_1, network_1) {
4867
+ return __awaiter(this, arguments, void 0, function* (id, network, options = {}) {
4852
4868
  const spaceUri = yield getSpaceUri(id, network, options);
4853
4869
  if (spaceUri) {
4854
4870
  let isUriAddress = isAddress(spaceUri);
@@ -4864,6 +4880,37 @@ function getSpaceController(id_1) {
4864
4880
  return yield getEnsOwner(id, network, options);
4865
4881
  });
4866
4882
  }
4883
+ function getShibariumNameOwner(id, network) {
4884
+ return __awaiter(this, void 0, void 0, function* () {
4885
+ if (!id.endsWith('.shib')) {
4886
+ return EMPTY_ADDRESS;
4887
+ }
4888
+ const response = yield fetch('https://stamp.fyi', {
4889
+ method: 'POST',
4890
+ headers: {
4891
+ 'Content-Type': 'application/json'
4892
+ },
4893
+ body: JSON.stringify({
4894
+ method: 'get_owner',
4895
+ params: id,
4896
+ network
4897
+ })
4898
+ });
4899
+ const data = yield response.json();
4900
+ return data.result;
4901
+ });
4902
+ }
4903
+ function getSpaceController(id_1) {
4904
+ return __awaiter(this, arguments, void 0, function* (id, network = '1', options = {}) {
4905
+ if (['1', '11155111'].includes(network)) {
4906
+ return getEnsSpaceController(id, network, options);
4907
+ }
4908
+ else if (['109', '157'].includes(network)) {
4909
+ return getShibariumNameOwner(id, network);
4910
+ }
4911
+ throw new Error(`Network not supported: ${network}`);
4912
+ });
4913
+ }
4867
4914
  function clone(item) {
4868
4915
  return JSON.parse(JSON.stringify(item));
4869
4916
  }