Web3.js Integration

A minimal Web3.js-compatible adapter for EVM signing with Emblem remote signing.

📖 Related Documentation

Basic Usage

TY
basic-usage.ts
Loading...

React/Next.js Usage

When using @emblemvault/emblem-auth-react, access the authenticated SDK via the useEmblemAuth() hook:

TS
SignWithWeb3.tsx
Loading...

Supported Operations

Message Signing

Sign plain text or byte arrays

TY
sign-message.ts
Loading...

Typed Data Signing (EIP-712)

TY
sign-typed-data.ts
Loading...

Transaction Signing

Sign transactions (returns rawTransaction hex)

TY
sign-transaction.ts
Loading...

Complete Example

TY
complete-example.ts
Loading...

Adapter Interface

The EmblemWeb3Adapter class provides these methods:

address: Hex // readonly
signMessage(message): Promise<Hex>
signTypedData(domain, types, message): Promise<Hex>
signTransaction(tx): Promise<{ rawTransaction: Hex }>

Note on Transaction Broadcasting

The toWeb3Adapter() method returns a minimal signer that focuses on signing operations. It does not include transaction broadcasting functionality. To broadcast transactions, you'll need to use a separate Web3 provider or send the signed raw transaction via your RPC endpoint.

Benefits of Emblem Integration

  • • No private key exposure - Keys stay secure in Emblem Vault
  • • Minimal adapter - Lightweight implementation focused on signing
  • • Multi-chain support - Use across any EVM-compatible chain
  • • Standard interface - Compatible with Web3.js patterns