Closes #658
Implements utility functions for encoding and decoding Stellar XDR contract arguments and return values, plus type-safe wrappers generated from Soroban contract bindings.
| File | Description |
|---|---|
novaRewards/backend/lib/xdr-codec.ts |
Core codec — encodeContractArgs, decodeContractResult, decodeContractEvent, address helpers |
novaRewards/backend/lib/contract-wrappers.ts |
Type-safe wrappers for nova-rewards, nova_token, reward_pool, campaign contracts |
novaRewards/backend/tests/xdr-codec.test.js |
25 unit tests covering all encode/decode round-trips |
-
encodeContractArgs(functionName, args)encodes arguments to XDR ScVal -
decodeContractResult(xdr)decodes XDR ScVal to TypeScript types -
decodeContractEvent(event)parses Horizon event XDR to typed objects - Type-safe wrappers generated from Soroban contract TypeScript bindings (
contract-wrappers.ts) - Unit tests cover encoding/decoding round-trips for all contract function signatures