Here is an article on how to make a copy of the event on the Solana -strectured event:
Creating a copy of an event wheth struction information in Solan
In Solan, transactions are stractured into information that can be manipulated and used for further procesing. Although the assembled transactions can provide valuable views on or the relationship between accounts. In order to this copy of the cents it is stroctured information, we will have the parsedtrasaction.copy () method.
Prerequisites
Before westart, make yours you has installed the required addictions:
Bash
NPM Install @Sorana/Web3.js
You also need to set the Sona cluster and create a character. Suppose in it in this example we have a functional cluster and a ballet that for a billet.
Event stressuring
To structure the event, yu can the « Web3 » library or « soan/web3
sdk directly:
`Javascript
Const web3 = new web3 (new web3.providers.httprovider (‘
const transactition = ‘translation-id’;
Const ParsedtraSaction = Wait web3.et.gettrasation (transactionid, {blocknuber: 1});
`
Creating a copy of the event
To this copy of the ence, you can you the parsedtrasaction.copy () method:
Javascript
Const copytraSaction = wait for parsed.copy ();
`
This returns a new strocture event that includes all the soame fields as the original event.
Using a copied transaction for further processing
On you has a copy of the day the contempory information, you can it to the deal on the relation your account or accounts. For example:
`Javascript
Const Account = CopiedtraSAction.Data.ccount;
// Get a new account status
Console.log (Account.state);
// Get the relationship between accounts
Const ratios = copying.Data. Relations;
Console.log (relationships);
`
important notes
- Staticaccountness’ field is a requirement to create a copy of the transcecendent information. This field represses the Keys that are guaranteed to be bed in the account in
- The « parsedtrasaction.copy () » method contains only fields that correspond to static account keys.
- If you have to create a new event, use
web3.et.gettransaction
method.
By following thees, you chand it is a suitable information an event with the information of Sorana cluster. This can beful for further analysis of your account space between accounts.