From 8be87b0ffc13c814e04eaeed2e74819f5e990cf3 Mon Sep 17 00:00:00 2001 From: Armani Ferrante Date: Thu, 11 Feb 2021 12:56:35 +0800 Subject: [PATCH] borsh: Add u128 and i128 --- packages/borsh/package.json | 2 +- packages/borsh/src/index.ts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/borsh/package.json b/packages/borsh/package.json index ea76d4ac..f8b006e1 100644 --- a/packages/borsh/package.json +++ b/packages/borsh/package.json @@ -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", diff --git a/packages/borsh/src/index.ts b/packages/borsh/src/index.ts index 4562fb2b..20321165 100644 --- a/packages/borsh/src/index.ts +++ b/packages/borsh/src/index.ts @@ -63,6 +63,14 @@ export function i64(property?: string): Layout { return new BNLayout(8, true, property); } +export function u128(property?: string): Layout { + return new BNLayout(16, false, property); +} + +export function i128(property?: string): Layout { + return new BNLayout(16, true, property); +} + class WrappedLayout extends LayoutCls { layout: Layout; decoder: (data: T) => U;