Skip to content

Commit

Permalink
types to lower
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaczanowski committed Jan 16, 2025
1 parent 9916898 commit fe6272f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/staking-cli/src/cmd/ton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async function runTx (
}
const stakingPoolAddressPair: [string, string] = [config.validatorAddress, config.validatorAddress2]
const poolsInfo = await tonStaker.getPoolAddressForStake({ validatorAddressPair: stakingPoolAddressPair })
const poolIndex = stakingPoolAddressPair.findIndex((addr: string) => addr === poolsInfo.SelectedPoolAddress)
const poolIndex = stakingPoolAddressPair.findIndex((addr: string) => addr === poolsInfo.selectedPoolAddress)
if (poolIndex === -1) {
cmd.error('validator address not found in the pool', { exitCode: 1, code: `${msgType}.tx.abort` })
}
Expand Down
20 changes: 10 additions & 10 deletions packages/ton/src/TonPoolStaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class TonPoolStaker extends TonBaseStaker {
validUntil?: number
}): Promise<{ tx: UnsignedTx }> {
const { validatorAddressPair, amount, validUntil, referrer } = params
const poolAddress = (await this.getPoolAddressForStake({ validatorAddressPair })).SelectedPoolAddress
const poolAddress = (await this.getPoolAddressForStake({ validatorAddressPair })).selectedPoolAddress

// ensure the address is for the right network
this.checkIfAddressTestnetFlagMatches(poolAddress)
Expand Down Expand Up @@ -191,7 +191,7 @@ export class TonPoolStaker extends TonBaseStaker {
this.getPastElections('Ef8zMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzM0vF'),
])

const [ poolOneBalance, poolTwoBalance ] = [poolOneStatus.Balance, poolTwoStatus.Balance]
const [ poolOneBalance, poolTwoBalance ] = [poolOneStatus.balance, poolTwoStatus.balance]

// simple sanity validation
if (elections.length == 0) {
Expand All @@ -206,9 +206,9 @@ export class TonPoolStaker extends TonBaseStaker {
const selectedPoolIndex = TonPoolStaker.selectPool(minStake, [poolOneBalance, poolTwoBalance])

return {
SelectedPoolAddress: validatorAddressPair[selectedPoolIndex],
MinStake: minStake,
PoolStakes: [poolOneBalance, poolTwoBalance]
selectedPoolAddress: validatorAddressPair[selectedPoolIndex],
minStake: minStake,
poolStakes: [poolOneBalance, poolTwoBalance]
}
}

Expand All @@ -218,11 +218,11 @@ export class TonPoolStaker extends TonBaseStaker {
const res = await provider.get('get_pool_status', []);

return {
Balance: res.stack.readBigNumber(),
BalanceSent: res.stack.readBigNumber(),
BalancePendingDeposits: res.stack.readBigNumber(),
BalancePendingWithdrawals: res.stack.readBigNumber(),
BalanceWithdraw: res.stack.readBigNumber()
balance: res.stack.readBigNumber(),
balanceSent: res.stack.readBigNumber(),
balancePendingDeposits: res.stack.readBigNumber(),
balancePendingWithdrawals: res.stack.readBigNumber(),
balanceWithdraw: res.stack.readBigNumber()
}
}

Expand Down
16 changes: 8 additions & 8 deletions packages/ton/src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ export interface FrozenSet {
}

export interface PoolStatus {
Balance: bigint;
BalanceSent: bigint;
BalancePendingDeposits: bigint;
BalancePendingWithdrawals: bigint;
BalanceWithdraw: bigint;
balance: bigint;
balanceSent: bigint;
balancePendingDeposits: bigint;
balancePendingWithdrawals: bigint;
balanceWithdraw: bigint;
}

export interface GetPoolAddressForStakeResponse {
SelectedPoolAddress: string;
MinStake: bigint;
PoolStakes: [biginy, bigint];
selectedPoolAddress: string;
minStake: bigint;
poolStakes: [biginy, bigint];
}

export interface AddressDerivationConfig {
Expand Down

0 comments on commit fe6272f

Please sign in to comment.