Skip to content

Commit

Permalink
borsh: Add u128 and i128
Browse files Browse the repository at this point in the history
  • Loading branch information
armaniferrante committed Feb 11, 2021
1 parent d27d4ca commit 8be87b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/borsh/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@project-serum/borsh",
"version": "0.0.1-beta.0",
"version": "0.1.0",
"description": "Serum Borsh",
"main": "dist/lib/index.js",
"types": "dist/lib/index.d.ts",
Expand Down
8 changes: 8 additions & 0 deletions packages/borsh/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ export function i64(property?: string): Layout<BN> {
return new BNLayout(8, true, property);
}

export function u128(property?: string): Layout<BN> {
return new BNLayout(16, false, property);
}

export function i128(property?: string): Layout<BN> {
return new BNLayout(16, true, property);
}

class WrappedLayout<T, U> extends LayoutCls<U> {
layout: Layout<T>;
decoder: (data: T) => U;
Expand Down

0 comments on commit 8be87b0

Please sign in to comment.