Configuration options for the client
Promise resolving to a configured BlockchainClient
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { makeBlockchainClient, lumera } from "@lumera/sdk-js";
// Create a wallet
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(mnemonic, {
prefix: "lumera"
});
const [account] = await wallet.getAccounts();
// Create the RPC-based blockchain client
const client = await makeBlockchainClient({
rpcUrl: "https://rpc.testnet.lumera.io",
chainId: "lumera-testnet-2",
signer: wallet,
address: account.address,
gasPrice: "0.025ulume"
});
// Type-safe RPC queries using generated clients
const params = await client.Action.getParams();
console.log("Max RaptorQ Symbols:", params.max_raptor_q_symbols);
// Build messages using generated MessageComposer
const msg = lumera.action.v1.MessageComposer.withTypeUrl.requestAction({
creator: account.address,
actionType: "cascade",
metadata: JSON.stringify(metadata),
price: "100000",
expirationTime: "1735689600"
});
// Simulate and broadcast a transaction via RPC
const gas = await client.Tx.simulate(account.address, [msg]);
const result = await client.Tx.signAndBroadcast(
account.address,
[msg],
{ amount: [{ denom: "ulume", amount: "5000" }], gas: gas.toString() }
);
console.log("TX Hash:", result.txHash);
Create a new RPC-based blockchain client.
This factory function initializes a complete blockchain client using RPC for all operations. It uses CosmJS for transaction signing and broadcasting via RPC, and Telescope-generated type-safe RPC clients for all module queries.