Skip to content

Commit

Permalink
refactor: move to new network model
Browse files Browse the repository at this point in the history
  • Loading branch information
janniks committed Nov 13, 2023
1 parent d05c4a9 commit 4e6c8b3
Show file tree
Hide file tree
Showing 42 changed files with 1,322 additions and 1,808 deletions.
31 changes: 30 additions & 1 deletion .github/MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Migration Guides

- [Stacks.js (\<=4.x.x) → (5.x.x)](#stacksjs-4xx--5xx)
- [Stacks.js (\>=5.x.x) → (7.x.x)](#stacksjs-5xx--7xx)
- [Breaking Changes](#breaking-changes)
- [StacksNetwork \& the `@stacks/api` package](#stacksnetwork--the-stacksapi-package)
- [Stacks.js (\<=4.x.x) → (5.x.x)](#stacksjs-4xx--5xx)
- [Breaking Changes](#breaking-changes-1)
- [Buffer to Uint8Array](#buffer-to-uint8array)
- [Message Signing Prefix](#message-signing-prefix)
- [blockstack.js → Stacks.js (1.x.x)](#blockstackjs--stacksjs-1xx)
Expand All @@ -14,6 +17,32 @@
- [Using blockstack.js](#using-blockstackjs-2)
- [Using @stacks/encryption or @stacks/auth](#using-stacksencryption-or-stacksauth)

## Stacks.js (&gt;=5.x.x) → (7.x.x)

### Breaking Changes

- The `@stacks/network` package was removed. Similar functionality is now available in `@stacks/api` and `@stacks/common`. [Read more...](#stacksapi-package)
-
- Clarity ABI helpers were moved to the `@stacks/common` package.

### StacksNetwork & the `@stacks/api` package

Stacks network objects are now exported by the `@stacks/common` package.
They are used to specify network settings for other functions and don't require instantiation (like the `@stacks/network` approach did).

```ts
import { STACKS_MAINNET } from '@stacks/common';
```

The new `@stacks/api` package lets you interact with a Stacks node or API.

```ts
import { StacksApi } from '@stacks/api';

const api = new StacksApi();
await api.broadcastTx(txHex);
```

## Stacks.js (&lt;=4.x.x) → (5.x.x)

### Breaking Changes
Expand Down
5 changes: 3 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

268 changes: 0 additions & 268 deletions packages/api/CHANGELOG.md

This file was deleted.

Loading

0 comments on commit 4e6c8b3

Please sign in to comment.