Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build:mesh": "turbo run build:mesh",
"build:scripts": "turbo run build:scripts",
"clean": "turbo run clean && rm -rf .turbo && rm -rf dist && rm -rf node_modules && rm package-lock.json",
"dev": "turbo dev --concurrency 15",
"dev": "turbo dev --concurrency 20",
"format": "turbo run format --continue -- --cache --cache-location node_modules/.cache/.prettiercache",
"format:fix": "turbo run format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
"lint": "turbo lint",
Expand Down
5 changes: 4 additions & 1 deletion packages/bitcoin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/bitcoin",
"version": "1.9.0-beta.95",
"version": "1.9.0-beta.96",
"description": "Mesh Bitcoin package",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand All @@ -25,6 +25,9 @@
},
"dependencies": {
"@bitcoin-js/tiny-secp256k1-asmjs": "^2.2.3",
"@meshsdk/common": "1.9.0-beta.96",
"@meshsdk/provider": "1.9.0-beta.96",
"axios": "^1.7.9",
"bip174": "^3.0.0",
"bip32": "^4.0.0",
"bip39": "^3.1.0",
Expand Down
1 change: 1 addition & 0 deletions packages/bitcoin/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./core";
export * from "./interfaces";
export * from "./multi-chain";
export * from "./providers";
export * from "./utils";
export * from "./types";
Expand Down
4 changes: 4 additions & 0 deletions packages/bitcoin/src/multi-chain/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export {
MaestroMultiChainProvider,
type MaestroMultiChainConfig
} from "./maestro-unified";
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { MaestroProvider as CardanoMaestroProvider, type MaestroSupportedNetworks as CardanoMaestroNetworks } from "../maestro";
import {
MaestroProvider as BitcoinMaestroProvider,
import { MaestroProvider as CardanoMaestroProvider, type MaestroSupportedNetworks as CardanoMaestroNetworks } from "@meshsdk/provider";
import type { TransactionInfo as CardanoTransactionInfo, UTxO as CardanoUTxO, IFetcherOptions } from "@meshsdk/common";
import { MaestroProvider as BitcoinMaestroProvider } from "../providers";
import type {
MaestroSupportedNetworks as BitcoinMaestroNetworks,
TransactionsInfo as BitcoinTransactionInfo,
UTxO as BitcoinUTxO,
AddressInfo as BitcoinAddressInfo,
TransactionsStatus as BitcoinTransactionStatus
} from "@meshsdk/bitcoin";
import type { TransactionInfo as CardanoTransactionInfo, UTxO as CardanoUTxO, IFetcherOptions } from "@meshsdk/common";
} from "../types";

export type MaestroConfig =
export type MaestroMultiChainConfig =
| { chain: "cardano"; apiKey: string; network: CardanoMaestroNetworks; turboSubmit?: boolean }
| { chain: "bitcoin"; apiKey: string; network: BitcoinMaestroNetworks };

Expand Down Expand Up @@ -48,7 +48,7 @@ export class MaestroMultiChainProvider {
* Create a Maestro provider for the specified chain.
* @param config - Chain-specific configuration object.
*/
constructor(config: MaestroConfig) {
constructor(config: MaestroMultiChainConfig) {
this._chain = config.chain;

if (config.chain === "cardano") {
Expand Down Expand Up @@ -279,4 +279,4 @@ export class MaestroMultiChainProvider {

throw new Error(`Unsupported chain: ${this._chain}`);
}
}
}
1 change: 1 addition & 0 deletions packages/bitcoin/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default defineConfig({
splitting: false,
sourcemap: true,
clean: true,
target: "esnext",
external: [
"bip32",
"ecpair",
Expand Down
2 changes: 1 addition & 1 deletion packages/mesh-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/common",
"version": "1.9.0-beta.95",
"version": "1.9.0-beta.96",
"description": "Contains constants, types and interfaces used across the SDK and different serialization libraries",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/mesh-contract/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/contract",
"version": "1.9.0-beta.95",
"version": "1.9.0-beta.96",
"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",
Expand Down Expand Up @@ -34,8 +34,8 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@meshsdk/common": "1.9.0-beta.95",
"@meshsdk/core": "1.9.0-beta.95",
"@meshsdk/common": "1.9.0-beta.96",
"@meshsdk/core": "1.9.0-beta.96",
"libsodium-wrappers-sumo": "0.7.15"
},
"prettier": "@meshsdk/configs/prettier",
Expand Down
6 changes: 3 additions & 3 deletions packages/mesh-core-csl/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/core-csl",
"version": "1.9.0-beta.95",
"version": "1.9.0-beta.96",
"description": "Types and utilities functions between Mesh and cardano-serialization-lib",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
Expand Down Expand Up @@ -31,15 +31,15 @@
},
"devDependencies": {
"@meshsdk/configs": "*",
"@meshsdk/provider": "1.9.0-beta.95",
"@meshsdk/provider": "1.9.0-beta.96",
"@types/json-bigint": "^1.0.4",
"eslint": "^8.57.0",
"ts-jest": "^29.1.4",
"tsup": "^8.0.2",
"typescript": "^5.3.3"
},
"dependencies": {
"@meshsdk/common": "1.9.0-beta.95",
"@meshsdk/common": "1.9.0-beta.96",
"@sidan-lab/whisky-js-browser": "^1.0.11",
"@sidan-lab/whisky-js-nodejs": "^1.0.11",
"@types/base32-encoding": "^1.0.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/mesh-core-cst/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/core-cst",
"version": "1.9.0-beta.95",
"version": "1.9.0-beta.96",
"description": "Types and utilities functions between Mesh and cardano-js-sdk",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand Down Expand Up @@ -44,7 +44,7 @@
"@harmoniclabs/plutus-data": "1.2.6",
"@harmoniclabs/uplc": "1.4.1",
"@harmoniclabs/pair": "^1.0.0",
"@meshsdk/common": "1.9.0-beta.95",
"@meshsdk/common": "1.9.0-beta.96",
"@types/base32-encoding": "^1.0.2",
"base32-encoding": "^1.0.0",
"bech32": "^2.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/mesh-core-cst/src/utils/builder.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { pbkdf2Sync } from "crypto";
import { blake2b, ready } from "@cardano-sdk/crypto";
import blake2b from "blake2b";
import { HexBlob } from "@cardano-sdk/util";
import hash from "hash.js";

Expand Down Expand Up @@ -168,7 +168,7 @@ export const buildDRepID = (
addressType: AddressType = AddressType.EnterpriseKey,
): DRepID => {
const dRepKeyBytes = Buffer.from(dRepKey, "hex");
const dRepIdHex = blake2b.hash(HexBlob.fromBytes(dRepKeyBytes), 28);
const dRepIdHex = blake2b(28).update(dRepKeyBytes).digest("hex");
const paymentAddress = EnterpriseAddress.packParts({
networkId,
paymentPart: {
Expand Down
9 changes: 6 additions & 3 deletions packages/mesh-core-cst/src/utils/script-data-hash.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable unicorn/number-literal-case */
import blake2b from "blake2b";
import { Cardano, Serialization } from "@cardano-sdk/core";
import * as Crypto from "@cardano-sdk/crypto";
import { Hash32ByteBase16 } from "@cardano-sdk/crypto";
import { HexBlob } from "@cardano-sdk/util";

Expand All @@ -25,7 +25,7 @@ export const hashScriptData = (
costModels: Serialization.Costmdls,
redemeers?: Serialization.Redeemers,
datums?: Serialization.CborSet<Cardano.PlutusData, PlutusData>,
): Crypto.Hash32ByteBase16 | undefined => {
): Hash32ByteBase16 | undefined => {
const writer = new Serialization.CborWriter();
if (datums && datums.size() > 0 && (!redemeers || redemeers.size() === 0)) {
/*
Expand Down Expand Up @@ -55,5 +55,8 @@ export const hashScriptData = (
);
}

return Hash32ByteBase16.fromHexBlob(Crypto.blake2b.hash(writer.encode(), 32));
const hashHex = blake2b(32)
.update(Buffer.from(writer.encode()))
.digest("hex");
return Hash32ByteBase16.fromHexBlob(HexBlob(hashHex));
};
12 changes: 6 additions & 6 deletions packages/mesh-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/core",
"version": "1.9.0-beta.95",
"version": "1.9.0-beta.96",
"description": "Mesh SDK Core - https://meshjs.dev/",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand Down Expand Up @@ -33,11 +33,11 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@meshsdk/common": "1.9.0-beta.95",
"@meshsdk/core-cst": "1.9.0-beta.95",
"@meshsdk/provider": "1.9.0-beta.95",
"@meshsdk/transaction": "1.9.0-beta.95",
"@meshsdk/wallet": "1.9.0-beta.95",
"@meshsdk/common": "1.9.0-beta.96",
"@meshsdk/core-cst": "1.9.0-beta.96",
"@meshsdk/provider": "1.9.0-beta.96",
"@meshsdk/transaction": "1.9.0-beta.96",
"@meshsdk/wallet": "1.9.0-beta.96",
"libsodium-wrappers-sumo": "0.7.15"
},
"prettier": "@meshsdk/configs/prettier",
Expand Down
8 changes: 4 additions & 4 deletions packages/mesh-hydra/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/hydra",
"version": "1.9.0-beta.95",
"version": "1.9.0-beta.96",
"description": "Mesh Hydra package",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand All @@ -27,9 +27,9 @@
"test": "jest"
},
"dependencies": {
"@meshsdk/common": "1.9.0-beta.95",
"@meshsdk/core": "1.9.0-beta.95",
"@meshsdk/core-cst": "1.9.0-beta.95",
"@meshsdk/common": "1.9.0-beta.96",
"@meshsdk/core": "1.9.0-beta.96",
"@meshsdk/core-cst": "1.9.0-beta.96",
"axios": "^1.7.2"
},
"devDependencies": {
Expand Down
7 changes: 3 additions & 4 deletions packages/mesh-provider/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/provider",
"version": "1.9.0-beta.95",
"version": "1.9.0-beta.96",
"description": "Blockchain data providers - https://meshjs.dev/providers",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand Down Expand Up @@ -35,9 +35,8 @@
"typescript": "^5.3.3"
},
"dependencies": {
"@meshsdk/bitcoin": "1.9.0-beta.95",
"@meshsdk/common": "1.9.0-beta.95",
"@meshsdk/core-cst": "1.9.0-beta.95",
"@meshsdk/common": "1.9.0-beta.96",
"@meshsdk/core-cst": "1.9.0-beta.96",
"@utxorpc/sdk": "^0.6.7",
"@utxorpc/spec": "^0.16.0",
"axios": "^1.7.2",
Expand Down
1 change: 0 additions & 1 deletion packages/mesh-provider/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ export * from "./utxo-rpc";
export * from "./yaci";
export * from "./offline";
export * from "./kupo";
export * from "./multi-chain";
4 changes: 0 additions & 4 deletions packages/mesh-provider/src/multi-chain/index.ts

This file was deleted.

9 changes: 4 additions & 5 deletions packages/mesh-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meshsdk/react",
"version": "1.9.0-beta.95",
"version": "1.9.0-beta.96",
"description": "React component library - https://meshjs.dev/react",
"main": "./dist/index.cjs",
"browser": "./dist/index.js",
Expand Down Expand Up @@ -30,10 +30,9 @@
},
"dependencies": {
"@cardananium/cardano-peer-connect": "^1.2.19",
"@meshsdk/bitcoin": "1.9.0-beta.95",
"@meshsdk/common": "1.9.0-beta.95",
"@meshsdk/transaction": "1.9.0-beta.95",
"@meshsdk/wallet": "1.9.0-beta.95",
"@meshsdk/common": "1.9.0-beta.96",
"@meshsdk/transaction": "1.9.0-beta.96",
"@meshsdk/wallet": "1.9.0-beta.96",
"@meshsdk/web3-sdk": "0.0.50",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/mesh-react/src/cardano-wallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function Header({
) : (
<span style={{ width: "24px" }}></span>
)}
<span>
<span className="mesh-text-white">
{/* @ts-ignore */}
{screens[screen].title}
</span>
Expand Down
16 changes: 1 addition & 15 deletions packages/mesh-react/src/cardano-wallet/screen-main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { BrowserWallet } from "@meshsdk/bitcoin";
import { EnableWeb3WalletOptions } from "@meshsdk/web3-sdk";

import IconBitcoin from "../common/icons/icon-bitcoin";
import IconBookDashed from "../common/icons/icon-book-dashed";
import IconDownload from "../common/icons/icon-download";
import IconFingerprint from "../common/icons/icon-fingerprint";
Expand Down Expand Up @@ -34,7 +32,7 @@ export default function ScreenMain({
web3Services?: EnableWeb3WalletOptions;
}) {
const wallets = useWalletList({ injectFn });
const { connect, setBitcoinWallet } = useWallet();
const { connect } = useWallet();

return (
<TooltipProvider>
Expand Down Expand Up @@ -99,18 +97,6 @@ export default function ScreenMain({
}}
/>
)}

<WalletIcon
iconReactNode={IconBitcoin()}
name={"Bitcoin"}
action={async () => {
const wallet = await BrowserWallet.enable(
"Mesh SDK want to connect",
);
setBitcoinWallet(wallet, "Bitcoin");
setOpen(false);
}}
/>
</div>
</TooltipProvider>
);
Expand Down
24 changes: 0 additions & 24 deletions packages/mesh-react/src/common/icons/icon-bitcoin.tsx

This file was deleted.

Loading
Loading