Create a new LumeraClient with automatic configuration
This factory function simplifies client creation by:
Client configuration options
Promise resolving to a fully initialized LumeraClient
If configuration is invalid or connection fails
Using a chain preset:
const client = await createLumeraClient({ preset: "testnet", signer: wallet, address: account.address}); Copy
const client = await createLumeraClient({ preset: "testnet", signer: wallet, address: account.address});
Using custom endpoints:
const client = await createLumeraClient({ rpcUrl: "https://custom-rpc.example.com", lcdUrl: "https://custom-lcd.example.com", chainId: "lumera-custom-1", snapiUrl: "https://custom-snapi.example.com", signer: wallet, address: account.address, gasPrice: "0.05ulume"}); Copy
const client = await createLumeraClient({ rpcUrl: "https://custom-rpc.example.com", lcdUrl: "https://custom-lcd.example.com", chainId: "lumera-custom-1", snapiUrl: "https://custom-snapi.example.com", signer: wallet, address: account.address, gasPrice: "0.05ulume"});
With custom HTTP settings:
const client = await createLumeraClient({ preset: "mainnet", signer: wallet, address: account.address, http: { timeout: 60000, maxRetries: 5 }}); Copy
const client = await createLumeraClient({ preset: "mainnet", signer: wallet, address: account.address, http: { timeout: 60000, maxRetries: 5 }});
Create a new LumeraClient with automatic configuration
This factory function simplifies client creation by: