You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also check out the [end-to-end](#end-to-end-tests-using-near-workspaces) tests for how to use the contracts from this project.
11
11
12
+
# Purpose / NEAR ecosystem impact
13
+
14
+
The purpose of the project is to provide an example and starting point for adding the Javascript layer in Rust smart contracts. Being able to execute custom Javascript code makes it possible to configure behaviour of Rust smart contracts in a dynamic way through code, and not just JSON configuration. My own motivation was to run Javascript music code inside a smart contract ( see the [WebAssembly Music](https://github.com/petersalomonsen/javascriptmusic) project), and then I also saw this [tweet](https://x.com/ilblackdragon/status/1561368373618941954) that the combination of Javascript and Rust WebAssembly was needed for other projects in the NEAR ecosystem too.
15
+
16
+
Since this project has examples for various Rust standard smart contracts on NEAR, the desired impact for projects in the NEAR ecosystem is to use these in their smart contract implementations. The combination of a customizable javascript layer on top of a rock solid Rust smart contract aims to provide flexibility without sacrificing robustness. The project also shows you how to use testing framework to ensure full End to End tests of the use cases. A comprehensive example of this is the OpenAI proxy using Fungible Tokens for covering usage costs ( see list of examples below ).
17
+
12
18
# Devcontainer / github actions
13
19
14
20
All the pre-requisities for getting the project up and running can be found in the [.devcontainer](./.devcontainer) folder, which will be automaticall set up if using a github codespace.
@@ -39,6 +45,17 @@ A simple mocking of NEAR interfaces for simulation of a smart contract directly
39
45
40
46
-[NFT](./examples/nft/README.md) - The standard NFT contract, customizable with JavaScript
41
47
-[Fungible Token](./examples/fungibletoken/README.md) - The standard FT contract, customizable with JavaScript
48
+
-[OpenAI proxy](./examples/aiproxy/REAdME.md) - A proxy to an OpenAI API server interacting with the Fungible Token contract for covering usage costs
42
49
-[Minimum Web4](./examples/minimumweb4/README.md) - Implement the web4 interface in JavaScript to serve a website from the smart contract
43
50
- "[PureJS](./examples/purejs/README.md)" - Precompile the JS bytecode into the contract, and provide direct exports to the JS functions.
44
51
-[Web4 and a WebAssembly Music showcase](./web4/README.md) - JavaScript from WebAssembly Music running in the smart contract
52
+
53
+
# Goals and roadmap
54
+
55
+
The project has already fulfilled the goal of compiling QuickJS to WebAssembly and integrate with a Rust smart contract. There is also a proof-of-concept Fungible Token contract integrated with a proxy to an OpenAI API. The goals ahead is to support the live implementations of this into the [WebAssembly Music](https://github.com/petersalomonsen/javascriptmusic) project and [Ariz portfolio](https://github.com/arizas/near-account-report).
56
+
57
+
Integrating with NEAR AI is also a natural next step in the evolution. Today NEAR AI is accessible by smarts contract emitting events, and with the Javascript layer provided here, it is possible to provide such events in a more dynamic way. The logic to generate the events can be altered without having to redeploy the entire smart contract, and also using function access keys instead of full access keys.
58
+
59
+
Finally, for the project to get more attention, it needs more documentation. Even though it already contains comprehensive test cases that also serves as code examples, the documentation explaining the concepts can be developed even more.
0 commit comments