Skip to content

Commit 9fc99a8

Browse files
authored
Refactor btc (#786)
* remove btc from react and provider, move them to bitcoin package * fix build error * clean up * 1.9.0-beta.96 * fix build error
1 parent e07a8ff commit 9fc99a8

29 files changed

Lines changed: 72 additions & 136 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build:mesh": "turbo run build:mesh",
1010
"build:scripts": "turbo run build:scripts",
1111
"clean": "turbo run clean && rm -rf .turbo && rm -rf dist && rm -rf node_modules && rm package-lock.json",
12-
"dev": "turbo dev --concurrency 15",
12+
"dev": "turbo dev --concurrency 20",
1313
"format": "turbo run format --continue -- --cache --cache-location node_modules/.cache/.prettiercache",
1414
"format:fix": "turbo run format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
1515
"lint": "turbo lint",

packages/bitcoin/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@meshsdk/bitcoin",
3-
"version": "1.9.0-beta.95",
3+
"version": "1.9.0-beta.96",
44
"description": "Mesh Bitcoin package",
55
"main": "./dist/index.cjs",
66
"browser": "./dist/index.js",
@@ -25,6 +25,9 @@
2525
},
2626
"dependencies": {
2727
"@bitcoin-js/tiny-secp256k1-asmjs": "^2.2.3",
28+
"@meshsdk/common": "1.9.0-beta.96",
29+
"@meshsdk/provider": "1.9.0-beta.96",
30+
"axios": "^1.7.9",
2831
"bip174": "^3.0.0",
2932
"bip32": "^4.0.0",
3033
"bip39": "^3.1.0",

packages/bitcoin/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export * from "./core";
22
export * from "./interfaces";
3+
export * from "./multi-chain";
34
export * from "./providers";
45
export * from "./utils";
56
export * from "./types";
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export {
2+
MaestroMultiChainProvider,
3+
type MaestroMultiChainConfig
4+
} from "./maestro-unified";

packages/mesh-provider/src/multi-chain/maestro-unified.ts renamed to packages/bitcoin/src/multi-chain/maestro-unified.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { MaestroProvider as CardanoMaestroProvider, type MaestroSupportedNetworks as CardanoMaestroNetworks } from "../maestro";
2-
import {
3-
MaestroProvider as BitcoinMaestroProvider,
1+
import { MaestroProvider as CardanoMaestroProvider, type MaestroSupportedNetworks as CardanoMaestroNetworks } from "@meshsdk/provider";
2+
import type { TransactionInfo as CardanoTransactionInfo, UTxO as CardanoUTxO, IFetcherOptions } from "@meshsdk/common";
3+
import { MaestroProvider as BitcoinMaestroProvider } from "../providers";
4+
import type {
45
MaestroSupportedNetworks as BitcoinMaestroNetworks,
56
TransactionsInfo as BitcoinTransactionInfo,
67
UTxO as BitcoinUTxO,
78
AddressInfo as BitcoinAddressInfo,
89
TransactionsStatus as BitcoinTransactionStatus
9-
} from "@meshsdk/bitcoin";
10-
import type { TransactionInfo as CardanoTransactionInfo, UTxO as CardanoUTxO, IFetcherOptions } from "@meshsdk/common";
10+
} from "../types";
1111

12-
export type MaestroConfig =
12+
export type MaestroMultiChainConfig =
1313
| { chain: "cardano"; apiKey: string; network: CardanoMaestroNetworks; turboSubmit?: boolean }
1414
| { chain: "bitcoin"; apiKey: string; network: BitcoinMaestroNetworks };
1515

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

5454
if (config.chain === "cardano") {
@@ -279,4 +279,4 @@ export class MaestroMultiChainProvider {
279279

280280
throw new Error(`Unsupported chain: ${this._chain}`);
281281
}
282-
}
282+
}

packages/bitcoin/tsup.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default defineConfig({
77
splitting: false,
88
sourcemap: true,
99
clean: true,
10+
target: "esnext",
1011
external: [
1112
"bip32",
1213
"ecpair",

packages/mesh-common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@meshsdk/common",
3-
"version": "1.9.0-beta.95",
3+
"version": "1.9.0-beta.96",
44
"description": "Contains constants, types and interfaces used across the SDK and different serialization libraries",
55
"main": "./dist/index.cjs",
66
"browser": "./dist/index.js",

packages/mesh-contract/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@meshsdk/contract",
3-
"version": "1.9.0-beta.95",
3+
"version": "1.9.0-beta.96",
44
"description": "List of open-source smart contracts, complete with documentation, live demos, and end-to-end source code. https://meshjs.dev/smart-contracts",
55
"main": "./dist/index.cjs",
66
"browser": "./dist/index.js",
@@ -34,8 +34,8 @@
3434
"typescript": "^5.3.3"
3535
},
3636
"dependencies": {
37-
"@meshsdk/common": "1.9.0-beta.95",
38-
"@meshsdk/core": "1.9.0-beta.95",
37+
"@meshsdk/common": "1.9.0-beta.96",
38+
"@meshsdk/core": "1.9.0-beta.96",
3939
"libsodium-wrappers-sumo": "0.7.15"
4040
},
4141
"prettier": "@meshsdk/configs/prettier",

packages/mesh-core-csl/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@meshsdk/core-csl",
3-
"version": "1.9.0-beta.95",
3+
"version": "1.9.0-beta.96",
44
"description": "Types and utilities functions between Mesh and cardano-serialization-lib",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.js",
@@ -31,15 +31,15 @@
3131
},
3232
"devDependencies": {
3333
"@meshsdk/configs": "*",
34-
"@meshsdk/provider": "1.9.0-beta.95",
34+
"@meshsdk/provider": "1.9.0-beta.96",
3535
"@types/json-bigint": "^1.0.4",
3636
"eslint": "^8.57.0",
3737
"ts-jest": "^29.1.4",
3838
"tsup": "^8.0.2",
3939
"typescript": "^5.3.3"
4040
},
4141
"dependencies": {
42-
"@meshsdk/common": "1.9.0-beta.95",
42+
"@meshsdk/common": "1.9.0-beta.96",
4343
"@sidan-lab/whisky-js-browser": "^1.0.11",
4444
"@sidan-lab/whisky-js-nodejs": "^1.0.11",
4545
"@types/base32-encoding": "^1.0.2",

packages/mesh-core-cst/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@meshsdk/core-cst",
3-
"version": "1.9.0-beta.95",
3+
"version": "1.9.0-beta.96",
44
"description": "Types and utilities functions between Mesh and cardano-js-sdk",
55
"main": "./dist/index.cjs",
66
"browser": "./dist/index.js",
@@ -44,7 +44,7 @@
4444
"@harmoniclabs/plutus-data": "1.2.6",
4545
"@harmoniclabs/uplc": "1.4.1",
4646
"@harmoniclabs/pair": "^1.0.0",
47-
"@meshsdk/common": "1.9.0-beta.95",
47+
"@meshsdk/common": "1.9.0-beta.96",
4848
"@types/base32-encoding": "^1.0.2",
4949
"base32-encoding": "^1.0.0",
5050
"bech32": "^2.0.0",

0 commit comments

Comments
 (0)