Use laconic namespace

This commit is contained in:
IshaVenikar 2024-08-14 18:29:42 +05:30
parent 9e34835adf
commit e71d813a4a
3 changed files with 12 additions and 5 deletions

View File

@ -130,6 +130,13 @@ export const WalletConnectProvider = ({
chains: [`cosmos:${process.env.REACT_APP_LACONICD_CHAIN_ID}`], chains: [`cosmos:${process.env.REACT_APP_LACONICD_CHAIN_ID}`],
events: [], events: [],
}, },
laconic: {
methods: [
"cosmos_sendTransaction",
],
chains: [`laconic:${process.env.REACT_APP_LACONICD_CHAIN_ID}`],
events: [],
},
}; };
const { uri, approval } = await signClient.connect({ const { uri, approval } = await signClient.connect({

View File

@ -120,7 +120,7 @@ const SignWithLaconic = () => {
code: number; code: number;
}>({ }>({
topic: session!.topic, topic: session!.topic,
chainId: `cosmos:${process.env.REACT_APP_LACONICD_CHAIN_ID}`, chainId: `laconic:${process.env.REACT_APP_LACONICD_CHAIN_ID}`,
request: { request: {
method: "cosmos_sendTransaction", method: "cosmos_sendTransaction",
params, params,
@ -145,10 +145,10 @@ const SignWithLaconic = () => {
const getBalances = useCallback(async () => { const getBalances = useCallback(async () => {
try { try {
const cosmosClient = await createLaconicClient( const laconicClient = await createLaconicClient(
process.env.REACT_APP_LACONICD_RPC_ENDPOINT!, process.env.REACT_APP_LACONICD_RPC_ENDPOINT!,
); );
const balance = await cosmosClient.getBalance( const balance = await laconicClient.getBalance(
laconicAddress!, laconicAddress!,
process.env.REACT_APP_LACONICD_DENOM!, process.env.REACT_APP_LACONICD_DENOM!,
); );

View File

@ -133,7 +133,7 @@ const Validator = () => {
}; };
const response = await signClient!.request<{ code: number }>({ const response = await signClient!.request<{ code: number }>({
topic: session!.topic, topic: session!.topic,
chainId: `cosmos:${process.env.REACT_APP_LACONICD_CHAIN_ID}`, chainId: `laconic:${process.env.REACT_APP_LACONICD_CHAIN_ID}`,
request: { request: {
method: "cosmos_sendTransaction", method: "cosmos_sendTransaction",
params, params,
@ -172,7 +172,7 @@ const Validator = () => {
onChange={(e) => setLaconicAddress(e.target.value)} onChange={(e) => setLaconicAddress(e.target.value)}
style={{ maxWidth: "600px", display: "block" }} style={{ maxWidth: "600px", display: "block" }}
> >
{session?.namespaces.cosmos.accounts.map((address, index) => ( {session?.namespaces.laconic.accounts.map((address, index) => (
<MenuItem value={address.split(":")[2]} key={index}> <MenuItem value={address.split(":")[2]} key={index}>
{address.split(":")[2]} {address.split(":")[2]}
</MenuItem> </MenuItem>