From cbd5030c0883dabd656640de9512b8e4ee505a1a Mon Sep 17 00:00:00 2001 From: Bucur David Date: Fri, 15 Mar 2024 12:19:31 +0200 Subject: [PATCH] refactor: use object instead of arrays --- src/bond.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bond.ts b/src/bond.ts index 10869ed..9495a19 100644 --- a/src/bond.ts +++ b/src/bond.ts @@ -814,13 +814,15 @@ export class BondContract extends Contract { */ addPeriodsBonds( senderAddress: IAddress, - periods: number[], - bonds: BigNumber.Value[] + lockPeriodsWithBonds: { + lockPeriod: number; + amount: BigNumber.Value; + }[] ) { let combinedArray: TypedValue[] = []; - periods.map((period, index) => { - combinedArray.push(new U64Value(period)); - combinedArray.push(new BigUIntValue(bonds[index])); + lockPeriodsWithBonds.map((lockPeriodWithBond) => { + combinedArray.push(new U64Value(lockPeriodWithBond.lockPeriod)); + combinedArray.push(new BigUIntValue(lockPeriodWithBond.amount)); }); const tx = new Transaction({