Skip to content

Commit

Permalink
docs: Update migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
janniks committed Oct 25, 2024
1 parent 9783e45 commit 44a094e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ Namely, the node/API it is sent to will "broadcast" the transaction to the mempo

### `serialize` methods

Most users shouldn't need to use `serializeXyz` methods.
Concepts in Stacks.js have helpers like `postConditionToHex` instead.
Serialization is meant for internal representations in transactions, mostly not for user-facing data.

Existing methods now take or return **hex-encoded strings** _instead_ of `Uint8Array`s.

> If you were already converting returned bytes to hex-strings in your code, you can now skip the conversion step — hex-strings are the new default.
Expand Down
1 change: 1 addition & 0 deletions packages/transactions/src/wire/serialization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ export function serializeTransactionAuthFieldBytes(field: TransactionAuthFieldWi
export function serializePublicKey(key: PublicKeyWire): string {
return bytesToHex(serializePublicKeyBytes(key));
}

/** @ignore */
export function serializePublicKeyBytes(key: PublicKeyWire): Uint8Array {
return key.data.slice();
Expand Down

0 comments on commit 44a094e

Please sign in to comment.