Lightweight proxy that adapts JavaScript/TypeScript clients to BLNK Core Banking to avoid large-integer issues. It lets clients send precise_amount as a string and converts it to an integer before forwarding the request to the core, preventing errors like Do not know how to serialize a BigInt or values being turned into exponential notation.
- Listens on
ProxyPortand forwards everything to the host/port set inconfig/config.go. - If the body is JSON and contains
precise_amountas a string, it converts it to an integer and logs the conversion. - If
precise_amountis missing, already numeric, or cannot be converted, the request is forwarded unchanged (invalid cases are logged as warnings).
- Go >= 1.24 (see
go.mod). - Network connectivity to the configured BLNK instance.
Edit config/config.go to point to the core:
TargetHost: BLNK host or IP.TargetPort: BLNK port.ProxyPort: port where the proxy listens (defaults to5000).
go run .
# or
go build -o blnkGoProxy && ./blnkGoProxyExample from a JS/TS client (sending the amount as a string):
curl -X POST http://localhost:5000/transactions \
-H "Content-Type: application/json" \
-d '{"precise_amount":"123456789012345678", "account_id":"abc123"}'The proxy converts precise_amount to an integer and forwards the request to BLNK at TargetHost:TargetPort. The core’s response is returned unchanged to the client.
- Only processes
application/jsonbodies and the top-levelprecise_amountfield. - Conversion uses Go
int; ensure values fit the target platform limits. - Conversion errors do not stop the request: the original body is forwarded and a warning is printed to stdout.