Cardano JS SDK
A suite of TypeScript packages suitable for both Node.js and browser-based development.
ℹ️ Looking to use a Cardano service not listed here? Let us know!
You may use the following config when bundling this SDK with Webpack:
const { IgnorePlugin, ProvidePlugin } = require('webpack');
{
plugins: [
// see https://www.npmjs.com/package/bip39 README
new IgnorePlugin(/^\.\/wordlists\/(?!english)/, /bip39\/src$/),
],
experiments: {
// Requires code splitting to work.
// Must dynamically `import()` a chunk that imports '@cardano-sdk/*'.
syncWebAssembly: true
}
}
Additionally, for browser builds:
const { NormalModuleReplacementPlugin } = require('webpack');
{
resolve: {
fallback: {
// Node.js polyfills. May want to install as explicit dependencies.
stream: require.resolve('readable-stream'),
buffer: require.resolve('buffer'),
}
},
plugins: [
// install "browser" version packages of these dependencies first
new NormalModuleReplacementPlugin(
/@emurgo\/cardano-serialization-lib-nodejs/,
'@emurgo/cardano-serialization-lib-browser'
),
new NormalModuleReplacementPlugin(
/@emurgo\/cardano-message-signing-nodejs/,
'@emurgo/cardano-message-signing-browser'
)
]
}
A Yarn Workspace maintaining a single version across all packages.
- Docker
17.12.0
+ - Docker Compose
yarn install && \
yarn build
yarn testnet:up
In another terminal
yarn test
or
yarn test:debug
yarn lint
yarn cleanup
./scripts/pack.sh
./scripts/publish.sh
yarn docs
yarn bump-version
Then update the sibling dependencies manually.
- Extend packageMap in .versionrc.js
- Extend pack.sh
- Extend publish.sh