Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
Deserialize Array using borsh js

I'm using borsh to serialise and deserialise.

class something {
  val_1 = 0
  val_2 = 0
  constructor(fields: {val_1: number, val_2: number} | undefined=undefined) {
    if(fields) {
      this.val_1 = fields.val_1
      this.val_2 = fields.val_2
    }
  }
}

const somethingSchema = new Map([
  [something, {kind: 'struct', fields: [
    ['val_1', 'u128'], ['val_2', 'u128']
  ]}]
])

const decoded_data = borsh.deserialize(something, somethingSchema, data);

This works fine for a single struct. But I am not sure how to deserailize it for an array of struct.

Any suggestions would be great.

Thanks

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!