A simple deposit and profit bytom dapp demo
修订版 | 5c1b85a63c935e3c1821acf9e45ad9861ddd252e (tree) |
---|---|
时间 | 2019-03-01 14:40:32 |
作者 | Zhiting Lin <zlin035@uott...> |
Commiter | Zhiting Lin |
add the best utxo select for deposit action.
@@ -4,6 +4,7 @@ import { | ||
4 | 4 | contractArguments |
5 | 5 | } from '../../bytom' |
6 | 6 | import GetContractArgs from '../../constants' |
7 | +import { matchesUTXO } from '../../filter' | |
7 | 8 | import BigNumber from 'bignumber.js' |
8 | 9 | |
9 | 10 | export function FixedLimitDeposit(account, amount, address) { |
@@ -20,7 +21,7 @@ export function FixedLimitDeposit(account, amount, address) { | ||
20 | 21 | throw 'cannot load UTXO info.' |
21 | 22 | } |
22 | 23 | |
23 | - const result = resp[0] | |
24 | + const result = matchesUTXO(resp, amount) | |
24 | 25 | const billAmount = result.amount |
25 | 26 | const billAsset = result.asset |
26 | 27 | const utxo = result.hash |