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 Address namespace #1729

Merged
merged 1 commit into from
Sep 17, 2024
Merged

feat: Add Address namespace #1729

merged 1 commit into from
Sep 17, 2024

Conversation

janniks
Copy link
Collaborator

@janniks janniks commented Jul 23, 2024

This PR was published to npm with the version 6.14.1-pr.54+9ac757b2
e.g. npm install @stacks/[email protected]+9ac757b2 --save-exact

Similar to Cl I'm trying to add more "namespace" objects.

  • Adds missing privateKeyToAddress translation helper (and test)
  • Adds Address namespace file with:
    • .parse
    • .stringify
    • .fromPrivateKey
    • .fromPublicKey

Example DX

import { Address } from '@stacks/transactions';

const { version, hash160 } = Address.parse("SP000BKJAF12");

const addressStr = Address.stringify({ versionChar: 'T', hash160: "deadbeef" });

const addressStr = Address.fromPrivateKey("7869ae87ae7901");

const addressStr = Address.fromPublicKey("03cb15c5c1b7869ae87ae79");

@janniks janniks requested a review from zone117x July 23, 2024 21:34
Copy link

vercel bot commented Jul 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stacksjs-docs 🛑 Canceled (Inspect) Sep 17, 2024 3:24pm

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Member

@zone117x zone117x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice DX

@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch from ffa62f5 to e9d8473 Compare July 31, 2024 20:13
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch 2 times, most recently from 1dad9b2 to 9ac757b Compare September 17, 2024 14:35
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch from 9ac757b to 9966317 Compare September 17, 2024 14:46
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch from 9966317 to bf8edba Compare September 17, 2024 14:50
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch 2 times, most recently from e1107f3 to b1b9bd8 Compare September 17, 2024 14:57
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch from b1b9bd8 to fc2d7dc Compare September 17, 2024 14:59
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch from fc2d7dc to c00b38e Compare September 17, 2024 15:00
@janniks janniks force-pushed the unit-methods branch 2 times, most recently from 4a995da to f586da8 Compare September 17, 2024 15:00
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch 3 times, most recently from e4add35 to 000901a Compare September 17, 2024 15:04
@janniks janniks force-pushed the unit-methods branch 2 times, most recently from 02c1fb8 to 52bf6f3 Compare September 17, 2024 15:05
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch from 000901a to 15e9d34 Compare September 17, 2024 15:05
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch from 15e9d34 to 1588477 Compare September 17, 2024 15:06
@janniks janniks force-pushed the unit-methods branch 2 times, most recently from 2613915 to 47223ec Compare September 17, 2024 15:06
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch 2 times, most recently from e394ae5 to e8750eb Compare September 17, 2024 15:07
@janniks janniks force-pushed the unit-methods branch 2 times, most recently from f9b531c to fa2b7e1 Compare September 17, 2024 15:08
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch from e8750eb to 7a986ba Compare September 17, 2024 15:08
Base automatically changed from unit-methods to next September 17, 2024 15:10
@janniks janniks force-pushed the 07-23-feat_add_address_namespace branch from 7a986ba to 24d5531 Compare September 17, 2024 15:11
@janniks janniks merged commit 1291687 into next Sep 17, 2024
7 of 8 checks passed
@janniks janniks deleted the 07-23-feat_add_address_namespace branch September 17, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants