Ethereum RPC proxy for Automate.
UI repo can be found here.
To detect if you're connected to Automate, you can send a special eth_call
request:
async function isConnectedToAutomate() {
const res = await window.ethereum.request({
method: 'eth_call',
params: [
{
from: '0x0000000000000000000000000000000000000000',
// md5 hash of 'automate'
to: '0x00000000e7fdc80c0728d856260f92fde10af019',
},
],
})
return res.client === 'automate'
}
A batteries included template for kick starting a TypeScript Cloudflare worker project.
This template is meant to be used with Wrangler. If you are not already familiar with the tool, we recommend that you install the tool and configure it to work with your Cloudflare account. Documentation can be found here.
To generate using Wrangler, run this command:
wrangler generate my-ts-project https://github.com/EverlastingBugstopper/worker-typescript-template
src/index.js
calls the request handler in src/handler.ts
, and will return the request method for the given request.
This template comes with mocha tests which simply test that the request handler can handle each request method. npm test
will run your tests.
This template uses prettier
to format the project. To invoke, run npm run format
.
For information on how to preview and publish your worker, please see the Wrangler docs.
If you run into issues with this specific project, please feel free to file an issue here. If the problem is with Wrangler, please file an issue here.
The service-worker-mock
used by the tests is not a perfect representation of the Cloudflare Workers runtime. It is a general approximation. We recommend that you test end to end with wrangler dev
in addition to a staging environment to test things before deploying.