# Migration to 9.0.0

This guide describes all breaking changes introduced with `v9.0.0`.

## drop `waitMined` static method

If you used it like

```js
const sdk = await Universal({ ... })
sdk.waitMined(false)
```

then you have to rewrite it using Stamp composition

```js
const sdk = await Universal.compose({
  deepProps: { Ae: { defaults: { waitMined: false } } }
})({ ... })
```

or pass it to specific methods, like

```js
sdk.spend(amount, receiver, { waitMined: false });
```

or even

```js
const sdk = await Universal({ ... })
sdk.deepProps({ Ae: { defaults: { waitMined: false } } })
```

## drop `assertedType`, use `decode` instead

If you used it like

```js
const payload = Crypto.decodeBase64Check(Crypto.assertedType('tx_...', 'tx'));
```

then you have to rewrite it using `decode` method

```js
const payload = TxBuilderHelper.decode('tx_...', 'tx');
```

## **validator:** recursive validator, simplify schema

Instead of `TransactionValidator` stamp use `verifyTransaction` function. The function accepts\
a transaction, and a Node instance for validation (instead of network id), it doesn't return\
an unpacked transaction anymore, just an array of errors. Each error contains a verbose `message`\
(`msg` before), unique `key` (for easy comparison), `checkedKeys` array (`txKey` before). Using`node` instead of `networkId` allows to ensure transaction validation, so warnings are errors\
now (`type` field removed).

`SCHEMA` doesn't contain validation schema anymore. This wasn't supposed to be used by external\
developers.

## simplify buildTxHash helper

If you used `buildHash` like

```js
const hash = TxBuilderHelper.buildHash('xx', Buffer.from([1, 2, 3]), { raw: true });
```

then use

```js
const hash = Crypto.hash(Buffer.from([1, 2, 3]));
```

If you used it with a falsy `raw` then

```js
const hash = TxBuilderHelper.encode(Crypto.hash(Buffer.from([1, 2, 3])), 'xx');
```

`buildTxHash` don't have `raw` switch anymore, it returns `th_`-encoded string in all cases,\
but it still accepts transactions as a string and as a buffer.

## enable verification in deep props instead of extra variable

If you were passing `verifyTx: false` to sdk factory then use `verify: false` instead.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aeternity.com/developer-documentation/aepp-sdk-js/docs/guides/migration/9.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
