React Hooks
LaWalletConfig

LaWalletConfig

React Context Provider for LaWallet.

Import

import { LaWalletConfig } from '@lawallet/react';

Usage

App.tsx
import { LaWalletConfig } from '@lawallet/react';
import { config } from './config';
 
function App() {
  return (
    <LaWalletConfig config={config}>
      {/** your app */}
    </LaWalletConfig>
  );
}

Parameters

import { type ConfigParameter } from '@lawallet/react';

config

Config object to inject with context.

  • This parameter is optional. If config is not sent, the default parameters will be used.
Config.ts
import { createConfig, createSignerWithPrivateKey } from '@lawallet/react';
 
const signer = createSignerWithPrivateKey('5caa3cd87cf1ad069bcf...a7b6070a44ec7223877504c84');
 
export const config = createConfig({
  endpoints: {
    gateway: 'https://api.lawallet.ar',
    lightningDomain: 'https://lawallet.ar',
  },
  federationId: 'lawallet.ar',
  modulePubkeys: {
    card: '18f6a706091b421bd9db1ec964b4f934007fb6997c60e3c500fdaebe5f9f7b18',
    ledger: 'bd9b0b60d5cd2a9df282fc504e88334995e6fac8b148fa89e0f8c09e2a570a84',
    urlx: 'e17feb5f2cf83546bcf7fd9c8237b05275be958bd521543c2285ffc6c2d654b3',
  },
  relaysList: ['wss://relay.damus.io', 'wss://relay.lawallet.ar'],
  signer,
});

Context

import { type ConfigContext } from '@lawallet/react';