Skip to content

Commit fdac883

Browse files
committed
fix
1 parent eb7e183 commit fdac883

File tree

1 file changed

+21
-0
lines changed
  • packages/neuron-wallet/src/services

1 file changed

+21
-0
lines changed

packages/neuron-wallet/src/services/cells.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,6 +1321,15 @@ export default class CellsService {
13211321
return {}
13221322
}
13231323
const lockHashes = multisigAddresses.map(v => scriptToHash(addressToScript(v)))
1324+
1325+
const outputs = await getConnection()
1326+
.getRepository(OutputEntity)
1327+
.createQueryBuilder('output')
1328+
.where('output.lockHash IN (:...lockHashes)', { lockHashes })
1329+
.andWhere('output.hasData = :hasData', { hasData: true })
1330+
.andWhere('output.typeHash IS NOT NULL')
1331+
.getMany()
1332+
13241333
const connection = await getConnection()
13251334
const [sql, parameters] = connection.driver.escapeQueryWithParameters(
13261335
`
@@ -1360,6 +1369,18 @@ export default class CellsService {
13601369
] = c.balance
13611370
})
13621371

1372+
outputs.forEach(item => {
1373+
const key = scriptToAddress(
1374+
{
1375+
args: item.lockArgs,
1376+
codeHash: SystemScriptInfo.MULTI_SIGN_CODE_HASH,
1377+
hashType: SystemScriptInfo.MULTI_SIGN_HASH_TYPE,
1378+
},
1379+
isMainnet
1380+
)
1381+
balances[key] = (BigInt(balances[key]) - BigInt(item.capacity)).toString()
1382+
})
1383+
13631384
return balances
13641385
}
13651386

0 commit comments

Comments
 (0)