diff --git a/lib/utils.ts b/lib/utils.ts index 85af30e..4ac1d52 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -20,7 +20,7 @@ export namespace bytes { } export function toUnsignedInt(value: Bytes, bigEndian: boolean = true): BigInt { - return BigInt.fromUnsignedBytes(bigEndian ? (value.reverse() as Bytes) : value) + return BigInt.fromUnsignedBytes(bigEndian ? Bytes.fromUint8Array(value.reverse()) : value) } // Helpers diff --git a/package.json b/package.json index 3533cfc..ddf1ca3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@protofire/subgraph-toolkit", - "version": "0.1.2", + "version": "0.1.3", "description": "AssemblyScript helpers for writing subgraph mappings for The Graph", "repository": "https://github.com/protofire/subgraph-toolkit.git", "license": "GPL-3.0-only", @@ -17,4 +17,4 @@ "peerDependencies": { "@graphprotocol/graph-ts": ">=0.20.0" } -} +} \ No newline at end of file