Skip to content

Commit

Permalink
fix: updates based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
agraebe authored and reedrosenbluth committed Jan 29, 2021
1 parent 7a67d47 commit ba15c2f
Show file tree
Hide file tree
Showing 8 changed files with 4,169 additions and 4,055 deletions.
2 changes: 1 addition & 1 deletion docs/assets/js/search.json

Large diffs are not rendered by default.

103 changes: 68 additions & 35 deletions docs/classes/stackingclient.html

Large diffs are not rendered by default.

7,961 changes: 4,014 additions & 3,947 deletions docs/docs.json

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions docs/interfaces/delegatestackstxoptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h1>Interface DelegateStackStxOptions</h1>
<dd><p>number of microstacks to lock</p>
</dd>
<dt>param</dt>
<dd><p>the reward Bitcoin address</p>
<dd><p>the reward Bitcoin address of the delegator</p>
</dd>
<dt>param</dt>
<dd><p>the burnchain block height to begin lock</p>
Expand All @@ -89,6 +89,9 @@ <h1>Interface DelegateStackStxOptions</h1>
<dt>param</dt>
<dd><p>private key to sign transaction</p>
</dd>
<dt>param</dt>
<dd><p>nonce for the transaction</p>
</dd>
</dl>
</div>
</section>
Expand Down Expand Up @@ -127,7 +130,7 @@ <h3>amount<wbr>Micro<wbr>Stx</h3>
<div class="tsd-signature tsd-kind-icon">amount<wbr>Micro<wbr>Stx<span class="tsd-signature-symbol">:</span> <a href="../globals.html#bn" class="tsd-signature-type">BN</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L137">packages/stacking/src/index.ts:137</a></li>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L138">packages/stacking/src/index.ts:138</a></li>
</ul>
</aside>
</section>
Expand All @@ -137,7 +140,7 @@ <h3>burn<wbr>Block<wbr>Height</h3>
<div class="tsd-signature tsd-kind-icon">burn<wbr>Block<wbr>Height<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L139">packages/stacking/src/index.ts:139</a></li>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L140">packages/stacking/src/index.ts:140</a></li>
</ul>
</aside>
</section>
Expand All @@ -147,7 +150,7 @@ <h3>cycles</h3>
<div class="tsd-signature tsd-kind-icon">cycles<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L140">packages/stacking/src/index.ts:140</a></li>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L141">packages/stacking/src/index.ts:141</a></li>
</ul>
</aside>
</section>
Expand All @@ -157,7 +160,7 @@ <h3><span class="tsd-flag ts-flagOptional">Optional</span> nonce</h3>
<div class="tsd-signature tsd-kind-icon">nonce<span class="tsd-signature-symbol">:</span> <a href="../globals.html#bn" class="tsd-signature-type">BN</a></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L142">packages/stacking/src/index.ts:142</a></li>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L143">packages/stacking/src/index.ts:143</a></li>
</ul>
</aside>
</section>
Expand All @@ -167,7 +170,7 @@ <h3>pox<wbr>Address</h3>
<div class="tsd-signature tsd-kind-icon">pox<wbr>Address<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L138">packages/stacking/src/index.ts:138</a></li>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L139">packages/stacking/src/index.ts:139</a></li>
</ul>
</aside>
</section>
Expand All @@ -177,7 +180,7 @@ <h3>private<wbr>Key</h3>
<div class="tsd-signature tsd-kind-icon">private<wbr>Key<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L141">packages/stacking/src/index.ts:141</a></li>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L142">packages/stacking/src/index.ts:142</a></li>
</ul>
</aside>
</section>
Expand All @@ -187,7 +190,7 @@ <h3>stacker</h3>
<div class="tsd-signature tsd-kind-icon">stacker<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L136">packages/stacking/src/index.ts:136</a></li>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L137">packages/stacking/src/index.ts:137</a></li>
</ul>
</aside>
</section>
Expand Down
6 changes: 3 additions & 3 deletions docs/interfaces/stackaggregationcommitoptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h3>pox<wbr>Address</h3>
<div class="tsd-signature tsd-kind-icon">pox<wbr>Address<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L146">packages/stacking/src/index.ts:146</a></li>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L147">packages/stacking/src/index.ts:147</a></li>
</ul>
</aside>
</section>
Expand All @@ -106,7 +106,7 @@ <h3>private<wbr>Key</h3>
<div class="tsd-signature tsd-kind-icon">private<wbr>Key<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L148">packages/stacking/src/index.ts:148</a></li>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L149">packages/stacking/src/index.ts:149</a></li>
</ul>
</aside>
</section>
Expand All @@ -116,7 +116,7 @@ <h3>reward<wbr>Cycle</h3>
<div class="tsd-signature tsd-kind-icon">reward<wbr>Cycle<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L147">packages/stacking/src/index.ts:147</a></li>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/stacking/src/index.ts#L148">packages/stacking/src/index.ts:148</a></li>
</ul>
</aside>
</section>
Expand Down
13 changes: 6 additions & 7 deletions packages/stacking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ There are four methods available for delegation, two for the delegators and two

### Delegatee

If you are the account owner / stacker / delegatee, you can delegate or revoke delegation rights.
If you are the account owner ("stacker"), you can delegate or revoke delegation rights.

#### Delegate STX

Expand All @@ -181,7 +181,6 @@ const delegetateResponse = await client.delegateStx({
amountMicroStx,
delegateTo,
untilBurnBlockHeight, // optional
poxAddress, // optional
privateKey,
});

Expand All @@ -203,7 +202,7 @@ const revokeResponse = await client.revokeDelegateStx(privateKey);

### Delegator

If you are the delegator, you can stack / lock up tokens for your delegatees and commit to stacking participation for upcoming reward cycles.
If you are the delegator, you can stack ("lock up") tokens for your users and commit to stacking participation for upcoming reward cycles.

#### Stack delegated STX

Expand All @@ -212,8 +211,8 @@ If you are the delegator, you can stack / lock up tokens for your delegatees and
const delegatorAddress = 'ST22X605P0QX2BJC3NXEENXDPFCNJPHE02DTX5V74';
// delegator private key for transaction signing
const delegatorPrivateKey = 'd48f215481c16cbe6426f8e557df9b78895661971d71735126545abddcd5377001';
// the BTC address for reward payouts; either to the delegator or to the BTC address set by the account holder
const delegatePoxAddress = 'msiYwJCvXEzjgq6hDwD9ueBka6MTfN962Z';
// the BTC address for reward payouts
const delegatorBtcAddress = 'msiYwJCvXEzjgq6hDwD9ueBka6MTfN962Z';

// if you call this method multiple times in the same block, you need to increase the nonce manually
let nonce = getNonce(delegatorAddress, network);
Expand All @@ -224,7 +223,7 @@ const delegatorClient = new StackingClient(delegatorAddress, network);
const delegetateStackResponses = await delegatorClient.delegateStackStx({
stacker: address,
amountMicroStx,
poxAddress: delegatePoxAddress,
poxAddress: delegatorBtcAddress,
burnBlockHeight,
cycles,
privateKey: delegatorPrivateKey,
Expand All @@ -243,7 +242,7 @@ const delegetateStackResponses = await delegatorClient.delegateStackStx({
const rewardCycle = 12;

const delegetateCommitResponse = await delegatorClient.stackAggregationCommit({
poxAddress: delegatePoxAddress,
poxAddress: delegatorBtcAddress,
rewardCycle,
privateKey: privateKeyDelegate,
});
Expand Down
Loading

0 comments on commit ba15c2f

Please sign in to comment.