Portal Community

1. Check a Treasury Balance Before a Payout Step

Guard a downstream payout/transfer action by confirming an account has enough free balance first.

  1. Centrifuge node: resource=account, operation=getBalance, network=centrifuge, address={{treasuryAddress}}
  2. Centrifuge node: resource=utility, operation=convertUnits, amount={{freeBalance}}, fromUnit=base, toUnit=display, decimals=18 → human CFG figure
  3. Condition node: freeBalanceDisplay >= requiredAmount
  4. If true, continue to the payout step; if false, route to an alert branch
Why convert first: freeBalance comes back as a base-unit (Planck) string — comparing it directly against a human threshold like "5 CFG" would be comparing 5000000000000000000 against 5. Convert before you compare.

2. Detect a Stalled Chain Before Trusting a Balance Read

Centrifuge mainnet has been halted since 2026-06-28 — a workflow that blindly trusts every account.getBalance success will silently treat 22+ day-old state as current.

  1. Centrifuge node: resource=utility, operation=chainInfo, network=centrifuge
  2. Condition node: headBlockAgeSeconds > 3600 (or your own staleness threshold)
  3. If true, route to a "stale chain" warning branch before running any balance-dependent logic; if false, proceed normally

3. Re-encode an Address for a Cross-Chain Display

Show a Centrifuge account's Polkadot-style address alongside its native one, e.g. in a report that links out to a Polkadot-aware block explorer.

  1. Centrifuge node: resource=utility, operation=convertAddress, address={{centrifugeAddress}}, targetNetwork=polkadot
  2. Display convertedAddress next to the original — both represent the same account, verifiable via matching publicKeyHex.

4. Validate a User-Entered Address Before Any Lookup

  1. Centrifuge node: resource=utility, operation=validateAddress, address={{userInput}}
  2. Condition node: isValid == true
  3. If true, proceed to account.getBalance; if false, return a validation error to the user immediately instead of calling the network
Tip: This is a free, instant, local check — always run it on user-supplied addresses before a balance lookup, not just to avoid a wasted RPC round-trip, but because a prefix mismatch between a bad address and your intended network would otherwise surface as the less-obvious VAL_NETWORK_MISMATCH.

5. Convert a Pool Repayment Amount Without a 1012 Error

A form collects a repayment amount in a pool's stablecoin (say, USDC), and a later step needs it in base units.

  1. Centrifuge node: resource=utility, operation=convertUnits, amount={{userInputUsdc}}, fromUnit=display, toUnit=base, decimals=6
  2. Pass outputAmount into the downstream step's input field.
Note the decimals=6, not 18. USDC and USDT use 6 decimals; hardcoding CFG's 18 here would inflate the amount by a factor of a trillion. See Currencies & Units.

6. Convert a Loan's APR Into an On-Chain Rate

A loan configuration form collects an interest rate as an APR percentage; the pool's on-chain configuration needs the RAY per-second equivalent.

  1. Centrifuge node: resource=utility, operation=convertRate, rate={{userInputAprPercent}}, direction=aprToPerSec
  2. Pass outputRate into the downstream step that configures the loan's interest rate.