near-runtime-ts
near-runtime-ts copied to clipboard
Typescript library for writing near smart contracts
Currently the function available function for logging is `log` which takes a string. It would be better if we can support logging of struct without having to call `.encode` explicitly....
unless i'm misunderstanding something, it seems like `predecessor_account_id` can be easily surfaced into the `context` object exposed by `near-runtime-ts` https://github.com/nearprotocol/near-runtime-ts/blob/4d7247f060deb63bf9aa7a287cb37c28609ccd7e/assembly/runtime_api.ts#L28-L29 but it is not https://github.com/nearprotocol/near-runtime-ts/blob/master/assembly/contract.ts just happened to wonder about...
This adds support for `slice` to PersistentVector, matching the behavior of JavaScript's Array ([docs]) [docs]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
Currently functions that return error codes in the spec are declared to be void, e.g. if `input` was - not provided return 0; - provided returns 1, even if it...
**steps to recreate** ```js let price = "8157"; // (1) typecasting we use in our tests // https://github.com/nearprotocol/near-runtime-ts/blob/master/tests/assembly/hello/main.ts#L55 let btcPrice: i32 = I32.parseInt(price); logging.log(btcPrice.toString()) // produces 8157
Add documentation to the source code for each runtime function that matches the [spec](https://github.com/nearprotocol/nomicon/tree/master/src/Runtime/Components/BindingsSpec)
Ideally we can use as-pect with near-lib. Currently the as-pect tests we use are to test encoding/decoding and mock the imported functions. If we add near-lib we can do the...
Context.sender should point to the predecessor_id instead of signer_id. We should also export: Context.signer_id and Context.predecessor_id
Currently tests take 12+ min for CI tests. Since this repo isn't meant to test the VM shouldn't it just use a cache version or even a pre-built binary?
Using `assert` in contracts leads to ``` Quering call/contractName/tester failed: wasm execution failed with error: WasmerCallError("Smart contract has explicitly invoked `panic`."). ``` Expected:The Error message is visible in the RPC...