@0xsequence/account 1.4.8 → 1.4.9

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.
@@ -840,40 +840,45 @@ class Account {
840
840
  async getSigners() {
841
841
  var _this4 = this;
842
842
  const last = ts => ts.length ? ts[ts.length - 1] : undefined;
843
- return (await Promise.all(this.networks.map(async function (network) {
844
- var _last;
845
- const {
846
- chainId
847
- } = network;
848
- const status = await _this4.status(chainId);
849
- let latestImageHash = (_last = last(status.presignedConfigurations)) == null ? void 0 : _last.nextImageHash;
850
- if (!latestImageHash) {
851
- if (status.onChain.version !== status.version) {
852
- const migration = last(status.signedMigrations);
853
- if (migration) {
854
- const {
855
- toVersion,
856
- toConfig
857
- } = migration;
858
- const _coder = core.universal.genericCoderFor(toVersion);
859
- latestImageHash = _coder.config.imageHashOf(toConfig);
843
+ return (await Promise.all(this.networks.map(async function ({
844
+ chainId,
845
+ name
846
+ }) {
847
+ try {
848
+ var _last;
849
+ const status = await _this4.status(chainId);
850
+ let latestImageHash = (_last = last(status.presignedConfigurations)) == null ? void 0 : _last.nextImageHash;
851
+ if (!latestImageHash) {
852
+ if (status.onChain.version !== status.version) {
853
+ const migration = last(status.signedMigrations);
854
+ if (migration) {
855
+ const {
856
+ toVersion,
857
+ toConfig
858
+ } = migration;
859
+ const _coder = core.universal.genericCoderFor(toVersion);
860
+ latestImageHash = _coder.config.imageHashOf(toConfig);
861
+ }
860
862
  }
861
863
  }
864
+ if (!latestImageHash) {
865
+ latestImageHash = status.onChain.imageHash;
866
+ }
867
+ const latestConfig = await _this4.tracker.configOfImageHash({
868
+ imageHash: latestImageHash
869
+ });
870
+ if (!latestConfig) {
871
+ throw new Error(`unable to find config for image hash ${latestImageHash}`);
872
+ }
873
+ const coder = core.universal.genericCoderFor(latestConfig.version);
874
+ const signers = coder.config.signersOf(latestConfig);
875
+ return signers.map(signer => _extends({}, signer, {
876
+ network: chainId
877
+ }));
878
+ } catch (error) {
879
+ console.warn(`unable to get signers on network ${chainId} ${name}`, error);
880
+ return [];
862
881
  }
863
- if (!latestImageHash) {
864
- latestImageHash = status.onChain.imageHash;
865
- }
866
- const latestConfig = await _this4.tracker.configOfImageHash({
867
- imageHash: latestImageHash
868
- });
869
- if (!latestConfig) {
870
- throw new Error(`unable to find config for image hash ${latestImageHash}`);
871
- }
872
- const coder = core.universal.genericCoderFor(latestConfig.version);
873
- const signers = coder.config.signersOf(latestConfig);
874
- return signers.map(signer => _extends({}, signer, {
875
- network: chainId
876
- }));
877
882
  }))).flat();
878
883
  }
879
884
  async getAllSigners() {
@@ -840,40 +840,45 @@ class Account {
840
840
  async getSigners() {
841
841
  var _this4 = this;
842
842
  const last = ts => ts.length ? ts[ts.length - 1] : undefined;
843
- return (await Promise.all(this.networks.map(async function (network) {
844
- var _last;
845
- const {
846
- chainId
847
- } = network;
848
- const status = await _this4.status(chainId);
849
- let latestImageHash = (_last = last(status.presignedConfigurations)) == null ? void 0 : _last.nextImageHash;
850
- if (!latestImageHash) {
851
- if (status.onChain.version !== status.version) {
852
- const migration = last(status.signedMigrations);
853
- if (migration) {
854
- const {
855
- toVersion,
856
- toConfig
857
- } = migration;
858
- const _coder = core.universal.genericCoderFor(toVersion);
859
- latestImageHash = _coder.config.imageHashOf(toConfig);
843
+ return (await Promise.all(this.networks.map(async function ({
844
+ chainId,
845
+ name
846
+ }) {
847
+ try {
848
+ var _last;
849
+ const status = await _this4.status(chainId);
850
+ let latestImageHash = (_last = last(status.presignedConfigurations)) == null ? void 0 : _last.nextImageHash;
851
+ if (!latestImageHash) {
852
+ if (status.onChain.version !== status.version) {
853
+ const migration = last(status.signedMigrations);
854
+ if (migration) {
855
+ const {
856
+ toVersion,
857
+ toConfig
858
+ } = migration;
859
+ const _coder = core.universal.genericCoderFor(toVersion);
860
+ latestImageHash = _coder.config.imageHashOf(toConfig);
861
+ }
860
862
  }
861
863
  }
864
+ if (!latestImageHash) {
865
+ latestImageHash = status.onChain.imageHash;
866
+ }
867
+ const latestConfig = await _this4.tracker.configOfImageHash({
868
+ imageHash: latestImageHash
869
+ });
870
+ if (!latestConfig) {
871
+ throw new Error(`unable to find config for image hash ${latestImageHash}`);
872
+ }
873
+ const coder = core.universal.genericCoderFor(latestConfig.version);
874
+ const signers = coder.config.signersOf(latestConfig);
875
+ return signers.map(signer => _extends({}, signer, {
876
+ network: chainId
877
+ }));
878
+ } catch (error) {
879
+ console.warn(`unable to get signers on network ${chainId} ${name}`, error);
880
+ return [];
862
881
  }
863
- if (!latestImageHash) {
864
- latestImageHash = status.onChain.imageHash;
865
- }
866
- const latestConfig = await _this4.tracker.configOfImageHash({
867
- imageHash: latestImageHash
868
- });
869
- if (!latestConfig) {
870
- throw new Error(`unable to find config for image hash ${latestImageHash}`);
871
- }
872
- const coder = core.universal.genericCoderFor(latestConfig.version);
873
- const signers = coder.config.signersOf(latestConfig);
874
- return signers.map(signer => _extends({}, signer, {
875
- network: chainId
876
- }));
877
882
  }))).flat();
878
883
  }
879
884
  async getAllSigners() {
@@ -836,40 +836,45 @@ class Account {
836
836
  async getSigners() {
837
837
  var _this4 = this;
838
838
  const last = ts => ts.length ? ts[ts.length - 1] : undefined;
839
- return (await Promise.all(this.networks.map(async function (network) {
840
- var _last;
841
- const {
842
- chainId
843
- } = network;
844
- const status = await _this4.status(chainId);
845
- let latestImageHash = (_last = last(status.presignedConfigurations)) == null ? void 0 : _last.nextImageHash;
846
- if (!latestImageHash) {
847
- if (status.onChain.version !== status.version) {
848
- const migration = last(status.signedMigrations);
849
- if (migration) {
850
- const {
851
- toVersion,
852
- toConfig
853
- } = migration;
854
- const _coder = universal.genericCoderFor(toVersion);
855
- latestImageHash = _coder.config.imageHashOf(toConfig);
839
+ return (await Promise.all(this.networks.map(async function ({
840
+ chainId,
841
+ name
842
+ }) {
843
+ try {
844
+ var _last;
845
+ const status = await _this4.status(chainId);
846
+ let latestImageHash = (_last = last(status.presignedConfigurations)) == null ? void 0 : _last.nextImageHash;
847
+ if (!latestImageHash) {
848
+ if (status.onChain.version !== status.version) {
849
+ const migration = last(status.signedMigrations);
850
+ if (migration) {
851
+ const {
852
+ toVersion,
853
+ toConfig
854
+ } = migration;
855
+ const _coder = universal.genericCoderFor(toVersion);
856
+ latestImageHash = _coder.config.imageHashOf(toConfig);
857
+ }
856
858
  }
857
859
  }
860
+ if (!latestImageHash) {
861
+ latestImageHash = status.onChain.imageHash;
862
+ }
863
+ const latestConfig = await _this4.tracker.configOfImageHash({
864
+ imageHash: latestImageHash
865
+ });
866
+ if (!latestConfig) {
867
+ throw new Error(`unable to find config for image hash ${latestImageHash}`);
868
+ }
869
+ const coder = universal.genericCoderFor(latestConfig.version);
870
+ const signers = coder.config.signersOf(latestConfig);
871
+ return signers.map(signer => _extends({}, signer, {
872
+ network: chainId
873
+ }));
874
+ } catch (error) {
875
+ console.warn(`unable to get signers on network ${chainId} ${name}`, error);
876
+ return [];
858
877
  }
859
- if (!latestImageHash) {
860
- latestImageHash = status.onChain.imageHash;
861
- }
862
- const latestConfig = await _this4.tracker.configOfImageHash({
863
- imageHash: latestImageHash
864
- });
865
- if (!latestConfig) {
866
- throw new Error(`unable to find config for image hash ${latestImageHash}`);
867
- }
868
- const coder = universal.genericCoderFor(latestConfig.version);
869
- const signers = coder.config.signersOf(latestConfig);
870
- return signers.map(signer => _extends({}, signer, {
871
- network: chainId
872
- }));
873
878
  }))).flat();
874
879
  }
875
880
  async getAllSigners() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/account",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "tools for migrating sequence wallets to new versions",
5
5
  "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/account",
6
6
  "source": "src/index.ts",
@@ -10,19 +10,19 @@
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "ethers": "^5.5.2",
13
- "@0xsequence/core": "1.4.8",
14
- "@0xsequence/migration": "1.4.8",
15
- "@0xsequence/network": "1.4.8",
16
- "@0xsequence/relayer": "1.4.8",
17
- "@0xsequence/sessions": "1.4.8",
18
- "@0xsequence/utils": "1.4.8",
19
- "@0xsequence/wallet": "1.4.8"
13
+ "@0xsequence/core": "1.4.9",
14
+ "@0xsequence/utils": "1.4.9",
15
+ "@0xsequence/sessions": "1.4.9",
16
+ "@0xsequence/migration": "1.4.9",
17
+ "@0xsequence/relayer": "1.4.9",
18
+ "@0xsequence/wallet": "1.4.9",
19
+ "@0xsequence/network": "1.4.9"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
23
23
  "nyc": "^15.1.0",
24
- "@0xsequence/signhub": "1.4.8",
25
- "@0xsequence/tests": "1.4.8"
24
+ "@0xsequence/signhub": "1.4.9",
25
+ "@0xsequence/tests": "1.4.9"
26
26
  },
27
27
  "files": [
28
28
  "src",
package/src/account.ts CHANGED
@@ -905,34 +905,38 @@ export class Account {
905
905
 
906
906
  return (
907
907
  await Promise.all(
908
- this.networks.map(async network => {
909
- const { chainId } = network
910
- const status = await this.status(chainId)
911
-
912
- let latestImageHash = last(status.presignedConfigurations)?.nextImageHash
913
- if (!latestImageHash) {
914
- if (status.onChain.version !== status.version) {
915
- const migration = last(status.signedMigrations)
916
- if (migration) {
917
- const { toVersion, toConfig } = migration
918
- const coder = universal.genericCoderFor(toVersion)
919
- latestImageHash = coder.config.imageHashOf(toConfig)
908
+ this.networks.map(async ({ chainId, name }) => {
909
+ try {
910
+ const status = await this.status(chainId)
911
+
912
+ let latestImageHash = last(status.presignedConfigurations)?.nextImageHash
913
+ if (!latestImageHash) {
914
+ if (status.onChain.version !== status.version) {
915
+ const migration = last(status.signedMigrations)
916
+ if (migration) {
917
+ const { toVersion, toConfig } = migration
918
+ const coder = universal.genericCoderFor(toVersion)
919
+ latestImageHash = coder.config.imageHashOf(toConfig)
920
+ }
920
921
  }
921
922
  }
922
- }
923
- if (!latestImageHash) {
924
- latestImageHash = status.onChain.imageHash
925
- }
923
+ if (!latestImageHash) {
924
+ latestImageHash = status.onChain.imageHash
925
+ }
926
926
 
927
- const latestConfig = await this.tracker.configOfImageHash({ imageHash: latestImageHash })
928
- if (!latestConfig) {
929
- throw new Error(`unable to find config for image hash ${latestImageHash}`)
930
- }
927
+ const latestConfig = await this.tracker.configOfImageHash({ imageHash: latestImageHash })
928
+ if (!latestConfig) {
929
+ throw new Error(`unable to find config for image hash ${latestImageHash}`)
930
+ }
931
931
 
932
- const coder = universal.genericCoderFor(latestConfig.version)
933
- const signers = coder.config.signersOf(latestConfig)
932
+ const coder = universal.genericCoderFor(latestConfig.version)
933
+ const signers = coder.config.signersOf(latestConfig)
934
934
 
935
- return signers.map(signer => ({ ...signer, network: chainId }))
935
+ return signers.map(signer => ({ ...signer, network: chainId }))
936
+ } catch (error) {
937
+ console.warn(`unable to get signers on network ${chainId} ${name}`, error)
938
+ return []
939
+ }
936
940
  })
937
941
  )
938
942
  ).flat()