-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for variable string serializers (#6)
* Add support for variable string serializers * Create sixty-nails-reflect.md * Update sixty-nails-reflect.md
- Loading branch information
1 parent
6a09e85
commit d28f4dc
Showing
4 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
'@metaplex-foundation/umi-core': patch | ||
'@metaplex-foundation/umi-serializer-beet': patch | ||
--- | ||
|
||
Add support for variable string serializers | ||
|
||
There are now three ways to serialize/deserialize a string: | ||
|
||
```ts | ||
// With prefix. | ||
umi.serializer.string().serialize('A'); | ||
// -> 0x0100000041 | ||
|
||
// Fixed. | ||
umi.serializer.fixedString(8).serialize('A'); | ||
// -> 0x4100000000000000 | ||
|
||
// Variable. | ||
umi.serializer.variableString().serialize('A'); | ||
// -> 0x41 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters