{"version":3,"file":"amount.mjs","names":[],"sources":["../src/amount.ts"],"sourcesContent":["import { AlgoAmount } from './types/amount'\n\ndeclare global {\n  interface Number {\n    /**\n     * Returns an `AlgoAmount` using this number of microAlgo.\n     */\n    microAlgos(this: number): AlgoAmount\n    /**\n     * Returns an `AlgoAmount` using this number of Algo.\n     */\n    algos(this: number): AlgoAmount\n    /**\n     * Returns an `AlgoAmount` using this number of microAlgo.\n     */\n    microAlgo(this: number): AlgoAmount\n    /**\n     * Returns an `AlgoAmount` using this number of Algo.\n     */\n    algo(this: number): AlgoAmount\n  }\n  interface BigInt {\n    /**\n     * Returns an `AlgoAmount` using this number of microAlgo.\n     */\n    microAlgo(this: bigint): AlgoAmount\n    /**\n     * Returns an `AlgoAmount` using this number of Algo.\n     */\n    algo(this: bigint): AlgoAmount\n  }\n}\n\nNumber.prototype.microAlgos = function () {\n  return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algos = function () {\n  return AlgoAmount.Algo(this)\n}\n\nNumber.prototype.microAlgo = function () {\n  return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algo = function () {\n  return AlgoAmount.Algo(this)\n}\n\nBigInt.prototype.microAlgo = function () {\n  return AlgoAmount.MicroAlgo(this)\n}\n\nBigInt.prototype.algo = function () {\n  return AlgoAmount.Algo(this)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algos = (algos: number | bigint) => {\n  return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algo = (algos: number | bigint) => {\n  return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgos = (microAlgos: number | bigint) => {\n  return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgo = (microAlgos: number | bigint) => {\n  return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo to cover standard fees for the given number of transactions using AlgoAmount\n * @param numberOfTransactions The of standard transaction fees to return the amount of Algo\n */\nexport const transactionFees = (numberOfTransactions: number) => {\n  return AlgoAmount.MicroAlgo(BigInt(numberOfTransactions) * ALGORAND_MIN_TX_FEE.microAlgo)\n}\n\nexport const ALGORAND_MIN_TX_FEE = AlgoAmount.MicroAlgo(1_000)\n"],"mappings":";;AAiCA,OAAO,UAAU,aAAa,WAAY;CACxC,OAAO,WAAW,UAAU,IAAI;AAClC;AAEA,OAAO,UAAU,QAAQ,WAAY;CACnC,OAAO,WAAW,KAAK,IAAI;AAC7B;AAEA,OAAO,UAAU,YAAY,WAAY;CACvC,OAAO,WAAW,UAAU,IAAI;AAClC;AAEA,OAAO,UAAU,OAAO,WAAY;CAClC,OAAO,WAAW,KAAK,IAAI;AAC7B;AAEA,OAAO,UAAU,YAAY,WAAY;CACvC,OAAO,WAAW,UAAU,IAAI;AAClC;AAEA,OAAO,UAAU,OAAO,WAAY;CAClC,OAAO,WAAW,KAAK,IAAI;AAC7B;;;;AAKA,MAAa,SAAS,UAA2B;CAC/C,OAAO,WAAW,KAAK,KAAK;AAC9B;;;;AAKA,MAAa,QAAQ,UAA2B;CAC9C,OAAO,WAAW,KAAK,KAAK;AAC9B;;;;AAKA,MAAa,cAAc,eAAgC;CACzD,OAAO,WAAW,UAAU,UAAU;AACxC;;;;AAKA,MAAa,aAAa,eAAgC;CACxD,OAAO,WAAW,UAAU,UAAU;AACxC;;;;AAKA,MAAa,mBAAmB,yBAAiC;CAC/D,OAAO,WAAW,UAAU,OAAO,oBAAoB,IAAI,oBAAoB,SAAS;AAC1F;AAEA,MAAa,sBAAsB,WAAW,UAAU,GAAK"}