hirosystems / stacks.js

JavaScript libraries for identity, auth, storage and transactions on the Stacks blockchain.
https://stacks.js.org
MIT License
944 stars 307 forks source link

feat!: Make serialize methods return hex-encoded strings, instead of bytes #1657

Closed janniks closed 4 weeks ago

janniks commented 3 months ago

Make serialize methods return hex-encoded strings, instead of bytes

Reasoning: Most people shouldn't need to know what buffers/bytes are, they know hex from seeing strings around though. They expect txs, keys, etc. to be a hex string.

Also, renames AssetInfo to Asset for less confusion. With more strongly typed strings.

Closes #1655

Migration

- const bytes = serializePostCondition(pc);
+ const bytes = serializePostConditionBytes(pc);

New behavior

const hexString = serializePostCondition(pc);
vercel[bot] commented 3 months ago

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

Name Status Preview Comments Updated (UTC)
stacksjs-docs ❌ Failed (Inspect) Jun 10, 2024 0:25am
codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 82.30088% with 40 lines in your changes missing coverage. Please review.

Project coverage is 66.37%. Comparing base (922e037) to head (b3d3921). Report is 53 commits behind head on next.

:exclamation: Current head b3d3921 differs from pull request most recent head faae503

Please upload reports for the commit faae503 to get more accurate results.

Files Patch % Lines
packages/transactions/src/types.ts 71.05% 33 Missing :warning:
packages/transactions/src/signature.ts 75.00% 4 Missing :warning:
packages/transactions/src/keys.ts 66.66% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## next #1657 +/- ## ========================================== - Coverage 66.37% 66.37% -0.01% ========================================== Files 119 124 +5 Lines 8717 8871 +154 Branches 1920 1979 +59 ========================================== + Hits 5786 5888 +102 + Misses 2806 2743 -63 - Partials 125 240 +115 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.