Function: bigIntReplacer()
bigIntReplacer(
_key:string,value:unknown):unknown
Defined in: utils.ts:236
JSON replacer function that converts BigInt values to strings.
Parameters
| Parameter | Type | Description |
|---|---|---|
_key | string | Property key (unused). |
value | unknown | Value to transform. |
Returns
unknown
String representation if BigInt, otherwise unchanged value.
Example
TypeScript
import { bigIntReplacer } from '@chainlink/ccip-sdk'
const data = { amount: 1000000000000000000n }
const json = JSON.stringify(data, bigIntReplacer)
console.log(json) // '{"amount":"1000000000000000000"}'
See
bigIntReviver - Revive BigInt values when parsing