A demo project that showcases a way to integrate keplr wallet and cosmjs within a Godot game.
- Clone the repository, navigate to the project's
jsdirectory and install the dependencies.
git clone https://github.com/kaymakf/godot-cosmjs-demo.git
cd godot-cosmjs-demo/js
yarn- Start the development server by running
yarn devThis will serve the packed helper.js file on http://localhost:8081.
Note: If you are using nodejs version greater than v16, you may need to provide
NODE_OPTIONS=--openssl-legacy-providerwhile runningyarn devoryarn buildotherwise it may fail withError: error:0308010C:digital envelope routines::unsupportederror.NODE_OPTIONS=--openssl-legacy-provider yarn dev
-
Open the project in Godot. Modify
cw20_example.gdaccording to your requirements. -
In the HTML5 export options, make sure the Head Include option includes
<script src="http://localhost:8081/helper.js"></script> -
Run exported HTML in a browser.
This is a demo project and the code is not meant to be used in production at all. It is only intended to demonstrate the integration of keplr wallet and cosmos blockchains/cosmwasm smart contracts within a Godot game.
Pull requests are welcome.