Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare v10.0.0-beta.0 for release #689

Merged
merged 5 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 1 addition & 3 deletions .github/workflows/npm_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: npm publish
on:
release:
types: [published]
push:
branches: [soroban]

jobs:
build:
Expand All @@ -25,6 +23,6 @@ jobs:
run: yarn preversion

- name: Publish release npm package
run: yarn publish --tag soroban
run: yarn publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,37 @@

## Unreleased

### Fixes

## [`v10.0.0-beta.0`](https://github.com/stellar/js-stellar-base/compare/v9.0.0...v10.0.0-beta.0): Protocol 20

### Breaking Changes
* **Node 16 is the new minimum version** to use the SDKs.
* The XDR has been massively overhauled to support Soroban in Protocol 20, which means new operations, data structures, and a transaction format as well as new overlay features ([#538](https://github.com/stellar/js-stellar-base/pull/538)).
Shaptic marked this conversation as resolved.
Show resolved Hide resolved

The core data structure of Soroban is a generic type called an `ScVal` (**s**mart **c**ontract **val**ue, which is a union of types that can basically represent anything [numbers, strings, arrays, maps, contract bytecode, etc.]). You can refer to the XDR for details, and you can rely some new APIs to make dealing with these complex values easier:
Shaptic marked this conversation as resolved.
Show resolved Hide resolved
- `nativeToScVal` helps convert native types to their closes Soroban equivalent
Shaptic marked this conversation as resolved.
Show resolved Hide resolved
- `scValToNative` helps find the closest native JavaScript type(s) corresponding to a smart contract value
- `scValToBigInt` helps convert numeric `ScVal`s into native `bigint`s
- `ScInt` and `XdrLargeInt` help convert to and from `bigint`s to other types and form sized integer types for smart contract usage

### Added
The following are new APIs to deal with new Soroban constructs:
- **`Address`, which helps manage "smart" addresses in the Soroban context.** Addresses there (used for auth and identity purposes) can either be contracts (strkey `C...`) or accounts (strkey `G...`). This abstraction helps manage them and distinguish between them easily.
- **`Contract`, which helps manage contract identifiers.** The primary purpose is to build invocations of its methods via the generic `call(...)`, but it also provides utilities for converting to an `Address` or calculating its minimum footprint for state expiration.
- **Three new operations** have been added related to Soroban transactions:
* `invokeHostFunction` for calling contract code
* `bumpFootprintExpiration` for extending the state lifetime of Soroban data
* `restoreFootprint` for restoring expired, off-chain state back onto the ledger
- The `TransactionBuilder` now takes a `sorobanData` parameter (and has a corresponding `.setSorobanData()` builder method) which primarily describes the storage footprint of a Soroban (that is, which parts of the ledger state [in the form of `xdr.LedgerKey`s] it plans to read and write as part of the transaction).
* To facilitate building this out, there's a new `SorobanDataBuilder` factory to set fields individually
- The `TransactionBuilder` now has a `cloneFrom(tx, opts)` constructor method to create an instance from an existing transaction, also allowing parameter overrides via `opts`.
- The following are convenience methods for building out certain types of smart contract-related structures:
* `buildInvocationTree` and `walkInvocationTree` are both ways to visualize invocation calling trees better
* `authorizeInvocation` helps multiple parties sign invocation calling trees
* `humanizeEvents` helps make diagnostic events more readable
- We've added a GHA to track bundle size changes as PRs are made. This protocol upgrade adds +18% to the final, minified bundle size which is significant but acceptable given the size of the upgrade.

### Fixes
* Improves the error messages when passing invalid amounts to deposit and withdraw operations ([#679](https://github.com/stellar/js-stellar-base/pull/679)).


Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stellar-base",
"version": "10.0.0-soroban.8",
"version": "10.0.0-beta.0",
"description": "Low-level support library for the Stellar network.",
"main": "./lib/index.js",
"browser": {
Expand Down Expand Up @@ -70,21 +70,21 @@
},
"homepage": "https://github.com/stellar/js-stellar-base",
"devDependencies": {
"@babel/cli": "^7.22.10",
"@babel/core": "^7.22.11",
"@babel/eslint-parser": "^7.22.11",
"@babel/cli": "^7.22.15",
"@babel/core": "^7.22.17",
"@babel/eslint-parser": "^7.22.15",
"@babel/eslint-plugin": "^7.22.10",
"@babel/preset-env": "^7.22.14",
"@babel/register": "^7.21.0",
"@definitelytyped/dtslint": "^0.0.176",
"@babel/preset-env": "^7.22.15",
"@babel/register": "^7.22.15",
"@definitelytyped/dtslint": "^0.0.177",
"@istanbuljs/nyc-config-babel": "3.0.0",
"@types/node": "^20.5.7",
"@typescript-eslint/parser": "^6.5.0",
"@types/node": "^20.6.0",
"@typescript-eslint/parser": "^6.7.0",
"babel-loader": "^9.1.3",
"babel-plugin-istanbul": "^6.1.1",
"chai": "^4.3.8",
"cross-env": "^7.0.3",
"eslint": "^8.48.0",
"eslint": "^8.49.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
Expand Down
Loading
Loading