Raxol.Payments.Wallets.Op (Raxol Payments v0.2.0)

Copy Markdown View Source

Wallet that loads a private key from 1Password via the op CLI.

The key is fetched once on first use and cached in a GenServer's state. No plaintext key ever touches disk.

Configuration

# Start the wallet process
{:ok, pid} = Raxol.Payments.Wallets.Op.start_link(
  op_ref: "op://Employee/RaxolAgentKey/credential",
  chain_id: 8453
)

# Use as wallet module (via pid)
Raxol.Payments.Wallets.Op.address(pid)
Raxol.Payments.Wallets.Op.sign_message(pid, message)

Summary

Functions

Returns a specification to start this module under a supervisor.

Sign a precomputed 32-byte digest. Mirrors Raxol.Payments.Wallet.sign_hash/1 with a server argument; used by EIP-1559 transaction signing.

Functions

address(server)

@spec address(GenServer.server()) :: String.t()

chain_id(server)

@spec chain_id(GenServer.server()) :: pos_integer()

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

handle_manager_cast(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.

handle_manager_info(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.

sign_hash(server, digest)

@spec sign_hash(GenServer.server(), <<_::256>>) :: {:ok, binary()} | {:error, term()}

Sign a precomputed 32-byte digest. Mirrors Raxol.Payments.Wallet.sign_hash/1 with a server argument; used by EIP-1559 transaction signing.

sign_message(server, message)

@spec sign_message(GenServer.server(), binary()) :: {:ok, binary()} | {:error, term()}

sign_typed_data(server, domain, types, message)

@spec sign_typed_data(GenServer.server(), map(), map(), map()) ::
  {:ok, binary()} | {:error, term()}

start_link(init_opts \\ [])