Skip to content

Commit

Permalink
Feature support borsch deserialisation (#53)
Browse files Browse the repository at this point in the history
* feat: added borsh support

* test: add new block 114081912

* test: add test

* chore: Add changeset

* test: remove a console.log

* test: update type

* feat: added borsher

* fix: move borsher to primitives package
  • Loading branch information
Tguntenaar authored Mar 19, 2024
1 parent 89eb4e0 commit 639de27
Show file tree
Hide file tree
Showing 9 changed files with 93,264 additions and 207 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-fireants-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@near-lake/primitives": minor
---

deserialization is now supported using borsh-js
92,860 changes: 92,860 additions & 0 deletions blocks/114158749.json

Large diffs are not rendered by default.

114 changes: 114 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion packages/near-lake-primitives/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@
"devDependencies": {
"typedoc": "^0.25.1"
},
"license": "(MIT OR Apache-2.0)"
"license": "(MIT OR Apache-2.0)",
"dependencies": {
"borsh": "^2.0.0",
"borsher": "^1.2.1"
}
}
5 changes: 5 additions & 0 deletions packages/near-lake-primitives/src/fromBorsh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import * as borsh from "borsh";
export * from "borsher";

export const fromBorsh = (schema: borsh.Schema, encoded: Uint8Array) =>
borsh.deserialize(schema, encoded);
3 changes: 3 additions & 0 deletions packages/near-lake-primitives/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "./types";

export * from "./fromBorsh";
Loading

0 comments on commit 639de27

Please sign in to comment.