-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
Let's say you have a `contract` object instantiated in your code, and the contract it wraps has an `add_person` function which receives a borsh-serialized struct. The following code now works: import { serialize } from 'near-api-js/lib/utils/serialize' class Person { constructor (proof) { Object.assign(this, proof) } } const personSchema = new Map([ [Person, { kind: 'struct', fields: [ ['age', 'u64'], ['name', 'String'], ] }] ]) const person = new Person({ age: 33, name: 'Jesus' }) contract.add_person(serialize(personSchema, person))
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.