forked from cerc-io/laconic-wallet-web
Add namespace for LACONIC
This commit is contained in:
parent
e5c5d13c77
commit
49a20712f4
@ -22,6 +22,7 @@ import {
|
||||
EMPTY_FIELD_ERROR,
|
||||
INVALID_URL_ERROR,
|
||||
IS_NUMBER_REGEX,
|
||||
LACONIC,
|
||||
} from "../utils/constants";
|
||||
import { getCosmosAccounts } from "../utils/accounts";
|
||||
import ETH_CHAINS from "../assets/ethereum-chains.json";
|
||||
@ -162,6 +163,7 @@ const AddNetwork = () => {
|
||||
break;
|
||||
|
||||
case COSMOS:
|
||||
case LACONIC:
|
||||
address = (
|
||||
await getCosmosAccounts(
|
||||
mnemonic,
|
||||
|
@ -3,11 +3,12 @@ import { EIP155_CHAINS } from './wallet-connect/EIP155Data';
|
||||
|
||||
export const EIP155 = 'eip155';
|
||||
export const COSMOS = 'cosmos';
|
||||
export const LACONIC = 'laconic';
|
||||
export const DEFAULT_NETWORKS = [
|
||||
{
|
||||
chainId: 'laconic_9000-1',
|
||||
networkName: 'laconicd',
|
||||
namespace: COSMOS,
|
||||
namespace: LACONIC,
|
||||
rpcUrl: process.env.REACT_APP_LACONICD_RPC_URL!,
|
||||
blockExplorerUrl: '',
|
||||
nativeDenom: 'alnt',
|
||||
|
@ -8,7 +8,7 @@ import { Account, NetworksDataState } from '../../types';
|
||||
import { EIP155_SIGNING_METHODS } from './EIP155Data';
|
||||
import { mergeWith } from 'lodash';
|
||||
import { retrieveAccounts } from '../accounts';
|
||||
import { COSMOS, EIP155 } from '../constants';
|
||||
import { COSMOS, EIP155, LACONIC } from '../constants';
|
||||
import { NETWORK_METHODS } from './common-data';
|
||||
import { COSMOS_METHODS } from './COSMOSData';
|
||||
|
||||
@ -131,6 +131,20 @@ export const getNamespaces = async (
|
||||
],
|
||||
accounts: requiredAddresses.filter(account => account.includes(COSMOS)),
|
||||
},
|
||||
laconic: {
|
||||
chains: walletConnectChains.filter(chain => chain.includes(LACONIC)),
|
||||
methods: [
|
||||
...Object.values(COSMOS_METHODS),
|
||||
...Object.values(NETWORK_METHODS),
|
||||
...(optionalNamespaces.laconic?.methods ?? []),
|
||||
...(requiredNamespaces.laconic?.methods ?? []),
|
||||
],
|
||||
events: [
|
||||
...(optionalNamespaces.laconic?.events ?? []),
|
||||
...(requiredNamespaces.laconic?.events ?? []),
|
||||
],
|
||||
accounts: requiredAddresses.filter(account => account.includes(LACONIC)),
|
||||
},
|
||||
};
|
||||
|
||||
return newNamespaces;
|
||||
@ -161,6 +175,12 @@ export const getNamespaces = async (
|
||||
events: [],
|
||||
accounts: [],
|
||||
},
|
||||
laconic: {
|
||||
chains: [],
|
||||
methods: [],
|
||||
events: [],
|
||||
accounts: [],
|
||||
},
|
||||
};
|
||||
case COSMOS:
|
||||
return {
|
||||
@ -186,6 +206,43 @@ export const getNamespaces = async (
|
||||
events: [],
|
||||
accounts: [],
|
||||
},
|
||||
laconic: {
|
||||
chains: [],
|
||||
methods: [],
|
||||
events: [],
|
||||
accounts: [],
|
||||
},
|
||||
};
|
||||
case LACONIC:
|
||||
return {
|
||||
laconic: {
|
||||
chains: [namespaceChainId],
|
||||
methods: [
|
||||
...Object.values(COSMOS_METHODS),
|
||||
...Object.values(NETWORK_METHODS),
|
||||
...(optionalNamespaces.laconic?.methods ?? []),
|
||||
...(requiredNamespaces.laconic?.methods ?? []),
|
||||
],
|
||||
events: [
|
||||
...(optionalNamespaces.laconic?.events ?? []),
|
||||
...(requiredNamespaces.laconic?.events ?? []),
|
||||
],
|
||||
accounts: accounts.map(laconicAccount => {
|
||||
return `${namespaceChainId}:${laconicAccount.address}`;
|
||||
}),
|
||||
},
|
||||
eip155: {
|
||||
chains: [],
|
||||
methods: [],
|
||||
events: [],
|
||||
accounts: [],
|
||||
},
|
||||
cosmos: {
|
||||
chains: [],
|
||||
methods: [],
|
||||
events: [],
|
||||
accounts: [],
|
||||
},
|
||||
};
|
||||
default:
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user