UNPKG

@frak-labs/components

Version:

Frak Wallet components, helping any person to interact with the Frak wallet.

1 lines 429 B
import{f as e,h as t,p as n}from"./loader.js";function r(r,i,a){let o=t(i),s=n(o);switch(r.payoutType){case`fixed`:return e(Math.round(r.amount[s]),o);case`percentage`:return a===void 0?`${r.percent} %`:e(Math.round(r.percent*a/100),o);case`tiered`:{let t=r.tiers.reduce((e,t)=>Math.max(e,t.amount[s]),0);return e(Math.round(t),o)}}}function i(e,t){return t?e.replace(`{REWARD}`,t):e.replace(`{REWARD}`,``)}export{r as n,i as t};