Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7906

Decoding and Extracting Data from complex string in base58

$
0
0

I want to extract the following information from a base58 encoded string:

{"name": {"type": "string","data": "PuppyPizza"},"symbol": {"type": "string","data": "PUPPYPIZZA"},"uri": {"type": "string","data": "https://cf-ipfs.com/ipfs/QmR4mMTi4PsoefT5YgwGGiQuBDA8V3yDDNyggt34E67WG5"}}

the encoded base58 string is as follows: 22WVW8SKNT2KRq1LB9nNfrqWJQUHMqrKr9GQLjEgDSF3yk2eddQtSxoEvJFzshvXKZameaosv6bHTUn8AKVaJ55MFyBUpvUyk29DuN7B22x3XKh3CmkUnKvDMWX19cXpKMredzTYGJJwKTn51CB7uW3n

I decoded this to HEX data:

181ec828051c07770a000000507570707950697a7a610a000000505550505950495a5a414700000068747470733a2f2f63662d697066732e636f6d2f697066732f516d52346d4d54693450736f6566543559677747476951754244413856337944444e796767743334453637574735

HEX to ASCII:

È(wPuppyPizzaPUPPYPIZZAGhttps://cf-ipfs.com/ipfs/QmR4mMTi4PsoefT5YgwGGiQuBDA8V3yDDNyggt34E67WG5

as you can see the data is in it, but it's separated by ASCII symbols and I just can't figure out a way to extract the 3 parts I need, only the URL I can do easily. The thing is it's not always the same symbols separating the 3 parts, so I need to find a way to extract the correct 3 parts every time I run the script.

I'm building a monitor on pump.fun tokens and need to extract this data.

any help is much appreciated!


Viewing all articles
Browse latest Browse all 7906

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>