Skip to content

@lelantos-org/sdk / index / connect

Function: connect() ​

ts
function connect(options): Promise<WalletApi>;

Defined in: @lelantos-org/sdk/dist/wallet/connect/index.d.ts:26

Connect a spending wallet.

ts
const wallet = await connect({
    network: "base",
    rpcUrl: "https://base-rpc.example",
    privateKey: "0x…",
});
await wallet.sync();
const usdc = await wallet.asset("USDC");
const { total } = await wallet.balance(usdc.id);
await wallet.dispose();

Nothing is fetched for proving until the first spend or warmProver(). A signer or provider without an explicit key source is asked for one EIP-712 signature, after every other step has succeeded.

On failure, connect disposes what it built (a worker-pool scanner, a ProverConfig prover) and leaves a caller-supplied Prover / Scanner running, as does wallet.dispose(). See ProverOption and ScannerOption.

Parameters ​

ParameterType
optionsConnectOptions

Returns ​

Promise<WalletApi>