From 643387f057f872cbf35eba1540dbfdcdff500827 Mon Sep 17 00:00:00 2001 From: Alexander Graebe Date: Sun, 10 Jan 2021 21:32:33 +0000 Subject: [PATCH] docs: fix stacking code sample Fixes blockstack/docs#1016 --- src/pages/understand-stacks/integrate-stacking.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/understand-stacks/integrate-stacking.md b/src/pages/understand-stacks/integrate-stacking.md index 0884ebab..e225077c 100644 --- a/src/pages/understand-stacks/integrate-stacking.md +++ b/src/pages/understand-stacks/integrate-stacking.md @@ -169,7 +169,7 @@ Users can select how many cycles they would like to participate in. To help with let numberOfCycles = 3; // the projected datetime for the unlocking of tokens -const unlockingAt = new Date(secondsUntilNextCycle); +const unlockingAt = new Date(new Date().getTime() + secondsUntilNextCycle); unlockingAt.setSeconds(unlockingAt.getSeconds() + cycleDuration * numberOfCycles); ``` @@ -184,7 +184,10 @@ With this input, and the data from previous steps, we can determine the eligibil let btcAddress = '1Xik14zRm29UsyS6DjhYg4iZeZqsDa8D3'; let numberOfCycles = 3; -const stackingEligibility = await client.canStack({ btcAddress, numberOfCycles }); +const stackingEligibility = await client.canStack({ + poxAddress: btcAddress, + cycles: numberOfCycles, +}); // stackingEligibility: // {