@pwngh/economy-lab
    Preparing search index...

    Function encodeAmount

    • Encodes an amount as text, such as 'CREDIT:12.34', for anywhere it leaves the program (JSON, events, traces, HTTP). The result is a string because JSON.stringify cannot serialize the bigint. It uses a fixed two decimals so the same amount always renders identically; posting metadata uses this form so the bytes hashed into the tamper-evident chain stay stable across replays.

      Parameters

      Returns string