This version (v0.7) has not been published to npm yet.
Skip to content

Reference / @getenginex/sdk/extension / moneyText

moneyText() ​

moneyText(): ZodMiniType<number>

Money in minor units that the gateway sends as an int64 in text ("2000") or as a number; always comes out as number (a safe integer). Decimal text, with whitespace, with + or ≥ 2^53 fails. Strict even in 'warn' mode. For SDK packages (via @getenginex/sdk/extension), not for apps.

Returns ​

ZodMiniType<number>

Example ​

ts
wire({ stake: moneyText() }) // { stake: "2000" } → { stake: 2000 }

Throws ​

Nothing: the schema does not throw; the failure becomes VALIDATION_ERROR in the transport.