carbon-js-sdk 0.11.33 → 0.11.34

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.
@@ -128,7 +128,7 @@ exports.NetworkConfigs = {
128
128
  Bech32Prefix: "tswth",
129
129
  feeAddress: "989761fb0c0eb0c05605e849cae77d239f98ac7f",
130
130
  eth: {
131
- rpcURL: "https://eth-goerli.g.alchemy.com/v2/OTTRiEhTje49mmrrm4WbuPbZmuZMivEu",
131
+ rpcURL: "https://sepolia.drpc.org",
132
132
  wsURL: "",
133
133
  payerURL: `https://dev-payer.carbon.network`,
134
134
  lockProxyAddr: "0xa06569e48fed18ed840c3f064ffd9bbf95debce7",
@@ -218,7 +218,7 @@ exports.NetworkConfigs = {
218
218
  Bech32Prefix: "swth",
219
219
  feeAddress: "989761fb0c0eb0c05605e849cae77d239f98ac7f",
220
220
  eth: {
221
- rpcURL: "https://eth-goerli.g.alchemy.com/v2/OTTRiEhTje49mmrrm4WbuPbZmuZMivEu",
221
+ rpcURL: "https://sepolia.drpc.org",
222
222
  wsURL: "",
223
223
  payerURL: `https://dev-payer.carbon.network`,
224
224
  lockProxyAddr: "0x7f7317167e90afa38972e46b031bb4da0b1f6f73",
@@ -297,7 +297,7 @@ exports.NetworkConfigs = {
297
297
  Bech32Prefix: "tswth",
298
298
  feeAddress: "989761fb0c0eb0c05605e849cae77d239f98ac7f",
299
299
  eth: {
300
- rpcURL: "https://eth-goerli.g.alchemy.com/v2/OTTRiEhTje49mmrrm4WbuPbZmuZMivEu",
300
+ rpcURL: "https://sepolia.drpc.org",
301
301
  wsURL: "wss://ropsten.dagger.matic.network",
302
302
  payerURL: `http://localhost:8001`,
303
303
  bridgeEntranceAddr: "",
@@ -57,7 +57,7 @@ export declare class MetaMask extends Eip6963Provider {
57
57
  getConnectedAPI(): Promise<MetaMaskAPI>;
58
58
  connect(): Promise<MetaMaskAPI>;
59
59
  defaultAccount(): Promise<string>;
60
- getEncryptedLegacyAccount(network?: Network, metamaskBlockchain?: EVMChain): Promise<StoredMnemonicInfo | undefined>;
60
+ getEncryptedLegacyAccounts(network?: Network): Promise<StoredMnemonicInfo[] | undefined>;
61
61
  changeNetworkIfRequired(blockchain: EVMChain, network: CarbonSDK.Network): Promise<void>;
62
62
  isChangeNetworkRequired(blockchain: EVMChain, network: CarbonSDK.Network): Promise<boolean>;
63
63
  verifyNetworkAndConnectedAccount(evmHexAddress: string, evmChainId: string): Promise<void>;
@@ -39,6 +39,7 @@ const address_1 = require("../../util/address");
39
39
  const blockchain_1 = require("../../util/blockchain");
40
40
  const eip712_1 = require("../../util/eip712");
41
41
  const ethermint_1 = require("../../util/ethermint");
42
+ const evm_1 = require("../../util/evm");
42
43
  const generic_1 = require("../../util/generic");
43
44
  const legacyEIP712_1 = require("../../util/legacyEIP712");
44
45
  const network_1 = require("../../util/network");
@@ -53,7 +54,6 @@ const constant_2 = require("../../constant");
53
54
  const eip6963Provider_1 = require("../eip6963Provider");
54
55
  const error_1 = require("./error");
55
56
  const legacy_accounts_1 = require("./legacy-accounts");
56
- const evm_1 = require("../../util/evm");
57
57
  const CONTRACT_HASH = {
58
58
  Ethereum: {
59
59
  // use same rinkeby contract for all non-mainnet uses
@@ -393,7 +393,7 @@ class MetaMask extends eip6963Provider_1.Eip6963Provider {
393
393
  return defaultAccount;
394
394
  });
395
395
  }
396
- getEncryptedLegacyAccount(network = constant_1.Network.MainNet, metamaskBlockchain) {
396
+ getEncryptedLegacyAccounts(network = constant_1.Network.MainNet) {
397
397
  return __awaiter(this, void 0, void 0, function* () {
398
398
  const defaultAccount = yield this.defaultAccount();
399
399
  const legacyAccounts = network === constant_1.Network.MainNet ? legacy_accounts_1.LEGACY_ACCOUNTS_MAINNET : legacy_accounts_1.LEGACY_ACCOUNTS_TESTNET;
@@ -406,13 +406,12 @@ class MetaMask extends eip6963Provider_1.Eip6963Provider {
406
406
  }
407
407
  }
408
408
  }
409
- if (!legacyAccBlockchains.length)
410
- return undefined;
411
- let connectBlockchain = legacyAccBlockchains[0];
412
- if (legacyAccBlockchains.length > 1 && metamaskBlockchain && legacyAccBlockchains.includes(metamaskBlockchain)) {
413
- connectBlockchain = metamaskBlockchain;
409
+ if (legacyAccBlockchains.length > 0) {
410
+ const legacyMnemonicCiphers = legacyAccBlockchains.map((blockchain) => __awaiter(this, void 0, void 0, function* () { return (this.getMnemonicInfo(blockchain)); }));
411
+ const results = yield Promise.all(legacyMnemonicCiphers);
412
+ return results.filter((result) => result !== undefined);
414
413
  }
415
- return yield this.getMnemonicInfo(connectBlockchain);
414
+ return undefined;
416
415
  });
417
416
  }
418
417
  changeNetworkIfRequired(blockchain, network) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-js-sdk",
3
- "version": "0.11.33",
3
+ "version": "0.11.34",
4
4
  "description": "TypeScript SDK for Carbon blockchain",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",