diff --git a/packages/mesh-common/package.json b/packages/mesh-common/package.json index c792813e..8058573d 100644 --- a/packages/mesh-common/package.json +++ b/packages/mesh-common/package.json @@ -1,6 +1,6 @@ { "name": "@meshsdk/common", - "version": "1.8.10", + "version": "1.8.11", "description": "Contains constants, types and interfaces used across the SDK and different serialization libraries", "main": "./dist/index.cjs", "browser": "./dist/index.js", diff --git a/packages/mesh-contract/package.json b/packages/mesh-contract/package.json index 17e38b73..f86ee36e 100644 --- a/packages/mesh-contract/package.json +++ b/packages/mesh-contract/package.json @@ -1,6 +1,6 @@ { "name": "@meshsdk/contract", - "version": "1.8.10", + "version": "1.8.11", "description": "List of open-source smart contracts, complete with documentation, live demos, and end-to-end source code. https://meshjs.dev/smart-contracts", "main": "./dist/index.cjs", "browser": "./dist/index.js", @@ -34,9 +34,9 @@ "typescript": "^5.3.3" }, "dependencies": { - "@meshsdk/common": "1.8.10", - "@meshsdk/core": "1.8.10", - "@meshsdk/core-csl": "1.8.10" + "@meshsdk/common": "1.8.11", + "@meshsdk/core": "1.8.11", + "@meshsdk/core-csl": "1.8.11" }, "prettier": "@meshsdk/configs/prettier", "publishConfig": { diff --git a/packages/mesh-core-csl/package.json b/packages/mesh-core-csl/package.json index 2980dfe2..5a8de86b 100644 --- a/packages/mesh-core-csl/package.json +++ b/packages/mesh-core-csl/package.json @@ -1,6 +1,6 @@ { "name": "@meshsdk/core-csl", - "version": "1.8.10", + "version": "1.8.11", "description": "Types and utilities functions between Mesh and cardano-serialization-lib", "main": "./dist/index.cjs", "module": "./dist/index.js", @@ -31,7 +31,7 @@ }, "devDependencies": { "@meshsdk/configs": "*", - "@meshsdk/provider": "1.8.10", + "@meshsdk/provider": "1.8.11", "@types/json-bigint": "^1.0.4", "eslint": "^8.57.0", "ts-jest": "^29.1.4", @@ -39,7 +39,7 @@ "typescript": "^5.3.3" }, "dependencies": { - "@meshsdk/common": "1.8.10", + "@meshsdk/common": "1.8.11", "@sidan-lab/sidan-csl-rs-browser": "0.9.16", "@sidan-lab/sidan-csl-rs-nodejs": "0.9.16", "@types/base32-encoding": "^1.0.2", diff --git a/packages/mesh-core-cst/package.json b/packages/mesh-core-cst/package.json index 7a718d3a..08316f7d 100644 --- a/packages/mesh-core-cst/package.json +++ b/packages/mesh-core-cst/package.json @@ -1,6 +1,6 @@ { "name": "@meshsdk/core-cst", - "version": "1.8.10", + "version": "1.8.11", "description": "Types and utilities functions between Mesh and cardano-js-sdk", "main": "./dist/index.cjs", "browser": "./dist/index.js", @@ -45,7 +45,7 @@ "@harmoniclabs/crypto": "0.2.4", "@harmoniclabs/pair": "1.0.0", "@harmoniclabs/bytestring": "1.0.0", - "@meshsdk/common": "1.8.10", + "@meshsdk/common": "1.8.11", "@stricahq/bip32ed25519": "^1.1.0", "@stricahq/cbors": "^1.0.3", "pbkdf2": "^3.1.2" diff --git a/packages/mesh-core/package.json b/packages/mesh-core/package.json index d9bb1988..5f1f8804 100644 --- a/packages/mesh-core/package.json +++ b/packages/mesh-core/package.json @@ -1,6 +1,6 @@ { "name": "@meshsdk/core", - "version": "1.8.10", + "version": "1.8.11", "description": "Mesh SDK Core - https://meshjs.dev/", "main": "./dist/index.cjs", "browser": "./dist/index.js", @@ -33,13 +33,13 @@ "typescript": "^5.3.3" }, "dependencies": { - "@meshsdk/common": "1.8.10", - "@meshsdk/core-csl": "1.8.10", - "@meshsdk/core-cst": "1.8.10", - "@meshsdk/provider": "1.8.10", - "@meshsdk/react": "1.8.10", - "@meshsdk/transaction": "1.8.10", - "@meshsdk/wallet": "1.8.10" + "@meshsdk/common": "1.8.11", + "@meshsdk/core-csl": "1.8.11", + "@meshsdk/core-cst": "1.8.11", + "@meshsdk/provider": "1.8.11", + "@meshsdk/react": "1.8.11", + "@meshsdk/transaction": "1.8.11", + "@meshsdk/wallet": "1.8.11" }, "prettier": "@meshsdk/configs/prettier", "publishConfig": { diff --git a/packages/mesh-provider/package.json b/packages/mesh-provider/package.json index 53468872..34d952f3 100644 --- a/packages/mesh-provider/package.json +++ b/packages/mesh-provider/package.json @@ -1,6 +1,6 @@ { "name": "@meshsdk/provider", - "version": "1.8.10", + "version": "1.8.11", "description": "Blockchain data providers - https://meshjs.dev/providers", "main": "./dist/index.cjs", "browser": "./dist/index.js", @@ -35,8 +35,8 @@ "typescript": "^5.3.3" }, "dependencies": { - "@meshsdk/common": "1.8.10", - "@meshsdk/core-cst": "1.8.10", + "@meshsdk/common": "1.8.11", + "@meshsdk/core-cst": "1.8.11", "@utxorpc/sdk": "0.6.2", "@utxorpc/spec": "0.10.1", "axios": "^1.7.2" diff --git a/packages/mesh-provider/src/ogmios.ts b/packages/mesh-provider/src/ogmios.ts index 2d3034e4..5c5301c6 100644 --- a/packages/mesh-provider/src/ogmios.ts +++ b/packages/mesh-provider/src/ogmios.ts @@ -22,8 +22,10 @@ export class OgmiosProvider implements IEvaluator, ISubmitter { async evaluateTx(tx: string): Promise[]> { const client = await this.open(); - this.send(client, "EvaluateTransaction", { - evaluate: tx, + this.send(client, "evaluateTransaction", { + transaction: { + cbor: tx, + }, }); return new Promise((resolve, reject) => { @@ -32,21 +34,21 @@ export class OgmiosProvider implements IEvaluator, ISubmitter { (response: MessageEvent) => { try { const { result } = JSON.parse(response.data); - if (result.EvaluationResult) { + if (result) { resolve( - Object.keys(result.EvaluationResult).map((key) => { + Object.values(result).map((val: any) => { return >{ - index: parseInt(key.split(":")[1]!, 10), - tag: key.split(":")[0]!.toUpperCase(), + index: val.validator.index, + tag: val.validator.purpose.toUpperCase(), budget: { - mem: result.EvaluationResult[key].memory, - steps: result.EvaluationResult[key].steps, + mem: val.budget.memory, + steps: val.budget.cpu, }, }; }), ); } else { - reject(result.EvaluationFailure); + reject(result); } client.close(); @@ -62,20 +64,23 @@ export class OgmiosProvider implements IEvaluator, ISubmitter { async onNextTx(callback: (tx: unknown) => void): Promise<() => void> { const client = await this.open(); - this.send(client, "AwaitAcquire", {}); + this.send(client, "acquireMempool", {}); client.addEventListener("message", (response: MessageEvent) => { const { result } = JSON.parse(response.data); - if (result === null) { - return this.send(client, "AwaitAcquire", {}); + return this.send(client, "acquireMempool", {}); } - if (result.AwaitAcquired === undefined) { + if (result.transaction === null || result.transaction === undefined) { + this.send(client, "acquireMempool", {}); + } else { callback(result); } - this.send(client, "NextTransaction", {}); + this.send(client, "nextTransaction", { + fields: "all", + }); }); return () => client.close(); @@ -84,8 +89,10 @@ export class OgmiosProvider implements IEvaluator, ISubmitter { async submitTx(tx: string): Promise { const client = await this.open(); - this.send(client, "SubmitTransaction", { - submit: tx, + this.send(client, "submitTransaction", { + transaction: { + cbor: tx, + }, }); return new Promise((resolve, reject) => { @@ -95,10 +102,17 @@ export class OgmiosProvider implements IEvaluator, ISubmitter { try { const { result } = JSON.parse(response.data); - if (result.SubmitSuccess) { - resolve(result.SubmitSuccess.txId); + if (!result) { + reject(JSON.parse(response.data).error); + } + + if ( + result.transaction !== null && + result.transaction !== undefined + ) { + resolve(result.transaction.id); } else { - reject(result.SubmitFail); + reject(result); } client.close(); @@ -121,12 +135,14 @@ export class OgmiosProvider implements IEvaluator, ISubmitter { return client; } - private send(client: WebSocket, methodname: string, args: unknown) { + private send(client: WebSocket, method: string, params: unknown) { client.send( JSON.stringify({ - version: "2.0", - methodname, - args, + jsonrpc: "2.0", + type: "jsonwsp/request", + servicename: "ogmios", + method, + params, }), ); } diff --git a/packages/mesh-react/package.json b/packages/mesh-react/package.json index 563fef7b..3c27231d 100644 --- a/packages/mesh-react/package.json +++ b/packages/mesh-react/package.json @@ -1,6 +1,6 @@ { "name": "@meshsdk/react", - "version": "1.8.10", + "version": "1.8.11", "description": "React component library - https://meshjs.dev/react", "main": "./dist/index.cjs", "browser": "./dist/index.js", @@ -30,9 +30,9 @@ }, "dependencies": { "@fabianbormann/cardano-peer-connect": "^1.2.18", - "@meshsdk/common": "1.8.10", - "@meshsdk/transaction": "1.8.10", - "@meshsdk/wallet": "1.8.10", + "@meshsdk/common": "1.8.11", + "@meshsdk/transaction": "1.8.11", + "@meshsdk/wallet": "1.8.11", "@radix-ui/react-dialog": "^1.1.2", "@radix-ui/react-dropdown-menu": "^2.1.2", "@radix-ui/react-icons": "^1.3.2", diff --git a/packages/mesh-svelte/package.json b/packages/mesh-svelte/package.json index 8d988246..50b1076c 100644 --- a/packages/mesh-svelte/package.json +++ b/packages/mesh-svelte/package.json @@ -1,6 +1,6 @@ { "name": "@meshsdk/svelte", - "version": "1.8.10", + "version": "1.8.11", "description": "Svelte component library - https://meshjs.dev/svelte", "type": "module", "exports": { @@ -26,7 +26,7 @@ "dev": "vite dev" }, "dependencies": { - "@meshsdk/core": "1.8.10", + "@meshsdk/core": "1.8.11", "bits-ui": "1.0.0-next.65" }, "devDependencies": { diff --git a/packages/mesh-transaction/package.json b/packages/mesh-transaction/package.json index 9f0c7b02..cb0cdc8a 100644 --- a/packages/mesh-transaction/package.json +++ b/packages/mesh-transaction/package.json @@ -1,6 +1,6 @@ { "name": "@meshsdk/transaction", - "version": "1.8.10", + "version": "1.8.11", "description": "Transactions - https://meshjs.dev/apis/transaction", "main": "./dist/index.cjs", "browser": "./dist/index.js", @@ -35,9 +35,9 @@ "typescript": "^5.3.3" }, "dependencies": { - "@meshsdk/common": "1.8.10", - "@meshsdk/core-csl": "1.8.10", - "@meshsdk/core-cst": "1.8.10", + "@meshsdk/common": "1.8.11", + "@meshsdk/core-csl": "1.8.11", + "@meshsdk/core-cst": "1.8.11", "json-bigint": "^1.0.0" }, "prettier": "@meshsdk/configs/prettier", diff --git a/packages/mesh-wallet/package.json b/packages/mesh-wallet/package.json index 03ba013a..f60208bf 100644 --- a/packages/mesh-wallet/package.json +++ b/packages/mesh-wallet/package.json @@ -1,6 +1,6 @@ { "name": "@meshsdk/wallet", - "version": "1.8.10", + "version": "1.8.11", "description": "Wallets - https://meshjs.dev/apis/wallets", "main": "./dist/index.cjs", "browser": "./dist/index.js", @@ -35,10 +35,10 @@ "typescript": "^5.3.3" }, "dependencies": { - "@meshsdk/common": "1.8.10", - "@meshsdk/core-csl": "1.8.10", - "@meshsdk/core-cst": "1.8.10", - "@meshsdk/transaction": "1.8.10", + "@meshsdk/common": "1.8.11", + "@meshsdk/core-csl": "1.8.11", + "@meshsdk/core-cst": "1.8.11", + "@meshsdk/transaction": "1.8.11", "@simplewebauthn/browser": "^13.0.0" }, "prettier": "@meshsdk/configs/prettier", diff --git a/scripts/mesh-cli/package.json b/scripts/mesh-cli/package.json index 83793eb0..e2144ce9 100644 --- a/scripts/mesh-cli/package.json +++ b/scripts/mesh-cli/package.json @@ -3,7 +3,7 @@ "description": "A quick and easy way to bootstrap your dApps on Cardano using Mesh.", "homepage": "https://meshjs.dev", "author": "MeshJS", - "version": "1.8.10", + "version": "1.8.11", "license": "Apache-2.0", "type": "module", "main": "./dist/index.cjs",