diff --git a/.mlc_config.json b/.mlc_config.json index b7e3f107c7..531256fdfb 100644 --- a/.mlc_config.json +++ b/.mlc_config.json @@ -3,6 +3,9 @@ { "pattern": "^https://gerowallet.io" }, + { + "pattern": "^https://stackoverflow.com" + }, { "pattern": "^https://singularitynet.io" }, diff --git a/CHANGELOG.md b/CHANGELOG.md index 152e986ef9..6033484d28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,37 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Removed +- **[IMPORTANT]** Removed use of conditional code rewriting based on `BROWSER_RUNTIME` env variable during bundling ([#1595](https://github.com/Plutonomicon/cardano-transaction-lib/pull/1598)). This change simplifies the bundling process, but it requires a number of updates for all CTL-dependent projects: + + * WebPack users should make this change to the webpack config: + ```diff + plugins: [ + - new webpack.DefinePlugin({ + - BROWSER_RUNTIME: isBrowser + - }), + ``` + * Esbuild users should make this change: + ```diff + const config = { + ... + - define: { + - BROWSER_RUNTIME: isBrowser ? "true" : '""' + - }, + ``` + * All users should update the runtime dependencies: + ```diff + - "@emurgo/cardano-message-signing-browser": "1.0.1", + - "@emurgo/cardano-message-signing-nodejs": "1.0.1", + + "@mlabs-haskell/cardano-message-signing": "1.0.1", + - "apply-args-browser": "0.0.1", + - "apply-args-nodejs": "0.0.1", + + "@mlabs-haskell/uplc-apply-args": "1.0.0", + + "isomorphic-ws": "^5.0.0", + - "ws": "8.4.0", + + "ws": "^8.16.0", + + "web-encoding": "^1.1.5", + ``` + - `ModifyTx` error: made conversion functions total and removed the need to handle it ## [v7.0.0] diff --git a/Makefile b/Makefile index 5519cd4075..29741d7e39 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,8 @@ js-sources := $(shell fd --no-ignore-parent -ejs -ecjs) ps-entrypoint := Ctl.Examples.ByUrl # The entry point function in the main PureScript module ps-entrypoint-function := main -# Whether to bundle for the browser +# Whether to bundle for the browser ("1") or the node ("") +# NOTE: bundling for the node is not necessary, see https://github.com/Plutonomicon/cardano-transaction-lib/blob/develop/doc/using-from-js.md browser-runtime := 1 # Use "1" for true and "" for false preview-node-ipc = $(shell docker volume inspect store_node-preview-ipc | jq -r '.[0].Mountpoint') diff --git a/doc/ctl-as-dependency.md b/doc/ctl-as-dependency.md index 0be2285aec..4893cb9352 100644 --- a/doc/ctl-as-dependency.md +++ b/doc/ctl-as-dependency.md @@ -6,25 +6,17 @@ CTL can be imported as an additional dependency into a Purescript project built -- [Caveats](#caveats) - [Using CTL's overlays](#using-ctls-overlays) - [Upgrading CTL](#upgrading-ctl) - [See also](#see-also) -## Caveats - -The following caveats alway applies when using CTL from your project: - -1. Only bundling with Webpack is supported (this is due to our internal dependency on `cardano-serialization-lib` which uses WASM with top-level `await`; only Webpack is reliably capable of bundling this properly) -2. The environment variable `BROWSER_RUNTIME` determines which version of `cardano-serialization-lib` is loaded by CTL, so you must use it as well (i.e. set it to `1` for the browser; leave it unset for NodeJS) - ## Using CTL's overlays CTL exposes two `overlay`s from its flake. You can use these in the Nix setup of your own project to use the same setup as we do, e.g. the same packages and PS builders: -- `overlays.purescript` contains Purescript builders to compile Purescript sources, build bundles with Webpack (`bundlePursProject`), run unit tests using NodeJS (`runPursTest`), and run CTL contracts on a private testnet using Plutip (`runPlutipTest`). +- `overlays.purescript` contains Purescript builders to compile Purescript sources, build bundles with Webpack/esbuild (`bundlePursProject`), run unit tests using NodeJS (`runPursTest`), and run CTL contracts on a private testnet using Plutip (`runPlutipTest`). - `overlays.runtime` contains various packages and other tools used in CTL's runtime, including `ogmios`, `kupo`, and `plutip-server`. It also defines `buildCtlRuntime` and `launchCtlRuntime` to help you quickly launch all runtime services (see the [runtime docs](./runtime.md)) We've split the overlays into two components to allow users to more easily choose which parts of CTL's Nix infrastructure they would like to directly consume. For example, some users do not require a pre-packaged runtime and would prefer to build it themselves with more control over its components (e.g. by directly using `ogmios` from their own `inputs`). Such users might still like to use our `purescript` overlay -- splitting the `overlays` allows us to support this. `overlays.runtime` also contains several haskell.nix packages which may cause issues with `hackage.nix` versions in your own project. @@ -80,9 +72,9 @@ Make sure to perform **all** of the following steps, otherwise you **will** enco - That is, avoid using the `~` or `^` prefixes (e.g use versions like `"1.6.51"` instead of `"^1.6.51"`) - If you're using a `package-lock.json` (which is _highly_ recommended), you can update the lockfile with `npm i --package-lock-only` -4. **Update your webpack config** +4. **Update your webpack/esbuild config** -- Sometimes the WebPack configuration also comes with breaking changes. Common source of problems are changes to `resolve.fallback`, `plugins` and `experiments` fields of the WebPack config. Use `git diff old-revision new-revision webpack.config.js` in the root of a cloned CTL repo, or use `git blame`. +- Sometimes the WebPack or esbuild configuration also comes with breaking changes. Use `git diff old-revision new-revision webpack.config.cjs` in the root of a cloned CTL repo, or use `git blame`. ## See also diff --git a/doc/development.md b/doc/development.md index 8928d5c6ab..6ffc51091b 100644 --- a/doc/development.md +++ b/doc/development.md @@ -77,7 +77,7 @@ To **build** the project **without bundling and for a NodeJS environment**: - `npm run staking-test` to run [Plutip](./plutip-testing.md)-powered tests for ADA staking functionality - [entry point](../test/Plutip/Staking.purs) - `npm run blockfrost-test` for [Blockfrost-powered tests](./blockfrost.md) (does not require a runtime, but needs [some setup](./blockfrost.md#setting-up-a-blockfrost-powered-test-suite)) - [entry point](../test/Blockfrost/Contract.purs) - `npm run blockfrost-local-test` for self-hosted [Blockfrost-powered tests](./blockfrost.md) (requires a [local Blockfrost runtime](./blockfrost.md#running-blockfrost-locally)) - [entry point](../test/Blockfrost/Contract.purs) -- `npm run e2e-test` for [tests with a headless browser](./e2e-testing.md) (requires a runtime and the tests served via HTTP: `npm run start-runtime` and `npm run webpack-serve` or `esbuild-serve`) +- `npm run e2e-test` for [tests with a headless browser](./e2e-testing.md) (requires a runtime and the tests served via HTTP: `npm run start-runtime` and `npm run e2e-serve` or `esbuild-serve`) #### With Nix @@ -100,14 +100,14 @@ Here and below, `` should be replaced with [one of the supported systems To run or build/bundle the project for the browser: -- `npm run webpack-serve` will start a Webpack development server at `localhost:4008`, which is required for [E2E tests](./e2e-testing.md) +- `npm run {webpack|esbuild}-serve` will start a Webpack development server at `localhost:4008`, which is required for [E2E tests](./e2e-testing.md) - `npm run {webpack|esbuild}-bundle` will output a bundled example module to `dist` (or `nix build -L .#ctl-example-bundle-web-{webpack|esbuild}` to build an example module using Nix into `./result/`) -By default, Webpack will build a [Purescript module](../examples/ByUrl.purs) that serves multiple example `Contract`s depending on URL (see [here](./e2e-testing.md#serving-the-contract-to-be-tested)). You can point Webpack to another Purescript entrypoint by changing the `ps-bundle` variable in the Makefile or in the `main` argument in the flake's `packages.ctl-examples-bundle-web`. +By default, the bundler will build a [Purescript module](../examples/ByUrl.purs) that serves multiple example `Contract`s depending on URL (see [here](./e2e-testing.md#serving-the-contract-to-be-tested)). You can point the bundler to another Purescript entrypoint by changing the `ps-bundle` variable in the Makefile or in the `main` argument in the flake's `packages.ctl-examples-bundle-web`. -You will also need a light wallet extension pre-configured to run a `Contract`. +You will also need a light wallet extension pre-configured for the correct Cardano network to run a `Contract`. -**Note**: The `BROWSER_RUNTIME` environment variable must be set to `1` in order to build/bundle the project properly for the browser (e.g. `BROWSER_RUNTIME=1 webpack ...`). For Node environments, leave this variable unset. +**Note**: The `BROWSER_RUNTIME` environment variable must be set to `1` in order to build/bundle the project properly for the browser (e.g. `BROWSER_RUNTIME=1 webpack ...`). For NodeJS environments, leave this variable unset. **Note**: The `KUPO_HOST` environment variable must be set to the base URL of the Kupo service in order to successfully serve the project for the browser (by default, `KUPO_HOST=http://localhost:1442`). diff --git a/doc/faq.md b/doc/faq.md index e92226e6d2..01f6627be3 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -78,7 +78,9 @@ Another thing to keep in mind is that due to [min-ada requirements](https://docs CTL does not consume wallet collateral normally, but it still can happen. -In order to get the collateral UTxO, CTL uses the wallet and then marks the returned UTxO as locked internally. But some wallets (e.g. Gero) do not return the collateral the moment it is set, waiting for Tx confirmation first. In case a collateral is set right before the contract is started, CTL can accidentally spend the collateral, because we rely on CTL's own query layer to get a list of available UTxOs, and the wallet state may lag behind it, not returning the collateral to filter out at that moment. +In order to get the collateral UTxO, CTL uses the wallet and then marks the returned UTxO as "locked" internally. But some wallets (e.g. Gero) do not return the collateral the moment it is set, waiting for Tx confirmation first. In case a collateral is set right before the contract is started, CTL can accidentally spend the collateral, because we rely on CTL's own query layer to get a list of available UTxOs without consulting with the wallet [in some cases](./query-layers.md), and the wallet state may lag behind the backend state. + +It is impossible to lose the collateral UTxO funds completely, though, because CTL always uses [CIP-40 collateral return](https://cips.cardano.org/cip/CIP-0040). ## Time-related diff --git a/doc/importing-scripts.md b/doc/importing-scripts.md index 0e44ae2371..5d6461789d 100644 --- a/doc/importing-scripts.md +++ b/doc/importing-scripts.md @@ -6,11 +6,11 @@ - [Exporting scripts from Plutus or Plutarch](#exporting-scripts-from-plutus-or-plutarch) - [Using Plutonomy](#using-plutonomy) -- [Importing serialized scripts](#importing-serialized-scripts) - [Serializing Plutus scripts](#serializing-plutus-scripts) - [PlutusTx](#plutustx) - [Plutarch](#plutarch) - [plutarch-ctl-bridge](#plutarch-ctl-bridge) +- [Importing serialized scripts](#importing-serialized-scripts) @@ -31,7 +31,6 @@ The output file should be a Cardano envelope: - An example of a Plutus exporter can be found [here](https://github.com/Mr-Andersen/ctl-multisign-mre/blob/main/onchain/exporter/Main.hs). - For Plutarch, see [the-plutus-scaffold](https://github.com/mlabs-haskell/the-plutus-scaffold)'s [exporter](https://github.com/mlabs-haskell/the-plutus-scaffold/tree/main/onchain/exporter). - ### Using Plutonomy It makes sense to use [Plutonomy](https://github.com/well-typed/plutonomy) (an optimizer for UPLC) in the exporter: @@ -44,91 +43,6 @@ script = fromCompiledCode $ optimizeUPLCWith aggressiveOptimizerOptions $$(PlutusTx.compile [||policy||]) ``` -## Importing serialized scripts - -To use your own scripts, compile them to any subdirectory in the root of your project (where `webpack.config.js` is located) and add a relative path to `webpack.config.js` under the `resolve.alias` section. In CTL, we have the `Scripts` alias for this purpose. Note the capitalization of `Scripts`: it is necessary to disambiguate it from local folders. - -First, in your `webpack.config.js`, define an `alias` under `module.exports.resolve.alias` in order to `require` the compiled scripts from JS modules: - -```javascript -const path = require("path"); - -module.exports = { - // ... - resolve: { - modules: [process.env.NODE_PATH], - extensions: [".js"], - fallback: { - // ... - }, - alias: { - // You should update this path to the location of your compiled scripts, - // relative to `webpack.config.js` - Scripts: path.resolve(__dirname, "fixtures/scripts"), - }, - }, -}; -``` - -You must also add the following to `module.exports.module.rules`: - -```javascript -module.exports = { - // ... - module: { - rules: [ - { - test: /\.plutus$/i, - type: "asset/source", - }, - // ... - ], - }, -}; -``` - -This enables inlining your serialized scripts in `.js` files, to then be loaded in Purescript via the FFI: - -```javascript -// inline .plutus file as a string -exports.myscript = require("Scripts/myscript.plutus"); -``` - -And on the purescript side, the script can be loaded like so: - -```purescript -foreign import myscript :: String - -parseValidator :: Contract Validator -parseValidator = liftMaybe (error "Error decoding myscript") do - envelope <- decodeTextEnvelope myscript - Validator <$> Contract.TextEnvelope.plutusScriptV1FromEnvelope envelope -myContract cfg = runContract_ cfg $ do - validator <- parseValidator - ... -``` - -This way you avoid hardcoding your scripts directly to .purs files which could lead to synchronization issues should your scripts change. - -**Note**: The `alias` method above will only work in the browser when bundling with Webpack. In order to load the scripts for both browser and NodeJS environments, you can use the `BROWSER_RUNTIME` environment variable like so: - -```javascript -let script; -if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) { - script = require("Scripts/my-script.plutus"); -} else { - const fs = require("fs"); - const path = require("path"); - script = fs.readFileSync( - path.resolve(__dirname, "../../fixtures/scripts/my-script.plutus"), - "utf8" - ); -} -exports.myScript = script; -``` - -Note that the relative path passed to `path.resolve` for the NodeJS case starts from the `output` directory that the Purescript compiler produces. - ## Serializing Plutus scripts ### PlutusTx @@ -176,3 +90,7 @@ You can use [`ply`](https://github.com/mlabs-haskell/ply) and [`ply-ctl`](https: ### plutarch-ctl-bridge You can use [`plutarch-ctl-bridge`](https://github.com/mlabs-haskell/plutarch-ctl-bridge) to generate Purescript types from your Haskell type definitions and typed script wrappers from parametrized Plutarch scripts. See [example module](https://github.com/mlabs-haskell/plutarch-ctl-bridge/blob/main/example/Main.hs). + +## Importing serialized scripts + +To use your own scripts, compile them to any subdirectory in the root of your project and either dynamically load them from file (NodeJS) or use your bundler to include them as fixtures into the bundle ([instructions for WebPack](https://webpack.js.org/guides/asset-modules/), [for esbuild](https://esbuild.github.io/content-types/#external-file)). diff --git a/doc/using-from-js.md b/doc/using-from-js.md index 4c977528d5..151b44b561 100644 --- a/doc/using-from-js.md +++ b/doc/using-from-js.md @@ -1,30 +1,42 @@ -- [JavaScript SDKs](#javascript-sdks) - - [Defining APIs in PureScript](#defining-apis-in-purescript) - - [Using from NodeJS](#using-from-nodejs) - - [Bundling for NodeJS](#bundling-for-nodejs) - - [Calling from NodeJS](#calling-from-nodejs) - - [Using from the browser](#using-from-the-browser) - - [Bundling for the browser](#bundling-for-the-browser) - - [WebAssembly and conditional imports](#webassembly-and-conditional-imports) - - [Calling in the browser](#calling-in-the-browser) +- [Building JavaScript SDKs with CTL](#building-javascript-sdks-with-ctl) + - [SDK packaging for NodeJS](#sdk-packaging-for-nodejs) + - [SDK bundling for the browser](#sdk-bundling-for-the-browser) + - [Defining SDK APIs in PureScript](#defining-sdk-apis-in-purescript) + - [Calling the SDK API](#calling-the-sdk-api) - [See also](#see-also) -# JavaScript SDKs +# Building JavaScript SDKs with CTL Normally, dApps involve three parts: -- on-chain logic (Plutus or Plutarch scripts) -- off-chain logic (in our case, implemented using CTL) +- on-chain logic (Plutus, Plutarch or Aiken scripts) +- **off-chain logic** (in our case, implemented using CTL) - user interface -Building CTL-based JavaScript SDKs is the simplest way to connect user interfaces (most commonly, web apps) with off-chain logic. These SDKs expose app-specific APIs for web developers to plug into the user interface. SDKs are normally consumable as NPM packages. +Providing CTL-based JavaScript SDKs is the simplest way to connect user interfaces (most commonly, web apps) with off-chain logic. These SDKs expose app-specific APIs for web developers to plug into the user interface. SDKs are normally consumable as NPM packages. -## Defining APIs in PureScript +Explore [the template](../templates/ctl-scaffold/package.json) or CTL itself for an example setup. See [the WebPack config](../webpack.config.cjs) or the [esbuild config](../esbuild/config.js) we provide. + +## SDK packaging for NodeJS + +NodeJS apps do not require to be bundled in order to be run (however, it is possible, see the [Makefile](../Makefile) options). + +An NPM package with `main` set to the compiled JS entry point (e.g. `./output/ApiModuleName.js`) is sufficient, but the runtime dependencies of said package must include the same package versions CTL itself uses in its `package.json`. + +## SDK bundling for the browser + +SDKs must be bundled to be usable in the browser. We support two bundlers: esbuild and WebPack. There are two options how to approach bundling and packaging: + +1. bundling a CTL-based SDK *before* consuming it as dependency in the app, i.e. putting the bundled sources in an NPM package. Bundling twice is not a good practice, and it is hard to even make it work, so in case this path is chosen, the developer should ensure that the SDK does not get bundled twice by the second bundler. + +2. **[recommended]** bundling a CTL-based SDK together with the UI part of the app. This is simpler, but in case a bundler different from esbuild or WebPack is used, problems may arise due to bundler differences. It should be possible to use other bundlers, as long as they support async top-level imports, WebAssembly and [`browser` package.json field](https://github.com/defunctzombie/package-browser-field-spec). + +## Defining SDK APIs in PureScript Developers should start from reading [this PureScript guide](https://book.purescript.org/chapter10.html#calling-purescript-from-javascript) that shows how to call PureScript from JS. Our (older) PureScript version is using CommonJS modules and not ES modules, so `import` statements should be replaced with `require`. @@ -63,37 +75,12 @@ config = testnetNamiConfig -- use Nami wallet - `Contract.JsSdk` is a module containing synonyms for some `Contract.Monad` functions, but adapted for use in JS SDKs. - `fromAff` converts `Aff a` to `Effect (Promise a)`, and `unsafePerformEffect` removes the `Effect` wrapper that is not needed on the JS side. -## Using from NodeJS +## Calling the SDK API -### Bundling for NodeJS - -To prepare the module defined above for use from other NodeJS code, `spago bundle-module` should be used: - -```bash -spago bundle-module -m Api --to output.js -``` - -The resulting bundle will NOT include its NodeJS dependencies in the same file. - -It can be distributed via NPM by pointing `package.json` to it: - -```js -{ - ... - "main": "output.js", - ... - "dependencies": { - // same dependencies as CTL itself uses should be put here - } -} -``` - -### Calling from NodeJS - -The module above can be imported like this from NodeJS: +The module above can be imported like this: ```javascript -const { initialize, config, run, finalize } = require('./output.js'); +import { initialize, config, run, finalize } from 'your-api-package'; (async () => { const env = await initialize(config); @@ -107,93 +94,6 @@ const { initialize, config, run, finalize } = require('./output.js'); Notice that we used `finally` to finalize - this is because a running contract environment would prevent the script from exiting otherwise. Please read [this guide](./contract-environment.md) for info on how to manage the runtime environment correctly. -## Using from the browser - -### Bundling for the browser - -The recommended way to bundle CTL for the browser is to use WebPack. - -#### WebAssembly and conditional imports - -We depend on WebPack's `DefinePlugin` to conditionally load either NodeJS or browser variant of dependencies that have WebAssembly parts. - -That means that CTL _requires_ bundling it the same way when used as a dependency, as we do in development. If you intend to use another bundler, something like `DefinePlugin` should be used to transform the import headers from this: - -```javascript -let lib; -if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) { - lib = require("@emurgo/cardano-serialization-lib-browser"); -} else { - lib = require("@emurgo/cardano-serialization-lib-nodejs"); -} -``` - -to only one of the import variants. - -Our default [WebPack config](../webpack.config.cjs) uses `BROWSER_RUNTIME` environment variable to differentiate between two bundling options: - -```js - plugins: [ - new webpack.DefinePlugin({ - BROWSER_RUNTIME: !!process.env.BROWSER_RUNTIME, - }), -``` - -There's [a claim that Vite bundler can also be used](https://github.com/Plutonomicon/cardano-transaction-lib/issues/79#issuecomment-1257036068), although we don't officially support this method. - -### Calling in the browser - -Webpack config contains `entry` field, pointing to the main file of the app. - -Assuming we want to use the example app from above, it can be populated like this: - -```js -import("./output.js").then( - async ({ initialize, config, run, finalize }) => { - - const env = await initialize(config); - try { - await run(env); - } finally { - await finalize(env); - } -}); -``` - -Note that `import` returns a `Promise`. - -The config also contains some setup for output target: - -```js - output: { - path: path.resolve(__dirname, "dist"), - filename: "bundle.js", - }, -``` - -But to actually build a page that can be opened in a browser, we use `HtmlWebpackPlugin`: - -```js - new HtmlWebpackPlugin({ - title: "ctl-scaffold", - template: "./index.html", - inject: false, // See stackoverflow.com/a/38292765/3067181 - }), -``` - -The HTML page should contain this import, pointing to output bundle filename: - -```html - -``` - -`type="module"` is required here. - - -`experiments.syncWebAssembly` WebPack setting must be set to `true` because CTL internal code expects it. - -The whole webpage can be served with `BROWSER_RUNTIME=1 webpack-dev-server --progress` or built with `BROWSER_RUNTIME=1 webpack --mode=production` - ## See also -- [How to import serialized Plutus scripts for NodeJS and the browser](./importing-scripts.md) +- [How to import Plutus scripts into CTL for NodeJS and the browser](./importing-scripts.md) diff --git a/esbuild/config.js b/esbuild/config.js index 0ed3d593ee..ce3de40604 100644 --- a/esbuild/config.js +++ b/esbuild/config.js @@ -7,9 +7,6 @@ export const buildOptions = ({ entryPoint, outfile }) => { const config = { entryPoints: [entryPoint], outfile: outfile, - define: { - BROWSER_RUNTIME: isBrowser ? "true" : '""' - }, plugins: [ wasmLoader({ mode: "deferred" @@ -24,8 +21,10 @@ export const buildOptions = ({ entryPoint, outfile }) => { // https://esbuild.github.io/api/#packages if (!isBrowser) { + // Keep dependencies outside of the bundle for nodejs config.packages = "external"; } else { + // Provide browser polyfills for NodeJS modules config.plugins.push( polyfillNode({ polyfills: { diff --git a/package-lock.json b/package-lock.json index 7de19f48f0..e15792edbc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,24 +9,24 @@ "version": "5.0.0", "license": "MIT", "dependencies": { - "@emurgo/cardano-message-signing-browser": "1.0.1", - "@emurgo/cardano-message-signing-nodejs": "1.0.1", + "@mlabs-haskell/cardano-message-signing": "1.0.1", "@mlabs-haskell/cardano-serialization-lib-gc": "^1.0.9", "@mlabs-haskell/json-bigint": "2.0.0", + "@mlabs-haskell/uplc-apply-args": "1.0.0", "@noble/secp256k1": "^1.7.0", - "apply-args-browser": "0.0.1", - "apply-args-nodejs": "0.0.1", "base64-js": "^1.5.1", "bignumber.js": "^9.1.1", "bip39": "^3.1.0", "blakejs": "1.2.1", "bufferutil": "4.0.5", + "isomorphic-ws": "^5.0.0", "jssha": "3.2.0", "puppeteer-core": "^15.3.2", "reconnecting-websocket": "4.4.0", "uniqid": "5.4.0", "utf-8-validate": "^5.0.10", - "ws": "8.4.0", + "web-encoding": "^1.1.5", + "ws": "^8.16.0", "xhr2": "0.2.1" }, "devDependencies": { @@ -492,6 +492,15 @@ "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", "dev": true }, + "node_modules/@mlabs-haskell/cardano-message-signing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@mlabs-haskell/cardano-message-signing/-/cardano-message-signing-1.0.1.tgz", + "integrity": "sha512-LNX+Msq1rJ86d5mmaR2Om5tUqB0ZthfE69fpsZcxOYDHNw5s+qtcCyNEmzAWfHC+uIJ4NDEJA8Gk2RfWto7ChA==", + "dependencies": { + "@emurgo/cardano-message-signing-browser": "^1.0.1", + "@emurgo/cardano-message-signing-nodejs": "^1.0.1" + } + }, "node_modules/@mlabs-haskell/cardano-serialization-lib-gc": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@mlabs-haskell/cardano-serialization-lib-gc/-/cardano-serialization-lib-gc-1.0.9.tgz", @@ -512,6 +521,15 @@ "resolved": "https://registry.npmjs.org/@mlabs-haskell/json-bigint/-/json-bigint-2.0.0.tgz", "integrity": "sha512-JX9TON+nZbt+1TJ5MNV1Gcpxp3/m56x1/glDwzGtydrzQzyZbKg4XFw9Frib6fh89YVqjSFJ9xmVeIyDJ5DxTQ==" }, + "node_modules/@mlabs-haskell/uplc-apply-args": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@mlabs-haskell/uplc-apply-args/-/uplc-apply-args-1.0.0.tgz", + "integrity": "sha512-jygKgElPSmrjBifiec8lLAjcKAPDOvDTv0hCW6jfX+/hnlaI8p9w5amv6jeCMmnr3/ncRzE9JrcuVJoB5lBwLA==", + "dependencies": { + "apply-args-browser": "^0.0.1", + "apply-args-nodejs": "^0.0.1" + } + }, "node_modules/@noble/hashes": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", @@ -970,6 +988,12 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "node_modules/@zxing/text-encoding": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", + "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", + "optional": true + }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -1175,7 +1199,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -1601,7 +1624,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -2731,7 +2753,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, "dependencies": { "is-callable": "^1.1.3" } @@ -2796,14 +2817,12 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/get-intrinsic": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -2869,7 +2888,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -2893,7 +2911,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -2926,7 +2943,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -2938,7 +2954,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -2950,7 +2965,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -3312,7 +3326,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -3363,7 +3376,6 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -3421,7 +3433,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -3516,7 +3527,6 @@ "version": "1.1.12", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", - "dev": true, "dependencies": { "which-typed-array": "^1.1.11" }, @@ -3560,6 +3570,14 @@ "node": ">=0.10.0" } }, + "node_modules/isomorphic-ws": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", + "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", + "peerDependencies": { + "ws": "*" + } + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -5796,7 +5814,6 @@ "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dev": true, "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -5895,6 +5912,17 @@ "minimalistic-assert": "^1.0.0" } }, + "node_modules/web-encoding": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", + "integrity": "sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==", + "dependencies": { + "util": "^0.12.3" + }, + "optionalDependencies": { + "@zxing/text-encoding": "0.9.0" + } + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -6189,27 +6217,6 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/webpack-dev-server/node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/webpack-merge": { "version": "5.9.0", "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.9.0.tgz", @@ -6283,7 +6290,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", - "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -6310,15 +6316,15 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.4.0.tgz", - "integrity": "sha512-IHVsKe2pjajSUIl4KYMQOdlyliovpEPquKkqbwswulszzI7r0SfQrxnXdWAEqOlDCLrVSJzo+O1hAwdog2sKSQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -6608,6 +6614,15 @@ "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", "dev": true }, + "@mlabs-haskell/cardano-message-signing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@mlabs-haskell/cardano-message-signing/-/cardano-message-signing-1.0.1.tgz", + "integrity": "sha512-LNX+Msq1rJ86d5mmaR2Om5tUqB0ZthfE69fpsZcxOYDHNw5s+qtcCyNEmzAWfHC+uIJ4NDEJA8Gk2RfWto7ChA==", + "requires": { + "@emurgo/cardano-message-signing-browser": "^1.0.1", + "@emurgo/cardano-message-signing-nodejs": "^1.0.1" + } + }, "@mlabs-haskell/cardano-serialization-lib-gc": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@mlabs-haskell/cardano-serialization-lib-gc/-/cardano-serialization-lib-gc-1.0.9.tgz", @@ -6628,6 +6643,15 @@ "resolved": "https://registry.npmjs.org/@mlabs-haskell/json-bigint/-/json-bigint-2.0.0.tgz", "integrity": "sha512-JX9TON+nZbt+1TJ5MNV1Gcpxp3/m56x1/glDwzGtydrzQzyZbKg4XFw9Frib6fh89YVqjSFJ9xmVeIyDJ5DxTQ==" }, + "@mlabs-haskell/uplc-apply-args": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@mlabs-haskell/uplc-apply-args/-/uplc-apply-args-1.0.0.tgz", + "integrity": "sha512-jygKgElPSmrjBifiec8lLAjcKAPDOvDTv0hCW6jfX+/hnlaI8p9w5amv6jeCMmnr3/ncRzE9JrcuVJoB5lBwLA==", + "requires": { + "apply-args-browser": "^0.0.1", + "apply-args-nodejs": "^0.0.1" + } + }, "@noble/hashes": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", @@ -7051,6 +7075,12 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "@zxing/text-encoding": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", + "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", + "optional": true + }, "abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -7215,8 +7245,7 @@ "available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" }, "bail": { "version": "1.0.5", @@ -7538,7 +7567,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -8422,7 +8450,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, "requires": { "is-callable": "^1.1.3" } @@ -8471,14 +8498,12 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "get-intrinsic": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -8526,7 +8551,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, "requires": { "get-intrinsic": "^1.1.3" } @@ -8547,7 +8571,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -8570,20 +8593,17 @@ "has-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" }, "has-tostringtag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, "requires": { "has-symbols": "^1.0.2" } @@ -8849,7 +8869,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -8873,8 +8892,7 @@ "is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==" }, "is-core-module": { "version": "2.13.0", @@ -8907,7 +8925,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -8968,7 +8985,6 @@ "version": "1.1.12", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", - "dev": true, "requires": { "which-typed-array": "^1.1.11" } @@ -9000,6 +9016,12 @@ "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true }, + "isomorphic-ws": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", + "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", + "requires": {} + }, "jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -10698,7 +10720,6 @@ "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dev": true, "requires": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -10777,6 +10798,15 @@ "minimalistic-assert": "^1.0.0" } }, + "web-encoding": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", + "integrity": "sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==", + "requires": { + "@zxing/text-encoding": "0.9.0", + "util": "^0.12.3" + } + }, "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -10973,13 +11003,6 @@ "ajv-formats": "^2.1.1", "ajv-keywords": "^5.1.0" } - }, - "ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "dev": true, - "requires": {} } } }, @@ -11038,7 +11061,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", - "dev": true, "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -11059,9 +11081,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "ws": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.4.0.tgz", - "integrity": "sha512-IHVsKe2pjajSUIl4KYMQOdlyliovpEPquKkqbwswulszzI7r0SfQrxnXdWAEqOlDCLrVSJzo+O1hAwdog2sKSQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", "requires": {} }, "xhr2": { diff --git a/package.json b/package.json index 2774857382..2a4240b910 100755 --- a/package.json +++ b/package.json @@ -34,24 +34,24 @@ "author": "", "license": "MIT", "dependencies": { - "@emurgo/cardano-message-signing-browser": "1.0.1", - "@emurgo/cardano-message-signing-nodejs": "1.0.1", + "@mlabs-haskell/cardano-message-signing": "1.0.1", "@mlabs-haskell/cardano-serialization-lib-gc": "^1.0.9", "@mlabs-haskell/json-bigint": "2.0.0", + "@mlabs-haskell/uplc-apply-args": "1.0.0", "@noble/secp256k1": "^1.7.0", - "apply-args-browser": "0.0.1", - "apply-args-nodejs": "0.0.1", "base64-js": "^1.5.1", "bignumber.js": "^9.1.1", "bip39": "^3.1.0", "blakejs": "1.2.1", "bufferutil": "4.0.5", + "isomorphic-ws": "^5.0.0", "jssha": "3.2.0", "puppeteer-core": "^15.3.2", "reconnecting-websocket": "4.4.0", "uniqid": "5.4.0", "utf-8-validate": "^5.0.10", - "ws": "8.4.0", + "web-encoding": "^1.1.5", + "ws": "^8.16.0", "xhr2": "0.2.1" }, "devDependencies": { diff --git a/src/Internal/Affjax.js b/src/Internal/Affjax.js index 83a9091df4..5df9db273a 100644 --- a/src/Internal/Affjax.js +++ b/src/Internal/Affjax.js @@ -1,21 +1,6 @@ -/* global BROWSER_RUNTIME */ +export const driver = nodeDriver; -export const driver = async () => { - if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) { - return browserDriver; - } else { - return await nodeDriver(); - } -}; - -const browserDriver = { - newXHR: function () { - return new XMLHttpRequest(); - }, - fixupUrl: function (url) { - return url || "/"; - } -}; +// we rely on the bundler to inject polyfills for the browser async function nodeDriver() { const { default: XHR } = await import("xhr2"); diff --git a/src/Internal/ApplyArgs.js b/src/Internal/ApplyArgs.js index bc93f773da..5866d7bf74 100644 --- a/src/Internal/ApplyArgs.js +++ b/src/Internal/ApplyArgs.js @@ -1,13 +1,5 @@ -/* global BROWSER_RUNTIME */ - import * as lib from "@mlabs-haskell/cardano-serialization-lib-gc"; - -let apply_args; -if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) { - apply_args = await import("apply-args-browser"); -} else { - apply_args = await import("apply-args-nodejs"); -} +import * as apply_args from "@mlabs-haskell/uplc-apply-args"; /** * @param {} left diff --git a/src/Internal/JsWebSocket.js b/src/Internal/JsWebSocket.js index f48f4465c3..e05ce2748c 100644 --- a/src/Internal/JsWebSocket.js +++ b/src/Internal/JsWebSocket.js @@ -1,16 +1,7 @@ -/* global BROWSER_RUNTIME */ - import ReconnectingWebSocket from "reconnecting-websocket"; +import WebSocket from "isomorphic-ws"; -let OurWebSocket; -if (typeof BROWSER_RUNTIME == "undefined" || !BROWSER_RUNTIME) { - const { default: WebSocket } = await import("ws"); - OurWebSocket = WebSocket; -} else { - OurWebSocket = WebSocket; -} - -class NoPerMessageDeflateWebSocket extends OurWebSocket { +class NoPerMessageDeflateWebSocket extends WebSocket { constructor(url, protocols, options) { options = options || {}; options.perMessageDeflate = false; @@ -21,14 +12,9 @@ class NoPerMessageDeflateWebSocket extends OurWebSocket { export function _mkWebSocket(logger) { return url => () => { try { - let ws; - if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) { - ws = new ReconnectingWebSocket(url); - } else { - ws = new ReconnectingWebSocket(url, [], { - WebSocket: NoPerMessageDeflateWebSocket - }); - } + const ws = new ReconnectingWebSocket(url, [], { + WebSocket: NoPerMessageDeflateWebSocket + }); ws.finalizers = []; logger("Created a new WebSocket")(); return ws; diff --git a/src/Internal/Types/TokenName.js b/src/Internal/Types/TokenName.js index f432d39277..06d29c9c9f 100644 --- a/src/Internal/Types/TokenName.js +++ b/src/Internal/Types/TokenName.js @@ -1,17 +1,8 @@ -/* global BROWSER_RUNTIME */ - -// `TextDecoder` is not available in `node`, use polyfill in that case -let OurTextDecoder; -if (typeof BROWSER_RUNTIME == "undefined" || !BROWSER_RUNTIME) { - const util = await import("util"); - OurTextDecoder = util.TextDecoder; -} else { - OurTextDecoder = TextDecoder; -} +import { TextDecoder } from "web-encoding"; export function _decodeUtf8(buffer) { return left => right => { - let decoder = new OurTextDecoder("utf-8", { fatal: true }); // Without fatal=true it never fails + let decoder = new TextDecoder("utf-8", { fatal: true }); // Without fatal=true it never fails try { return right(decoder.decode(buffer)); diff --git a/src/Internal/Wallet/Cip30/SignData.js b/src/Internal/Wallet/Cip30/SignData.js index b105a9ee30..ee0d75d58b 100644 --- a/src/Internal/Wallet/Cip30/SignData.js +++ b/src/Internal/Wallet/Cip30/SignData.js @@ -1,11 +1,4 @@ -/* global BROWSER_RUNTIME */ - -let lib; -if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) { - lib = await import("@emurgo/cardano-message-signing-browser"); -} else { - lib = await import("@emurgo/cardano-message-signing-nodejs"); -} +import * as lib from "@mlabs-haskell/cardano-message-signing"; // ----------------------------------------------------------------------------- // COSESign1Builder diff --git a/templates/ctl-scaffold/Makefile b/templates/ctl-scaffold/Makefile index 3867c13199..64274909fa 100644 --- a/templates/ctl-scaffold/Makefile +++ b/templates/ctl-scaffold/Makefile @@ -13,7 +13,8 @@ js-sources := $(shell fd --no-ignore-parent -ejs -ecjs) ps-entrypoint := Scaffold.Test.E2E.Serve # The entry point function in the main PureScript module ps-entrypoint-function := main -# Whether to bundle for the browser +# Whether to bundle for the browser ("1") or the node ("") +# NOTE: bundling for the node is not necessary, see https://github.com/Plutonomicon/cardano-transaction-lib/blob/develop/doc/using-from-js.md browser-runtime := 1 # Use "1" for true and "" for false preview-node-ipc = $(shell docker volume inspect store_node-preview-ipc | jq -r '.[0].Mountpoint') diff --git a/templates/ctl-scaffold/esbuild/config.js b/templates/ctl-scaffold/esbuild/config.js index 996ca4335f..bf23f5fb4c 100755 --- a/templates/ctl-scaffold/esbuild/config.js +++ b/templates/ctl-scaffold/esbuild/config.js @@ -7,9 +7,6 @@ export const buildOptions = ({ entryPoint, outfile }) => { const config = { entryPoints: [entryPoint], outfile: outfile, - define: { - BROWSER_RUNTIME: isBrowser ? "true" : '""', - }, plugins: [ wasmLoader({ mode: "deferred", @@ -24,8 +21,10 @@ export const buildOptions = ({ entryPoint, outfile }) => { // https://esbuild.github.io/api/#packages if (!isBrowser) { + // Keep dependencies outside of the bundle for nodejs config.packages = "external"; } else { + // Provide browser polyfills for NodeJS modules config.plugins.push( polyfillNode({ polyfills: { diff --git a/templates/ctl-scaffold/flake.lock b/templates/ctl-scaffold/flake.lock index 6f82969c7f..787950979a 100644 --- a/templates/ctl-scaffold/flake.lock +++ b/templates/ctl-scaffold/flake.lock @@ -1686,17 +1686,17 @@ "plutip": "plutip" }, "locked": { - "lastModified": 1707923074, - "narHash": "sha256-JdUKKiAI90oAxpl/4hyvQWXtYbWEa/HKdpF2N2H2qA8=", + "lastModified": 1708456391, + "narHash": "sha256-NpdCzU5ZrN+appoytN/H0V9tWjo6SrGL3krYKIzqYfo=", "owner": "Plutonomicon", "repo": "cardano-transaction-lib", - "rev": "aac3736387dec3d22c7a3222d46244911b283856", + "rev": "20535070047381bea129a4130aaee23db2439fa6", "type": "github" }, "original": { "owner": "Plutonomicon", "repo": "cardano-transaction-lib", - "rev": "aac3736387dec3d22c7a3222d46244911b283856", + "rev": "20535070047381bea129a4130aaee23db2439fa6", "type": "github" } }, diff --git a/templates/ctl-scaffold/flake.nix b/templates/ctl-scaffold/flake.nix index 3c04a27538..eb263393ca 100644 --- a/templates/ctl-scaffold/flake.nix +++ b/templates/ctl-scaffold/flake.nix @@ -16,7 +16,7 @@ type = "github"; owner = "Plutonomicon"; repo = "cardano-transaction-lib"; - rev = "aac3736387dec3d22c7a3222d46244911b283856"; + rev = "20535070047381bea129a4130aaee23db2439fa6"; }; # To use the same version of `nixpkgs` as we do nixpkgs.follows = "ctl/nixpkgs"; diff --git a/templates/ctl-scaffold/package-lock.json b/templates/ctl-scaffold/package-lock.json index 5ac6f4f09e..1d0aec0d47 100644 --- a/templates/ctl-scaffold/package-lock.json +++ b/templates/ctl-scaffold/package-lock.json @@ -9,24 +9,24 @@ "version": "0.1.0", "license": "MIT", "dependencies": { - "@emurgo/cardano-message-signing-browser": "1.0.1", - "@emurgo/cardano-message-signing-nodejs": "1.0.1", + "@mlabs-haskell/cardano-message-signing": "1.0.1", "@mlabs-haskell/cardano-serialization-lib-gc": "^1.0.9", "@mlabs-haskell/json-bigint": "2.0.0", + "@mlabs-haskell/uplc-apply-args": "1.0.0", "@noble/secp256k1": "^1.7.0", - "apply-args-browser": "0.0.1", - "apply-args-nodejs": "0.0.1", "base64-js": "^1.5.1", "bignumber.js": "^9.1.1", "bip39": "^3.1.0", "blakejs": "1.2.1", "bufferutil": "4.0.5", + "isomorphic-ws": "^5.0.0", "jssha": "3.2.0", "puppeteer-core": "^15.3.2", "reconnecting-websocket": "4.4.0", "uniqid": "5.4.0", "utf-8-validate": "^5.0.10", - "ws": "8.4.0", + "web-encoding": "^1.1.5", + "ws": "^8.16.0", "xhr2": "0.2.1" }, "devDependencies": { @@ -491,6 +491,15 @@ "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", "dev": true }, + "node_modules/@mlabs-haskell/cardano-message-signing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@mlabs-haskell/cardano-message-signing/-/cardano-message-signing-1.0.1.tgz", + "integrity": "sha512-LNX+Msq1rJ86d5mmaR2Om5tUqB0ZthfE69fpsZcxOYDHNw5s+qtcCyNEmzAWfHC+uIJ4NDEJA8Gk2RfWto7ChA==", + "dependencies": { + "@emurgo/cardano-message-signing-browser": "^1.0.1", + "@emurgo/cardano-message-signing-nodejs": "^1.0.1" + } + }, "node_modules/@mlabs-haskell/cardano-serialization-lib-gc": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@mlabs-haskell/cardano-serialization-lib-gc/-/cardano-serialization-lib-gc-1.0.9.tgz", @@ -511,6 +520,15 @@ "resolved": "https://registry.npmjs.org/@mlabs-haskell/json-bigint/-/json-bigint-2.0.0.tgz", "integrity": "sha512-JX9TON+nZbt+1TJ5MNV1Gcpxp3/m56x1/glDwzGtydrzQzyZbKg4XFw9Frib6fh89YVqjSFJ9xmVeIyDJ5DxTQ==" }, + "node_modules/@mlabs-haskell/uplc-apply-args": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@mlabs-haskell/uplc-apply-args/-/uplc-apply-args-1.0.0.tgz", + "integrity": "sha512-jygKgElPSmrjBifiec8lLAjcKAPDOvDTv0hCW6jfX+/hnlaI8p9w5amv6jeCMmnr3/ncRzE9JrcuVJoB5lBwLA==", + "dependencies": { + "apply-args-browser": "^0.0.1", + "apply-args-nodejs": "^0.0.1" + } + }, "node_modules/@noble/hashes": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", @@ -931,6 +949,12 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "node_modules/@zxing/text-encoding": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", + "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", + "optional": true + }, "node_modules/abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -1127,7 +1151,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -1543,7 +1566,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -2503,7 +2525,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, "dependencies": { "is-callable": "^1.1.3" } @@ -2559,14 +2580,12 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/get-intrinsic": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -2632,7 +2651,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -2656,7 +2674,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -2689,7 +2706,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -2701,7 +2717,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -2713,7 +2728,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -3032,7 +3046,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -3060,7 +3073,6 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -3108,7 +3120,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, "dependencies": { "has-tostringtag": "^1.0.0" }, @@ -3184,7 +3195,6 @@ "version": "1.1.12", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", - "dev": true, "dependencies": { "which-typed-array": "^1.1.11" }, @@ -3228,6 +3238,14 @@ "node": ">=0.10.0" } }, + "node_modules/isomorphic-ws": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", + "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", + "peerDependencies": { + "ws": "*" + } + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -4979,7 +4997,6 @@ "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dev": true, "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -5048,6 +5065,17 @@ "minimalistic-assert": "^1.0.0" } }, + "node_modules/web-encoding": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", + "integrity": "sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==", + "dependencies": { + "util": "^0.12.3" + }, + "optionalDependencies": { + "@zxing/text-encoding": "0.9.0" + } + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -5342,27 +5370,6 @@ "url": "https://opencollective.com/webpack" } }, - "node_modules/webpack-dev-server/node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/webpack-merge": { "version": "5.9.0", "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.9.0.tgz", @@ -5436,7 +5443,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", - "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -5463,15 +5469,15 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.4.0.tgz", - "integrity": "sha512-IHVsKe2pjajSUIl4KYMQOdlyliovpEPquKkqbwswulszzI7r0SfQrxnXdWAEqOlDCLrVSJzo+O1hAwdog2sKSQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", "engines": { "node": ">=10.0.0" }, "peerDependencies": { "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "utf-8-validate": ">=5.0.2" }, "peerDependenciesMeta": { "bufferutil": { @@ -5751,6 +5757,15 @@ "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==", "dev": true }, + "@mlabs-haskell/cardano-message-signing": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@mlabs-haskell/cardano-message-signing/-/cardano-message-signing-1.0.1.tgz", + "integrity": "sha512-LNX+Msq1rJ86d5mmaR2Om5tUqB0ZthfE69fpsZcxOYDHNw5s+qtcCyNEmzAWfHC+uIJ4NDEJA8Gk2RfWto7ChA==", + "requires": { + "@emurgo/cardano-message-signing-browser": "^1.0.1", + "@emurgo/cardano-message-signing-nodejs": "^1.0.1" + } + }, "@mlabs-haskell/cardano-serialization-lib-gc": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@mlabs-haskell/cardano-serialization-lib-gc/-/cardano-serialization-lib-gc-1.0.9.tgz", @@ -5771,6 +5786,15 @@ "resolved": "https://registry.npmjs.org/@mlabs-haskell/json-bigint/-/json-bigint-2.0.0.tgz", "integrity": "sha512-JX9TON+nZbt+1TJ5MNV1Gcpxp3/m56x1/glDwzGtydrzQzyZbKg4XFw9Frib6fh89YVqjSFJ9xmVeIyDJ5DxTQ==" }, + "@mlabs-haskell/uplc-apply-args": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@mlabs-haskell/uplc-apply-args/-/uplc-apply-args-1.0.0.tgz", + "integrity": "sha512-jygKgElPSmrjBifiec8lLAjcKAPDOvDTv0hCW6jfX+/hnlaI8p9w5amv6jeCMmnr3/ncRzE9JrcuVJoB5lBwLA==", + "requires": { + "apply-args-browser": "^0.0.1", + "apply-args-nodejs": "^0.0.1" + } + }, "@noble/hashes": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", @@ -6156,6 +6180,12 @@ "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", "dev": true }, + "@zxing/text-encoding": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz", + "integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==", + "optional": true + }, "abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -6311,8 +6341,7 @@ "available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", - "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", - "dev": true + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" }, "balanced-match": { "version": "1.0.2", @@ -6628,7 +6657,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "dev": true, "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -7396,7 +7424,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, "requires": { "is-callable": "^1.1.3" } @@ -7439,14 +7466,12 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "get-intrinsic": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", - "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -7494,7 +7519,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, "requires": { "get-intrinsic": "^1.1.3" } @@ -7515,7 +7539,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -7538,20 +7561,17 @@ "has-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" }, "has-tostringtag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", - "dev": true, "requires": { "has-symbols": "^1.0.2" } @@ -7789,7 +7809,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, "requires": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -7807,8 +7826,7 @@ "is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==" }, "is-core-module": { "version": "2.13.0", @@ -7835,7 +7853,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, "requires": { "has-tostringtag": "^1.0.0" } @@ -7884,7 +7901,6 @@ "version": "1.1.12", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", - "dev": true, "requires": { "which-typed-array": "^1.1.11" } @@ -7916,6 +7932,12 @@ "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true }, + "isomorphic-ws": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", + "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", + "requires": {} + }, "jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -9272,7 +9294,6 @@ "version": "0.12.5", "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dev": true, "requires": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", @@ -9329,6 +9350,15 @@ "minimalistic-assert": "^1.0.0" } }, + "web-encoding": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.5.tgz", + "integrity": "sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==", + "requires": { + "@zxing/text-encoding": "0.9.0", + "util": "^0.12.3" + } + }, "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -9525,13 +9555,6 @@ "ajv-formats": "^2.1.1", "ajv-keywords": "^5.1.0" } - }, - "ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", - "dev": true, - "requires": {} } } }, @@ -9590,7 +9613,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", - "dev": true, "requires": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -9611,9 +9633,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "ws": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.4.0.tgz", - "integrity": "sha512-IHVsKe2pjajSUIl4KYMQOdlyliovpEPquKkqbwswulszzI7r0SfQrxnXdWAEqOlDCLrVSJzo+O1hAwdog2sKSQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", "requires": {} }, "xhr2": { diff --git a/templates/ctl-scaffold/package.json b/templates/ctl-scaffold/package.json index fbaf0c66d4..21e7af5606 100644 --- a/templates/ctl-scaffold/package.json +++ b/templates/ctl-scaffold/package.json @@ -3,7 +3,7 @@ "name": "ctl-scaffold", "version": "0.1.0", "description": "", - "main": "index.js", + "main": "./output/Scaffold.Main/index.js", "directories": { "test": "test" }, @@ -25,24 +25,24 @@ "author": "", "license": "MIT", "dependencies": { - "@emurgo/cardano-message-signing-browser": "1.0.1", - "@emurgo/cardano-message-signing-nodejs": "1.0.1", + "@mlabs-haskell/cardano-message-signing": "1.0.1", "@mlabs-haskell/cardano-serialization-lib-gc": "^1.0.9", "@mlabs-haskell/json-bigint": "2.0.0", + "@mlabs-haskell/uplc-apply-args": "1.0.0", "@noble/secp256k1": "^1.7.0", - "apply-args-browser": "0.0.1", - "apply-args-nodejs": "0.0.1", "base64-js": "^1.5.1", "bignumber.js": "^9.1.1", "bip39": "^3.1.0", "blakejs": "1.2.1", "bufferutil": "4.0.5", + "isomorphic-ws": "^5.0.0", "jssha": "3.2.0", "puppeteer-core": "^15.3.2", "reconnecting-websocket": "4.4.0", "uniqid": "5.4.0", "utf-8-validate": "^5.0.10", - "ws": "8.4.0", + "web-encoding": "^1.1.5", + "ws": "^8.16.0", "xhr2": "0.2.1" }, "devDependencies": { diff --git a/templates/ctl-scaffold/packages.dhall b/templates/ctl-scaffold/packages.dhall index 436bf579c6..dd2cb6a935 100644 --- a/templates/ctl-scaffold/packages.dhall +++ b/templates/ctl-scaffold/packages.dhall @@ -298,7 +298,7 @@ let additions = , "web-storage" ] , repo = "https://github.com/Plutonomicon/cardano-transaction-lib.git" - , version = "aac3736387dec3d22c7a3222d46244911b283856" + , version = "20535070047381bea129a4130aaee23db2439fa6" } , js-bigints = { dependencies = [ "integers", "maybe", "prelude" ] diff --git a/templates/ctl-scaffold/spago-packages.nix b/templates/ctl-scaffold/spago-packages.nix index d6a1bba1aa..f193eb6b68 100644 --- a/templates/ctl-scaffold/spago-packages.nix +++ b/templates/ctl-scaffold/spago-packages.nix @@ -199,11 +199,11 @@ let "cardano-transaction-lib" = pkgs.stdenv.mkDerivation { name = "cardano-transaction-lib"; - version = "aac3736387dec3d22c7a3222d46244911b283856"; + version = "20535070047381bea129a4130aaee23db2439fa6"; src = pkgs.fetchgit { url = "https://github.com/Plutonomicon/cardano-transaction-lib.git"; - rev = "aac3736387dec3d22c7a3222d46244911b283856"; - sha256 = "03x8yrhkfxlifv5g2sw4nmhysra1mwff4zwrqq04mxq840m0mm95"; + rev = "20535070047381bea129a4130aaee23db2439fa6"; + sha256 = "1yk1xa62in2avs5v2jis79d6spyiqzgv8clslsddzb2r9v6l55rn"; }; phases = "installPhase"; installPhase = "ln -s $src $out"; diff --git a/templates/ctl-scaffold/webpack.config.cjs b/templates/ctl-scaffold/webpack.config.cjs index d5fcdf1c63..1ccf6e5ba3 100644 --- a/templates/ctl-scaffold/webpack.config.cjs +++ b/templates/ctl-scaffold/webpack.config.cjs @@ -14,6 +14,7 @@ module.exports = env => { layers: false, lazyCompilation: false, outputModule: true, + // `syncWebAssembly` must be set to `true` because CTL internal code expects it. syncWebAssembly: true, topLevelAwait: true, }, @@ -58,9 +59,6 @@ module.exports = env => { }, plugins: [ - new webpack.DefinePlugin({ - BROWSER_RUNTIME: isBrowser, - }), new webpack.LoaderOptionsPlugin({ debug: true, }), diff --git a/test/CslGc.js b/test/CslGc.js index bac78951b6..43539ec39a 100644 --- a/test/CslGc.js +++ b/test/CslGc.js @@ -1,4 +1,3 @@ -/* global BROWSER_RUNTIME */ import * as lib from "@mlabs-haskell/cardano-serialization-lib-gc"; import process from "process"; diff --git a/test/Wallet/Cip30/SignData.js b/test/Wallet/Cip30/SignData.js index 20554c46c6..353135d766 100644 --- a/test/Wallet/Cip30/SignData.js +++ b/test/Wallet/Cip30/SignData.js @@ -1,13 +1,5 @@ -/* global BROWSER_RUNTIME */ - import * as csl from "@mlabs-haskell/cardano-serialization-lib-gc"; - -let lib; -if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) { - lib = await import("@emurgo/cardano-message-signing-browser"); -} else { - lib = await import("@emurgo/cardano-message-signing-nodejs"); -} +import * as lib from "@mlabs-haskell/cardano-message-signing"; function opt_chain(maybe, obj) { const isNothing = x => x === null || x === undefined; diff --git a/webpack.config.cjs b/webpack.config.cjs index 31f7f3ba7c..e3a4280e2a 100644 --- a/webpack.config.cjs +++ b/webpack.config.cjs @@ -14,6 +14,7 @@ module.exports = env => { layers: false, lazyCompilation: false, outputModule: true, + // `syncWebAssembly` must be set to `true` because CTL internal code expects it. syncWebAssembly: true, topLevelAwait: true }, @@ -58,9 +59,6 @@ module.exports = env => { }, plugins: [ - new webpack.DefinePlugin({ - BROWSER_RUNTIME: isBrowser - }), new webpack.LoaderOptionsPlugin({ debug: true }),