Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add pox-4 signer-key to StackingClient methods #1614

Merged
merged 24 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6cf7324
feat: add pox-4 signer-key to StackingClient methods
janniks Jan 3, 2024
e6a367c
chore: account for missing signer-key
janniks Jan 8, 2024
895d0ad
refactor: remove pox period logic from live 2.1 fork
janniks Jan 10, 2024
1d7d930
refactor: fix signer-key ensure
janniks Jan 24, 2024
52e5a2e
refactor: update to latest signer-key order
janniks Jan 30, 2024
10a5064
feat: helper function to make pox-4 signer signature
hstove Feb 8, 2024
7f406ec
refactor: update to latest signer-sig arg
janniks Feb 9, 2024
836d76c
refactor: update changes from self-review
janniks Feb 9, 2024
13cc543
refactor: update signer helpers
janniks Feb 12, 2024
df3baa9
docs: add doc strings
janniks Feb 13, 2024
0db2530
test: fix test imports
janniks Feb 13, 2024
3d89ca1
refactor: update sign method
janniks Feb 13, 2024
c7d2f48
chore: pr review updates
janniks Feb 20, 2024
4971ba1
docs: add dynamic fetch
janniks Feb 20, 2024
a8fa50e
fix: make signer-sig arg an optional
zone117x Feb 28, 2024
50358dc
fix: make all signer-sig optional
janniks Feb 28, 2024
115847b
fix: undo double some
janniks Feb 28, 2024
36558cf
feat: add max-amount and auth-id params
hstove Mar 5, 2024
45e0a47
feat: add fixture test for pox-4 message hash
hstove Mar 6, 2024
3c863e7
fix: update pox-4 args
janniks Mar 13, 2024
4a7b2fd
Merge branch 'main' into feat/update-stacking-client-to-pox-4
friedger Mar 16, 2024
b8aa366
Merge branch 'main' into feat/update-stacking-client-to-pox-4
janniks Mar 18, 2024
4a2be50
fix: add missing fields to agg-commit
janniks Mar 20, 2024
2a2f6aa
refactor: update authId to integer
janniks Mar 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion packages/stacking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,27 @@ const privateKey = 'd48f215481c16cbe6426f8e557df9b78895661971d71735126545abddcd5
// block height at which to stack
const burnBlockHeight = 2000;

// signer key
const signerPrivateKey = makeRandomPrivKey();
const signerKey = getPublicKeyFromPrivate(signerPrivateKey.data);

// Refer to initialization section to create client instance
const signerSignature = client.signPoxSignature({
topic: 'stack-stx',
janniks marked this conversation as resolved.
Show resolved Hide resolved
rewardCycle: await client.getPoxInfo().reward_cycle_id,
poxAddress,
period: cycles,
signerPrivateKey,
});

const stackingResults = await client.stack({
amountMicroStx,
poxAddress,
cycles,
privateKey,
burnBlockHeight,
signerKey,
signerSignature,
});

// {
Expand Down Expand Up @@ -521,7 +535,7 @@ const delegetateCommitResponse = await poolClient.stackAggregationCommitIndexed(

#### Increase existing commitment

The result of this commit transaction will contain the index of the pools reward set entry.
Increase partially stacked STX via the index of the reward set entry.

```typescript
// reward cycle id to commit to
Expand Down
1 change: 1 addition & 0 deletions packages/stacking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"typecheck:watch": "npm run typecheck -- --watch"
},
"dependencies": {
"@noble/hashes": "1.1.5",
"@scure/base": "1.1.1",
"@stacks/common": "^6.10.0",
"@stacks/encryption": "^6.12.1",
Expand Down
Loading
Loading