🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@daimo/common

Package Overview
Dependencies
Maintainers
3
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@daimo/common

Daimo shared models and utilities

latest
npmnpm
Version
1.6.0
Version published
Weekly downloads
29
-27.5%
Maintainers
3
Weekly downloads
 
Created
Source

Common data structures

These are used across Daimo app, website, and API server.

Addresses and accounts

We use the Viem Address for ERC-55 capitalized addresses. EAccount represents an Ethereum account with name information. For example,

{ addr: "0x6982EbcC08E938FFBbCc66EdFa28cc6cFed2b741" }
{ addr: "0xc60A0A0E8bBc32DAC2E03030989AD6BEe45A874D", ensName: "dcposch.eth" }
{ addr: "0x2A6d311394184EeB6Df8FBBF58626B085374Ffe7", label: "faucet" }
{ addr: "0x4Fe4e666Be5752f1FdD210F4Ab5DE2Cc26e3E0e8", name: "ansgar" }

The last one is also a DAccount, a subset of EAccount for Daimo accounts, which have a name.

Dollars and amounts

Amounts in Daimo are stored and transmitted in two ways:

  • As bigint amount, eg 1500000
  • As string dollars, eg "1.50" ...each can be losslessly converted to the other. See amountToDollars and dollarsToAmount.

Neither of these are intended for display, which is locale-specific, eg "$1,50".

Respect the naming convention and always refer to amounts in coin units (for USDC, 1000000 = $1). Dollars should always be stored and transmitted as strings to avoid float rounding bugs.

These are app deep links. For example

  • https://daimo.com/link/account/ansgar
  • https://daimo.com/link/request/...
  • https://daimo.com/link/note/...

...all can be parsed or serialized to/from DaimoLink.

These are part of the website as well as the app.

FAQs

Package last updated on 22 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts