nearprotocol / near-runtime-ts

Typescript library for writing near smart contracts
22 stars 7 forks source link

Compile error on storage.set<u128> #44

Open DanielRX opened 5 years ago

DanielRX commented 5 years ago

Using u128 prevents compilation, example code:

import {storage} from './near';
import {u128} from './bignum';
export function init(): void {
    storage.set<u128>('Hello', <u128>1);
}

This fails to compile with error:

ERROR TS2339: Property 'encode' does not exist on type 'bignum/integer/u128/u128'.

       this.setBytes(key, value.encode());
                                ~~~~~~
 in near.ts(175,31)