From 7fd2f6d9e3cd963c82fe0b98f456c30f69c17c84 Mon Sep 17 00:00:00 2001 From: johnquinnvictaboada Date: Thu, 19 Sep 2024 05:35:05 +0800 Subject: [PATCH 1/2] chore: updated blaze docs --- docs/pages/apis/blaze.mdx | 109 +++- examples/blaze-client/index.ts | 83 ++- examples/blaze-client/package-lock.json | 657 ++++++++++++++++++++++-- examples/blaze-client/package.json | 8 +- 4 files changed, 768 insertions(+), 89 deletions(-) diff --git a/docs/pages/apis/blaze.mdx b/docs/pages/apis/blaze.mdx index 62d1d119..d8f46abe 100644 --- a/docs/pages/apis/blaze.mdx +++ b/docs/pages/apis/blaze.mdx @@ -5,35 +5,108 @@ import { Callout } from "nextra/components"; Blaze is a NodeJS library for creating Cardano transactions and off-chain code for your Aiken contracts in JavaScript. You can learn more about Blaze [in their documentation site](https://blaze.butane.dev/). -Blaze supports multiple backend providers for interacting with the Cardano network. One of those providers is `U5C` (short for UtxoRPC) which is one of the APIs suppored by Dolos. You can learn more about U5C in the [U5C documentation](./grpc.mdx). +Blaze supports multiple backend providers for interacting with the Cardano network. One of those providers is `U5C` (short for UtxoRPC) which is one of the APIs supported by Dolos. You can learn more about U5C in the [U5C documentation](./grpc.mdx). -## Example +## Installation -The following example demonstrates how to use the Blaze SDK to query UTXOs for a given address using a local Dolos instance. +To install the UTxORPC provider for blaze, use npm: -```ts -// Import Blaze SDK and U5C provider -import { Core, U5C } from "@blaze-cardano/sdk"; +```bash +npm install @utxorpc/blaze-provider +``` + +You also need to install the **Blaze SDK**: + +```bash +npm install @blaze-cardano/sdk +``` + +## Sample Usage + +### Step 1: Import Blaze SDK and the UTxORPC Provider for Blaze + +```javascript +import { + Bip32PrivateKey, + mnemonicToEntropy, + wordlist, +} from "@blaze-cardano/core"; +import { + HotWallet, + Core, + Blaze, +} from "@blaze-cardano/sdk"; +import { U5C } from "@utxorpc/blaze-provider"; +``` -// Create a new U5C provider pointing to the local Dolos instance +### Step 2: Create a New U5C Provider with Dolos +Now this is where we can utilize our local Dolos node and use it for our UTxORPC provider. We can initiliaze our node through this [link](/quickstart). + +Here's how to create the U5C Provider: +```javascript const provider = new U5C({ - url: "http://localhost:50051", + url: "http://localhost:50051", }); +``` -// Query Utxos for the given address (the address in the example is a preview address randomly chosen from an explorer, use your own address) -const utxos = await provider.getUnspentOutputs( - Core.Address.fromBech32( - "addr_test1vpetczxy5uc9tkkqhrxgj6t0sggthyg8dd0qp22fte6wdtgvau4rn" - ) -); +### Step 3: Create a New Wallet from a Mnemonic -// Log the UTXOs to the console -utxos.map((utxo) => { - console.log(utxo.toCbor()); -}); +```javascript +const mnemonic = "your 24-word mnemonic here"; +const entropy = mnemonicToEntropy(mnemonic, wordlist); +const masterkey = Bip32PrivateKey.fromBip39Entropy(Buffer.from(entropy), ""); +const wallet = await HotWallet.fromMasterkey(masterkey.hex(), provider); +``` + +### Step 4: Create a Blaze Instance from the Wallet and Provider + +```javascript +const blaze = await Blaze.from(provider, wallet); ``` +Optional: Print the wallet address + +```javascript +console.log("Wallet address", wallet.address.toBech32()); +``` + +Optional: Print the wallet balance + +```javascript +console.log("Wallet balance", (await wallet.getBalance()).toCore()); +``` + +### Step 5: Create an Example Transaction + +```javascript +const tx = await blaze + .newTransaction() + .payLovelace( + Core.Address.fromBech32( + "addr_test1qrnrqg4s73skqfyyj69mzr7clpe8s7ux9t8z6l55x2f2xuqra34p9pswlrq86nq63hna7p4vkrcrxznqslkta9eqs2nsmlqvnk", + ), + 5_000_000n, + ) + .complete(); +``` + +### Step 6: Sign the Transaction + +```javascript +const signedTx = await blaze.signTransaction(tx); +``` + +### Step 7: Submit the Transaction to the Blockchain Network + +```javascript +const txId = await blaze.provider.postTransactionToChain(signedTx); +``` + +## Conclusion + +This showcases a use-case for Dolos which is through The **UTxORPC (u5c)** provider for [Blaze](https://github.com/butaneprotocol/blaze-cardano). For further customization and advanced usage, refer to the documentation for [Blaze](https://github.com/butaneprotocol/blaze-cardano). By understanding and utilizing these tools, you can develop robust applications that interact with Cardano efficiently. Check the [Blaze client example](https://github.com/txpipe/dolos/tree/main/examples/blaze-client) in the Dolos repository for a working version of the above snippet. + diff --git a/examples/blaze-client/index.ts b/examples/blaze-client/index.ts index fff4a913..30274bef 100644 --- a/examples/blaze-client/index.ts +++ b/examples/blaze-client/index.ts @@ -1,19 +1,66 @@ +// Step #1 // Import Blaze SDK and U5C provider -import { Core, U5C } from "@blaze-cardano/sdk"; - -// Create a new U5C provider pointing to the local Dolos instance -const provider = new U5C({ - url: "http://localhost:50051", -}); - -// Query Utxos for the given address (the address in the example is a preview address randomly chosen from an explorer, use your own address) -const utxos = await provider.getUnspentOutputs( - Core.Address.fromBech32( - "addr_test1vpetczxy5uc9tkkqhrxgj6t0sggthyg8dd0qp22fte6wdtgvau4rn" - ) -); - -// Log the UTXOs to the console -utxos.map((utxo) => { - console.log(utxo.toCbor()); -}); +import { + Bip32PrivateKey, + mnemonicToEntropy, + wordlist, +} from "@blaze-cardano/core"; +import { HotWallet, Core, Blaze } from "@blaze-cardano/sdk"; +import { U5C } from "@utxorpc/blaze-provider"; + +async function main() { + // Step #2 + // Create a new U5C provider + // In this example we use Demeter hosted UTXO provider + // but you can run a local Dolos https://github.com/txpipe/dolos instance and connect to its UTxO endpoint + // If this is the case then you can remove the headers field + const provider = new U5C({ + url: "https://preview.utxorpc-v0.demeter.run", + headers: { + "dmtr-api-key": "dmtr_utxorpc19r0r7x8stkzejplyyra8n6d70gw276un", + }, + }); + + // Step #3 + // Create a new wallet from a mnemonic + const mnemonic = + "end link visit estate sock hurt crucial forum eagle earn idle laptop wheat rookie when hard suffer duty kingdom clerk glide mechanic debris jar"; + const entropy = mnemonicToEntropy(mnemonic, wordlist); + const masterkey = Bip32PrivateKey.fromBip39Entropy(Buffer.from(entropy), ""); + const wallet = await HotWallet.fromMasterkey(masterkey.hex(), provider); + + // Step #4 + // Create a Blaze instance from the wallet and provider + const blaze = await Blaze.from(provider, wallet); + + // Optional: Print the wallet address + console.log("Wallet address", wallet.address.toBech32()); + + // Optional: Print the wallet balance + console.log("Wallet balance", (await wallet.getBalance()).toCore()); + + // Step #5 + // Create a example transaction that sends 5 ADA to an address + const tx = await blaze + .newTransaction() + .payLovelace( + Core.Address.fromBech32( + "addr_test1qrnrqg4s73skqfyyj69mzr7clpe8s7ux9t8z6l55x2f2xuqra34p9pswlrq86nq63hna7p4vkrcrxznqslkta9eqs2nsmlqvnk", + ), + 5_000_000n, + ) + .complete(); + + // Step #6 + // Sign the transaction + const signexTx = await blaze.signTransaction(tx); + + // Step #7 + // Submit the transaction to the blockchain network + const txId = await blaze.provider.postTransactionToChain(signexTx); + + // Optional: Print the transaction ID + console.log("Transaction ID", txId); +} + +main().catch(console.error); diff --git a/examples/blaze-client/package-lock.json b/examples/blaze-client/package-lock.json index c41ec221..4800aed1 100644 --- a/examples/blaze-client/package-lock.json +++ b/examples/blaze-client/package-lock.json @@ -9,10 +9,12 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@blaze-cardano/sdk": "^0.1.24" + "@blaze-cardano/sdk": "^0.1.24", + "@utxorpc/blaze-provider": "^0.2.0" }, "devDependencies": { - "esrun": "^3.2.26" + "esrun": "^3.2.26", + "tsx": "^4.19.0" } }, "node_modules/@balena/dockerignore": { @@ -37,9 +39,9 @@ } }, "node_modules/@blaze-cardano/core": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@blaze-cardano/core/-/core-0.4.3.tgz", - "integrity": "sha512-E22xN2n0rQC0lBaeW2EXMSnGdn+bzh0rq90pgEtKbGn09nkuA56pwLlf2fn8BdqQ2qOPpXAshl/3rQFCaPGNjw==", + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/@blaze-cardano/core/-/core-0.4.5.tgz", + "integrity": "sha512-2JGV/DhAH8x/lXboPIpD7//OLhIYSMCzRmFeQvwefjB/p214h3TpFGonc0dvna7epTgu3sz/Qas0ycz6bSEdfA==", "dependencies": { "@cardano-sdk/core": "^0.35.4", "@cardano-sdk/crypto": "^0.1.28", @@ -57,72 +59,77 @@ "integrity": "sha512-q/0BzXoN+PP4kcwmqthJEYrQ1ee3pZ1Y2dV7X7levyccX8yVMxgMUvJjXhZKl0Bb9g8JidoxanVaBW0d0Y0mSw==" }, "node_modules/@blaze-cardano/ogmios": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@blaze-cardano/ogmios/-/ogmios-0.0.5.tgz", - "integrity": "sha512-mWMiXD3hTYm+uxnANMLf5JfvJpqmNtJ05YW3YFLtYx32pMnXBjUToBfZ9N97OazjLjt1Hwd09jUn6HyAo81fnA==", + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@blaze-cardano/ogmios/-/ogmios-0.0.6.tgz", + "integrity": "sha512-MWioP66+ZRmNSojB94AQAiPoeznN23ZJ3qgjb54acw1Dcx6CFuwZTaRPKlYpYB/gB4mvNdLdQQCPNKYTJBAVxw==", "dependencies": { - "@cardano-ogmios/schema": "^6.4.0", + "@cardano-ogmios/schema": "^6.6.1", "isomorphic-ws": "^5.0.0" } }, "node_modules/@blaze-cardano/query": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/@blaze-cardano/query/-/query-0.2.13.tgz", - "integrity": "sha512-oiDoUG/McnU0iVxtOVQWZI0qv21c+J9YPPqm/wxOWoHwo1DT46b9bGMYYsqoOk6AQ/fVlg/L/glDb21IwGzUfQ==", + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/@blaze-cardano/query/-/query-0.2.17.tgz", + "integrity": "sha512-ECuaQBLtzCwof/qwfdfPIKACc6FQxJj4bHaWSF7+tJXQrvf9ttrwrCn03DWxHQ1UpZuR5/SinPYTPL3eqsJF4A==", "dependencies": { - "@blaze-cardano/core": "0.4.3", + "@blaze-cardano/core": "0.4.5", "@blaze-cardano/jest-config": "0.0.1", - "@blaze-cardano/ogmios": "0.0.5", - "@cardano-ogmios/schema": "^6.4.0", - "@utxorpc/sdk": "0.4.0", - "@utxorpc/spec": "0.9.0", + "@blaze-cardano/ogmios": "0.0.6", + "@cardano-ogmios/schema": "^6.6.1", "ws": "^8.17.1" } }, "node_modules/@blaze-cardano/sdk": { - "version": "0.1.24", - "resolved": "https://registry.npmjs.org/@blaze-cardano/sdk/-/sdk-0.1.24.tgz", - "integrity": "sha512-w0eYW9Bsl6hbvfmNl6jsEAOB6r6nElIFD7CH5NCansSVqAUITZy9XMXT5rhSiwQKdXN/Gdqs/lhTanPPlhD3pQ==", + "version": "0.1.35", + "resolved": "https://registry.npmjs.org/@blaze-cardano/sdk/-/sdk-0.1.35.tgz", + "integrity": "sha512-xmyyl+0yDvqD8XqtMmItFA2Cc2ynjv1OVtTsHBfpME+6S0w9q0ajnomZ2wCBELmOcYd3dH1uA4AB5/9zP04kNA==", "dependencies": { - "@blaze-cardano/core": "0.4.3", - "@blaze-cardano/query": "0.2.13", - "@blaze-cardano/tx": "0.5.7", - "@blaze-cardano/uplc": "0.1.18", - "@blaze-cardano/wallet": "0.1.43" + "@blaze-cardano/core": "0.4.5", + "@blaze-cardano/query": "0.2.17", + "@blaze-cardano/tx": "0.5.17", + "@blaze-cardano/uplc": "0.1.28", + "@blaze-cardano/wallet": "0.1.54" } }, + "node_modules/@blaze-cardano/tsconfig": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@blaze-cardano/tsconfig/-/tsconfig-0.0.2.tgz", + "integrity": "sha512-g92uyf7u+Vsu0ItmClM/N5RhNci+c3fUuychk3OnvbbtOtRBBDR3liM9Qg5FhwQ+Wwf6D/zoUFH2pHsxvQFyaQ==", + "license": "MIT" + }, "node_modules/@blaze-cardano/tx": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@blaze-cardano/tx/-/tx-0.5.7.tgz", - "integrity": "sha512-uMQWltxF6FdTt3U3Z8s4T4uYvTrqw7R442prOaBMqiimoc/CynsSqAqsUELn9aGIawocoGvGR4epr2jvgKT3rg==", + "version": "0.5.17", + "resolved": "https://registry.npmjs.org/@blaze-cardano/tx/-/tx-0.5.17.tgz", + "integrity": "sha512-iwvokwCQtfRNF6o4YZs4NhtA0b0zBT4ukOH1CnM0/mf2kwCZPMRx4L/2EpcXNpmj0DVr0eQuqCWQ9R7nAJTEBQ==", "dependencies": { - "@blaze-cardano/core": "0.4.3" + "@blaze-cardano/core": "0.4.5" } }, "node_modules/@blaze-cardano/uplc": { - "version": "0.1.18", - "resolved": "https://registry.npmjs.org/@blaze-cardano/uplc/-/uplc-0.1.18.tgz", - "integrity": "sha512-aAGm4CV0yq3ChlFEZOWGLcET+5cT9TcMS/pP+ApF83vYmEiNnyqK4wDEE287m+9o3a1QXCbxpW/mp5fzCB94Qg==", + "version": "0.1.28", + "resolved": "https://registry.npmjs.org/@blaze-cardano/uplc/-/uplc-0.1.28.tgz", + "integrity": "sha512-fItlzHRTEP+EhQvcCPJSYArY0ZJtlx+YoNrEDD3nT6s56pCenAKimnEzfgNi1a/xCOgfhpjN6pKAZhTXkbXodg==", "dependencies": { - "@blaze-cardano/core": "0.4.3", - "@blaze-cardano/tx": "0.5.7", + "@blaze-cardano/core": "0.4.5", + "@blaze-cardano/tx": "0.5.17", "hex-encoding": "^2.0.2" } }, "node_modules/@blaze-cardano/wallet": { - "version": "0.1.43", - "resolved": "https://registry.npmjs.org/@blaze-cardano/wallet/-/wallet-0.1.43.tgz", - "integrity": "sha512-uGtL+oGJXHYy8nD/T4hE0T5DNtCI+g0VyRgzN84g7rKvW9aOyiEgGZaIvYudhxdNUNkWn1Ja6wTHzf/KEk0QoQ==", + "version": "0.1.54", + "resolved": "https://registry.npmjs.org/@blaze-cardano/wallet/-/wallet-0.1.54.tgz", + "integrity": "sha512-j7wmYDX5i8Cy1nnxxjidAujirBc+6HVtcw6UIYcFtF1FUuLmQYHWHihVEb2HtebQ3aSPBRDZ6trYCrM55pmd1w==", "dependencies": { - "@blaze-cardano/core": "0.4.3", - "@blaze-cardano/query": "0.2.13", - "@blaze-cardano/tx": "0.5.7" + "@blaze-cardano/core": "0.4.5", + "@blaze-cardano/query": "0.2.17", + "@blaze-cardano/tx": "0.5.17" } }, "node_modules/@bufbuild/protobuf": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/@bufbuild/protobuf/-/protobuf-1.10.0.tgz", - "integrity": "sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==" + "integrity": "sha512-QDdVFLoN93Zjg36NoQPZfsVH9tZew7wKDKyV5qRdj8ntT4wQCOradQjRaTdwMhWUYsgKsvCINKKm87FdEk96Ag==", + "license": "(Apache-2.0 AND BSD-3-Clause)" }, "node_modules/@cardano-ogmios/client": { "version": "6.3.0", @@ -662,6 +669,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/@connectrpc/connect/-/connect-1.4.0.tgz", "integrity": "sha512-vZeOkKaAjyV4+RH3+rJZIfDFJAfr+7fyYr6sLDKbYX3uuTVszhFe9/YKf5DNqrDb5cKdKVlYkGn6DTDqMitAnA==", + "license": "Apache-2.0", "peerDependencies": { "@bufbuild/protobuf": "^1.4.2" } @@ -670,6 +678,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/@connectrpc/connect-node/-/connect-node-1.4.0.tgz", "integrity": "sha512-0ANnrr6SvsjevsWEgdzHy7BaHkluZyS6s4xNoVt7RBHFR5V/kT9lPokoIbYUOU9JHzdRgTaS3x5595mwUsu15g==", + "license": "Apache-2.0", "dependencies": { "undici": "^5.28.3" }, @@ -681,6 +690,16 @@ "@connectrpc/connect": "1.4.0" } }, + "node_modules/@connectrpc/connect-web": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@connectrpc/connect-web/-/connect-web-1.4.0.tgz", + "integrity": "sha512-13aO4psFbbm7rdOFGV0De2Za64DY/acMspgloDlcOKzLPPs0yZkhp1OOzAQeiAIr7BM/VOHIA3p8mF0inxCYTA==", + "license": "Apache-2.0", + "peerDependencies": { + "@bufbuild/protobuf": "^1.4.2", + "@connectrpc/connect": "1.4.0" + } + }, "node_modules/@digitak/grubber": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/@digitak/grubber/-/grubber-3.1.4.tgz", @@ -692,6 +711,23 @@ "resolved": "https://registry.npmjs.org/@emurgo/cardano-message-signing-nodejs/-/cardano-message-signing-nodejs-1.0.1.tgz", "integrity": "sha512-PoKh1tQnJX18f8iEr8Jk1KXxKCn9eqaSslMI1pyOJvYRJhQVDLCh0+9YReufjp0oFJIY1ShcrR+4/WnECVZUKQ==" }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz", + "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.17.19", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz", @@ -964,6 +1000,23 @@ "node": ">=12" } }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.23.1.tgz", + "integrity": "sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@esbuild/openbsd-x64": { "version": "0.17.19", "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz", @@ -1048,6 +1101,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "license": "MIT", "engines": { "node": ">=14" } @@ -1248,39 +1302,83 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, + "node_modules/@utxorpc/blaze-provider": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@utxorpc/blaze-provider/-/blaze-provider-0.2.0.tgz", + "integrity": "sha512-FwZbEAt61O4B7JvB7DTVhuFyhOtv4NXQnWbvHv7n1HaFKXvkZ05SXtt6pshMWI78Bi2kgbaHOBqr5uRFLH6BPQ==", + "license": "ISC", + "dependencies": { + "@blaze-cardano/core": "^0.4.4", + "@blaze-cardano/query": "^0.2.15", + "@blaze-cardano/sdk": "^0.1.30", + "@blaze-cardano/tsconfig": "^0.0.2", + "@utxorpc/sdk": "0.6.1", + "@utxorpc/spec": "0.10.1" + } + }, "node_modules/@utxorpc/sdk": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@utxorpc/sdk/-/sdk-0.4.0.tgz", - "integrity": "sha512-wYMqXtaoaT2q3ZufZMi/K5SZOxB2S4OCSq2Wti//odk46OG/5gzrKCAB8gC1D9FAu/NNdt0SzgZ0uFShNLtiMA==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@utxorpc/sdk/-/sdk-0.6.1.tgz", + "integrity": "sha512-iLWpao0CZM17jVXF91/kQ1uaslCj9KXOW17lhLJlEd9hDhdTG0Z7rtsHIkxkwJDCMtXrUYaRRexQyJSBBNsI0w==", + "license": "MIT", "dependencies": { "@connectrpc/connect": "1.4", "@connectrpc/connect-node": "1.4", + "@connectrpc/connect-web": "1.4", "@types/node": "20.14.10", - "@utxorpc/spec": "0.9.0" + "@utxorpc/spec": "0.10.1", + "buffer": "^6.0.3" } }, "node_modules/@utxorpc/sdk/node_modules/@types/node": { "version": "20.14.10", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.10.tgz", "integrity": "sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==", + "license": "MIT", "dependencies": { "undici-types": "~5.26.4" } }, + "node_modules/@utxorpc/sdk/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/@utxorpc/sdk/node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "license": "MIT" }, "node_modules/@utxorpc/spec": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@utxorpc/spec/-/spec-0.9.0.tgz", - "integrity": "sha512-MSAbFrYr2dXkuHSDWYMkItYv5anuzeGd50t2+XjBoaI/eCNhviflLpl1i90XB00a1LOuHyS8o2Z+EBgB5i/h/A==", + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@utxorpc/spec/-/spec-0.10.1.tgz", + "integrity": "sha512-0INat5xSjkTeqKr+JO3SMQQ2PxcfZNUi5wJja/Fpnp68f52eTJf4X4QGy7tzqYzMsK/ZYhRr95J+WUeM6Vbmwg==", + "license": "MIT", "dependencies": { "@bufbuild/protobuf": "^1.10.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=20.0.0" } }, "node_modules/@zxing/text-encoding": { @@ -2022,6 +2120,19 @@ "node": "14 || 16 || >=18" } }, + "node_modules/get-tsconfig": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz", + "integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, "node_modules/glob-parent": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", @@ -2317,6 +2428,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz", "integrity": "sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==", + "license": "MIT", "peerDependencies": { "ws": "*" } @@ -5638,6 +5750,16 @@ "node": ">=8.10.0" } }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -5855,6 +5977,440 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, + "node_modules/tsx": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.1.tgz", + "integrity": "sha512-0flMz1lh74BR4wOvBjuh9olbnwqCPc35OOlfyzHba0Dc+QNUeWX/Gq2YTbnwcWPO3BMd8fkzRVrHcsR+a7z7rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "~0.23.0", + "get-tsconfig": "^4.7.5" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz", + "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz", + "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz", + "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz", + "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz", + "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz", + "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz", + "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz", + "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz", + "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz", + "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz", + "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz", + "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz", + "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz", + "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz", + "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz", + "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz", + "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz", + "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz", + "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz", + "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz", + "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.23.1.tgz", + "integrity": "sha512-BHpFFeslkWrXWyUPnbKm+xYYVYruCinGcftSBaa8zoF9hZO4BcSCFUvHVTtzpIY6YzUnYtuEhZ+C9iEXjxnasg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz", + "integrity": "sha512-VVNz/9Sa0bs5SELtn3f7qhJCDPCF5oMEl5cO9/SSinpE9hbPVvxbd572HH5AKiP7WD8INO53GgfDDhRjkylHEg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.23.1", + "@esbuild/android-arm": "0.23.1", + "@esbuild/android-arm64": "0.23.1", + "@esbuild/android-x64": "0.23.1", + "@esbuild/darwin-arm64": "0.23.1", + "@esbuild/darwin-x64": "0.23.1", + "@esbuild/freebsd-arm64": "0.23.1", + "@esbuild/freebsd-x64": "0.23.1", + "@esbuild/linux-arm": "0.23.1", + "@esbuild/linux-arm64": "0.23.1", + "@esbuild/linux-ia32": "0.23.1", + "@esbuild/linux-loong64": "0.23.1", + "@esbuild/linux-mips64el": "0.23.1", + "@esbuild/linux-ppc64": "0.23.1", + "@esbuild/linux-riscv64": "0.23.1", + "@esbuild/linux-s390x": "0.23.1", + "@esbuild/linux-x64": "0.23.1", + "@esbuild/netbsd-x64": "0.23.1", + "@esbuild/openbsd-arm64": "0.23.1", + "@esbuild/openbsd-x64": "0.23.1", + "@esbuild/sunos-x64": "0.23.1", + "@esbuild/win32-arm64": "0.23.1", + "@esbuild/win32-ia32": "0.23.1", + "@esbuild/win32-x64": "0.23.1" + } + }, "node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", @@ -5905,6 +6461,7 @@ "version": "5.28.4", "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "license": "MIT", "dependencies": { "@fastify/busboy": "^2.0.0" }, diff --git a/examples/blaze-client/package.json b/examples/blaze-client/package.json index e03aba65..45b78b58 100644 --- a/examples/blaze-client/package.json +++ b/examples/blaze-client/package.json @@ -4,14 +4,16 @@ "description": "", "main": "index.js", "scripts": { - "example": "esrun index.ts" + "example": "tsx index.ts" }, "author": "", "license": "ISC", "dependencies": { - "@blaze-cardano/sdk": "^0.1.24" + "@blaze-cardano/sdk": "^0.1.24", + "@utxorpc/blaze-provider": "^0.2.0" }, "devDependencies": { - "esrun": "^3.2.26" + "esrun": "^3.2.26", + "tsx": "^4.19.0" } } From 57049bc39bce721ec688be226e4d900509a1ea99 Mon Sep 17 00:00:00 2001 From: johnquinnvictaboada Date: Thu, 19 Sep 2024 22:05:11 +0800 Subject: [PATCH 2/2] chore: added proper generalization and cleaned up working sample --- docs/pages/apis/blaze.mdx | 4 ++-- examples/blaze-client/index.ts | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/pages/apis/blaze.mdx b/docs/pages/apis/blaze.mdx index d8f46abe..ab33a933 100644 --- a/docs/pages/apis/blaze.mdx +++ b/docs/pages/apis/blaze.mdx @@ -3,9 +3,9 @@ import { Callout } from "nextra/components"; # Blaze -Blaze is a NodeJS library for creating Cardano transactions and off-chain code for your Aiken contracts in JavaScript. You can learn more about Blaze [in their documentation site](https://blaze.butane.dev/). +Blaze is a NodeJS library for creating Cardano transactions and off-chain code for your Cardano Smart Contracts in JavaScript. You can learn more about Blaze [in their documentation site](https://blaze.butane.dev/). -Blaze supports multiple backend providers for interacting with the Cardano network. One of those providers is `U5C` (short for UtxoRPC) which is one of the APIs supported by Dolos. You can learn more about U5C in the [U5C documentation](./grpc.mdx). +Blaze supports multiple backend providers for interacting with the Cardano network. One of those providers is `U5C` (short for UTxORPC) which is one of the APIs supported by Dolos. You can learn more about U5C in the [U5C documentation](./grpc.mdx). ## Installation diff --git a/examples/blaze-client/index.ts b/examples/blaze-client/index.ts index 30274bef..220d4f0c 100644 --- a/examples/blaze-client/index.ts +++ b/examples/blaze-client/index.ts @@ -11,14 +11,9 @@ import { U5C } from "@utxorpc/blaze-provider"; async function main() { // Step #2 // Create a new U5C provider - // In this example we use Demeter hosted UTXO provider - // but you can run a local Dolos https://github.com/txpipe/dolos instance and connect to its UTxO endpoint - // If this is the case then you can remove the headers field + // In this example we are using our local Dolos https://github.com/txpipe/dolos instance and connect to its UTxO endpoint const provider = new U5C({ - url: "https://preview.utxorpc-v0.demeter.run", - headers: { - "dmtr-api-key": "dmtr_utxorpc19r0r7x8stkzejplyyra8n6d70gw276un", - }, + url: "http://localhost:50051" }); // Step #3