Skip to content

Commit cfcf45d

Browse files
committed
fix: #319 #330 bump STX faucet to accommodate increasing min Stacking amount
1 parent 0d4357a commit cfcf45d

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

package-lock.json

+15-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"@types/express-list-endpoints": "^4.0.1",
101101
"@types/ws": "^7.2.5",
102102
"big-integer": "^1.6.48",
103+
"bignumber.js": "^9.0.1",
103104
"bitcoinjs-lib": "^5.1.7",
104105
"bluebird": "^3.7.2",
105106
"bn.js": "^4.11.8",

src/api/routes/faucets.ts

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { addAsync, RouterWithAsync } from '@awaitjs/express';
44
import * as btc from 'bitcoinjs-lib';
55
import PQueue from 'p-queue';
66
import * as BN from 'bn.js';
7+
import { BigNumber } from 'bignumber.js';
78
import {
89
makeSTXTokenTransfer,
910
SignedTokenTransferOptions,
@@ -117,6 +118,12 @@ export function createFaucetRouter(db: DataStore): RouterWithAsync {
117118
if (isStackingReq) {
118119
const poxInfo = await rpcClient.getPox();
119120
stxAmount = BigInt(poxInfo.min_amount_ustx);
121+
const padPercent = new BigNumber(0.2);
122+
const padAmount = new BigNumber(stxAmount.toString())
123+
.times(padPercent)
124+
.integerValue()
125+
.toString();
126+
stxAmount = stxAmount + BigInt(padAmount);
120127
}
121128

122129
const [window, triggerCount] = isStackingReq

0 commit comments

Comments
 (0)