diff --git a/src/api.js b/src/api.js index 1a4e925..3edb45a 100644 --- a/src/api.js +++ b/src/api.js @@ -1,6 +1,9 @@ import express from "express"; import cors from "cors"; import assert from "node:assert"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import base64url from "base64url"; import { checkSubdomain } from "./utils/resolving.js"; import { getArTxObject } from "./molecules/ar/atoms/tx-gql.js"; @@ -27,17 +30,23 @@ import { readNearOracleState } from "./molecules/near/atoms/read-contract.js"; import { getEverTxObject } from "./molecules/everpay/atoms/tx.js"; import { getTokenPrice } from "./molecules/redstone/atoms/oracle.js"; import { postExmData } from "./molecules/exm/atoms/bundlr.js"; -import base64url from "base64url"; const app = express(); const port = process.env.PORT || 3000; +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + app.use( cors({ origin: "*", }) ); +app.get("/", (req, res) => { + res.sendFile(path.join(__dirname + "/views/homepage.html")); +}); + app.get("/tx-gql/:txid", async (req, res) => { try { res.setHeader("Content-Type", "application/json"); diff --git a/src/views/homepage.html b/src/views/homepage.html new file mode 100644 index 0000000..20a1eb9 --- /dev/null +++ b/src/views/homepage.html @@ -0,0 +1,159 @@ + + + + + + + + + + molecule.sh | composable building blocks for EXM smart contracts + + + + + + + + +
+ +
+

composable building blocks for EXM smart contracts

+

+ EXAMPLES +     //     + GITHUB +

+

+
+
+

tree

+
+molecules/
+├── ar/
+│   └── tx-gql ~> atom
+└── evm/
+├── └── signer
+└── sol/ ~> molecule
+├── └── auth
+└── zil/
+├── └── zil-auth
+├── stx/
+│   └── stx-auth
+└── substrate/
+├── └── substrate-auth
+└── trx/
+├── └── trx-auth
+└── icp/
+├── └── icp-auth
+└── ton/
+├── └── ton-auth/
+└── massa/
+├── └── massa-auth
+└── fuel/
+├── └── fuel-auth
+└── tez/
+├── └── tez-auth
+└── aptos/
+└── └── aptos-auth/
+└── nostr/
+    └── nostr-auth
+└── exm/
+└── └── exm-bundlr
+└── near/
+└── └── n-view-state/
+└── ever/
+├── └── tx
+└── redstone/
+└── └── price
+└── ark/
+├── ├── resolve
+├── └── state
+│   └── soark/domain
+└── ai/
+└── └── chatgpt
+└── └── gpt3
+

abstract

+

+ molecule.sh is a developer tooling library and API for EXM alchemists. + Built on top of the `deterministicFetch` EXM feature, molecule.sh is + composed of reusable components to facilitate writing EXM functions. +

+

+ Like OpenZeppelin on Ethereum, molecule.sh aims to prevent EXM + developers from reinventing the wheel by packaging common operations as + importable functions. +

+

+ molecule.sh is exposed to EXM functions via npm: + npm i -g @execution-machine/sdk +

+ +

releases

+

+ v0.2.4 +

+
+ +