Socket
Socket
Sign inDemoInstall

@daimo/common

Package Overview
Dependencies
16
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @daimo/common

Shared between web and mobile


Version published
Weekly downloads
2
decreased by-81.82%
Maintainers
1
Created
Weekly downloads
 

Readme

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

Last updated on 09 Apr 2024

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc