forked from cerc-io/laconic-wallet-web
Compare commits
1 Commits
main
...
iv-add-lac
Author | SHA1 | Date | |
---|---|---|---|
|
49a20712f4 |
@ -22,6 +22,7 @@ import {
|
|||||||
EMPTY_FIELD_ERROR,
|
EMPTY_FIELD_ERROR,
|
||||||
INVALID_URL_ERROR,
|
INVALID_URL_ERROR,
|
||||||
IS_NUMBER_REGEX,
|
IS_NUMBER_REGEX,
|
||||||
|
LACONIC,
|
||||||
} from "../utils/constants";
|
} from "../utils/constants";
|
||||||
import { getCosmosAccounts } from "../utils/accounts";
|
import { getCosmosAccounts } from "../utils/accounts";
|
||||||
import ETH_CHAINS from "../assets/ethereum-chains.json";
|
import ETH_CHAINS from "../assets/ethereum-chains.json";
|
||||||
@ -162,6 +163,7 @@ const AddNetwork = () => {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case COSMOS:
|
case COSMOS:
|
||||||
|
case LACONIC:
|
||||||
address = (
|
address = (
|
||||||
await getCosmosAccounts(
|
await getCosmosAccounts(
|
||||||
mnemonic,
|
mnemonic,
|
||||||
|
@ -3,11 +3,12 @@ import { EIP155_CHAINS } from './wallet-connect/EIP155Data';
|
|||||||
|
|
||||||
export const EIP155 = 'eip155';
|
export const EIP155 = 'eip155';
|
||||||
export const COSMOS = 'cosmos';
|
export const COSMOS = 'cosmos';
|
||||||
|
export const LACONIC = 'laconic';
|
||||||
export const DEFAULT_NETWORKS = [
|
export const DEFAULT_NETWORKS = [
|
||||||
{
|
{
|
||||||
chainId: 'laconic_9000-1',
|
chainId: 'laconic_9000-1',
|
||||||
networkName: 'laconicd',
|
networkName: 'laconicd',
|
||||||
namespace: COSMOS,
|
namespace: LACONIC,
|
||||||
rpcUrl: process.env.REACT_APP_LACONICD_RPC_URL!,
|
rpcUrl: process.env.REACT_APP_LACONICD_RPC_URL!,
|
||||||
blockExplorerUrl: '',
|
blockExplorerUrl: '',
|
||||||
nativeDenom: 'alnt',
|
nativeDenom: 'alnt',
|
||||||
|
@ -8,7 +8,7 @@ import { Account, NetworksDataState } from '../../types';
|
|||||||
import { EIP155_SIGNING_METHODS } from './EIP155Data';
|
import { EIP155_SIGNING_METHODS } from './EIP155Data';
|
||||||
import { mergeWith } from 'lodash';
|
import { mergeWith } from 'lodash';
|
||||||
import { retrieveAccounts } from '../accounts';
|
import { retrieveAccounts } from '../accounts';
|
||||||
import { COSMOS, EIP155 } from '../constants';
|
import { COSMOS, EIP155, LACONIC } from '../constants';
|
||||||
import { NETWORK_METHODS } from './common-data';
|
import { NETWORK_METHODS } from './common-data';
|
||||||
import { COSMOS_METHODS } from './COSMOSData';
|
import { COSMOS_METHODS } from './COSMOSData';
|
||||||
|
|
||||||
@ -131,6 +131,20 @@ export const getNamespaces = async (
|
|||||||
],
|
],
|
||||||
accounts: requiredAddresses.filter(account => account.includes(COSMOS)),
|
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;
|
return newNamespaces;
|
||||||
@ -161,6 +175,12 @@ export const getNamespaces = async (
|
|||||||
events: [],
|
events: [],
|
||||||
accounts: [],
|
accounts: [],
|
||||||
},
|
},
|
||||||
|
laconic: {
|
||||||
|
chains: [],
|
||||||
|
methods: [],
|
||||||
|
events: [],
|
||||||
|
accounts: [],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
case COSMOS:
|
case COSMOS:
|
||||||
return {
|
return {
|
||||||
@ -186,6 +206,43 @@ export const getNamespaces = async (
|
|||||||
events: [],
|
events: [],
|
||||||
accounts: [],
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user