import { Address, Cell, toNano } from "@ton/core"; import { MainBalance } from "../wrappers/MainBalance"; import { hex } from "../build/MainBalance.compiled.json"; import { NetworkProvider } from "@ton/blueprint"; import contractConfig from "../config/contract.config"; export async function getMainBalanceContract(provider:NetworkProvider) { const codeCell = Cell.fromBoc(Buffer.from(hex, "hex"))[0]; return provider.open(MainBalance.createFromConfig(contractConfig.init, codeCell)); } export function calcPercent(amount:number, percent:number = 1) { return (amount / 100) * percent; }