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

feature: allow UInt8Arrays and buffers to be serialized into base64 strings #22

Merged
merged 1 commit into from
Mar 9, 2024

Conversation

doodoo-aihc
Copy link
Contributor

@doodoo-aihc doodoo-aihc commented Feb 28, 2024

What's changed

  • Allow U8Arrays and Buffers to be serialized into base64 strings, this is to allow the arrays / buffers to have a nicer representation

Before:

{"claimBump":{"type":"u8","data":255},"index":{"type":"u64","data":"1139"},"amount":{"type":"u64","data":"289"},"proof":{"type":{"vec":{"array":["u8",32]}},"data":[[189,49,122,24,142,107,225,185,142,235,113,182,184,255,12,39,109,110,201,96,32,181,151,215,155,98,64,118,47,143,173,4],[213,183,44,212,49,172,138,231,92,130,38,8,216,80,157,171,48,137,190,202,89,140,164,15,222,81,222,60,34,220,202,201],[88,24,197,27,165,191,245,54,126,222,202,23,198,70,164,74,47,205,12,46,107,70,124,81,98,67,62,90,193,63,250,9],[42,240,26,71,136,141,67,29,211,124,133,121,251,59,29,155,179,104,113,100,15,68,180,255,44,215,59,33,71,199,182,50],[63,174,178,159,12,152,151,174,56,248,222,120,33,80,198,172,172,32,40,117,7,52,52,205,29,104,94,69,12,34,205,61],[140,161,249,107,148,184,166,164,151,102,70,125,200,206,83,122,62,1,15,25,61,174,151,21,102,29,0,174,162,194,125,242],[129,112,247,159,43,26,199,228,205,81,194,47,253,111,131,97,87,13,120,211,136,9,45,43,86,138,134,226,161,136,126,154],[73,222,14,122,166,199,213,113,33,112,157,69,52,94,136,93,193,50,238,84,228,204,58,207,68,177,219,171,220,44,232,246],[23,55,175,70,129,76,139,196,106,182,125,201,91,83,203,67,11,170,239,101,246,114,8,103,146,167,23,192,58,103,0,4],[187,99,237,192,154,249,29,72,55,215,143,253,28,251,115,199,42,121,212,154,33,165,217,206,64,25,107,134,16,91,173,254],[30,85,193,101,130,47,152,66,22,32,100,215,93,210,153,163,113,63,19,251,100,118,252,206,243,18,213,134,25,201,159,173]]}}

After:

{
	"name": "claim",
	"data": {
		"claimBump": 252,
		"index": "139",
		"amount": "229",
		"claimantSecret": "Gx5wj4QBKXEMc2CnnJhwkGSJ2S2oB1pZxK1psVBMwkbd",
		"proof": [
			"b9ZoBvb0eLF4YL5hwRv+Kbzb1K162V58UX8c1Q/jsHw=",
			"rJ5ny9ZVsnK1P1DV2fsJh1SsG0yDxYpqvWNq6VBCU1A=",
			"F9e2wm/nCywtHrzapB4e6ZiAOc1RcyFWKVFxxYK/jYs=",
			"77Q6msX+slV4f0FDDU+n5VO0qbEOWiXhWG19EITz2mo=",
			"4FTP0QiVzOeIvejwQpRTdwGt4hx2AWGdZPAjqHw79P8=",
			"EdpyE1qq1yhEOimxIEXTXjjQYa5qDLKmr7dXTwzB+Ow=",
			"SJN5dlg2k1QkEdPD/0DZQ4lOr8GjDvw5Md3cDVyZFlg=",
			"jW5SLk1OSoC3kfMCML78dJ6XcAe6YurnAnaovFVZL9o=",
			"BCaprDjKkR7KPUrXFAQRJvJO9/JZzBREDrdSL0xjD/o="
		]
	},
	"programId": "gdrpGjVffourzkdDRrQmySw4aTHr8a3xmQzzxSwFD1a"
}

Copy link

changeset-bot bot commented Feb 28, 2024

⚠️ No Changeset found

Latest commit: 8cb228c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@doodoo-aihc doodoo-aihc merged commit 25e3b37 into main Mar 9, 2024
1 check passed
@doodoo-aihc doodoo-aihc deleted the feature/prettify-buffer branch March 9, 2024 07:29
denisglotov pushed a commit to blowfishxyz/explorer-kit that referenced this pull request Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant