> For the complete documentation index, see [llms.txt](https://docs.aeternity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aeternity.com/developer-documentation/aepp-sdk-js/docs/guides/migration/10.md).

# Migration to 10.0.0

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

### `pollForQueryResponse` returns response as string ([#1285](https://github.com/aeternity/aepp-sdk-js/pull/1285))

* replace `oldResult.decode` with `new Buffer(newResult)`.
* replace `oldResult.response` with `TxBuilderHelper.encode(new Buffer(newResult), 'or')`.

### removed `skipArgsConvert` option of contract call and deployment ([6d4a599](https://github.com/aeternity/aepp-sdk-js/commit/6d4a59986d6833866b6828085fad96b364e5d315))

Convert arguments in intermediate Sophia representation to JavaScript types.\
For example:

```js
contract.methods.listFn('[1, 2]', { skipArgsConvert: false });
```

rewrite to

```js
contract.methods.listFn([1, 2]);
```

### removed `skipTransformDecoded` option of contract call and deployment ([bb49239](https://github.com/aeternity/aepp-sdk-js/commit/bb492396a29d673f02eee7cfec4e114c2fba2f3c))

Decoding to JavaScript types is enforced, please use it instead.

### ak\_ addresses are not accepted as hashes, bytes, and signatures anymore ([cbaac62](https://github.com/aeternity/aepp-sdk-js/commit/cbaac6263dd1729d64ef3a01c94e10687fed3b0d))

Encode addresses as an `ak_`-prefixed string instead.

### removed `contractEncodeCall` ([a4b303f](https://github.com/aeternity/aepp-sdk-js/commit/a4b303fbcc3b7cc544a2b5b3415d0f4a147b488c))

Use `contractEncodeCallDataAPI` instead.

### removed `contractDecodeData` ([5df2285](https://github.com/aeternity/aepp-sdk-js/commit/5df2285a7b5694475554e5154c544e0885bd4b33))

Use `contractDecodeCallResultAPI` instead.

### removed `setOptions` on contract instance ([b88e767](https://github.com/aeternity/aepp-sdk-js/commit/b88e767c86874f259ff7a1eb1784c368524e7167))

Pass them through `getContractInstance` options instead.

### `contractCallStatic`, `contractCall`, `contractDeploy` are deprecated now ([c4ec019](https://github.com/aeternity/aepp-sdk-js/commit/c4ec019372f5d5745378e781afb1eb6b2b5acfeb))

Use `getContractInstance` instead. Also, these methods will accept JavaScript-type variables instead of\
Sophia-encoded. For example:

```js
sdk.contractCallStatic(source, address, methodName, ['42']);
```

should be replaced with

```js
sdk.contractCallStatic(source, address, methodName, [42]);
```

### dropped compatibility with compiler\@4.1.0 ([f9cef12](https://github.com/aeternity/aepp-sdk-js/commit/f9cef12a7db4b2559519ef7f8380cc9e89630492))

Use compiler 6.0.0 and above.

### invert and rename `forceCodeCheck` option to `validateBytecode` in `getContractInstance` ([72122fa](https://github.com/aeternity/aepp-sdk-js/commit/72122facdcec9921202b210c387c19509b26e578))

Use `validateBytecode` when you need to ensure that the source code/bytecode provided to`getContractInstance` corresponds to the on-chain bytecode.

### removed `getConsensusProtocolVersion` method ([75f0447](https://github.com/aeternity/aepp-sdk-js/commit/75f044792bd2d81eca3a2abc8218e8ca5f167134))

Use `node.consensusProtocolVersion` instead.

### switched to @aeternity/aepp-calldata package ([#1313](https://github.com/aeternity/aepp-sdk-js/pull/1313))

Numbers in Sophia are not limited in size. Before they were returned from contract methods as usual\
JavaScript numbers that have limited accuracy. To fix this, we make it return instances of BigInt.

Variant types are now supported by sdk, so replace `"RelativeTTL(50)"` with `{ RelativeTTL: [50] }`.\
As an exception `Some(value)` is converted to the exact value in JavaScript and `None` is converted to `undefined`\
(Sophia's `option` type).

Contract methods will accept/return instances of JavaScript's `Map` as variables of Sophia's `map`\
type. Objects are not accepted as maps any longer.

Sophia's `hash`, `signature`, `bytes` types return values as `Uint8Array` instead of a hex-encoded\
string.

Check the [documentation](https://github.com/aeternity/aepp-calldata-js/blob/master/README.md)\
of calldata package for additional info.

Use `.decodedResult` instead of `.decode()` to get the result of method call.

Most of the errors thrown by contract iterations will be different due to doing validation using\
calldata package instead of `joi`.

### pass source in options of `sdk.getContractInstance` ([5c690d2](https://github.com/aeternity/aepp-sdk-js/commit/5c690d2d77a433c8496ab9cda6fd66e52a6b4b23))

For example:

```js
sdk.getContractInstance(contractSource, { contractAddress: '...' });
```

rewrite to

```js
sdk.getContractInstance({ source: contractSource, contractAddress: '...' });
```

Contract instance can be generated by ACI and bytecode:

```js
sdk.getContractInstance({ aci, bytecode });
```

SDK won't use hosted compiler in this case.

Also, `contract.compiled` was renamed to `contract.bytecode`.

### additional options of `getContractInstance` accepted as usual ones ([10fb7ba](https://github.com/aeternity/aepp-sdk-js/commit/10fb7bad8f61b973c1be5daec50909d251ec1f90))

For example, replace

```js
sdk.getContractInstance({ source, opt: { ttl: 1 } });
```

with

```js
sdk.getContractInstance({ source, ttl: 1 });
```

### drop compatibility with es5 ([#1331](https://github.com/aeternity/aepp-sdk-js/pull/1331))

To support old environments, you need to set up transpilation of SDK package while building your\
app. In Webpack it can be done by [excluding](https://webpack.js.org/configuration/module/#ruleexclude)`node_modules` folder except for this package in `babe-loader` rule. In `@vue/cli` you can use[transpileDependencies](https://cli.vuejs.org/config/#transpiledependencies) option.

### removed primitives for encryption/decryption by keypairs ([#1183](https://github.com/aeternity/aepp-sdk-js/pull/1183))

Use third-party cryptographic packages instead of `Crypto.encryptData`, `Crypto.decryptData`\
methods.

### `aensUpdate` accepts pointers as object ([f6b8999](https://github.com/aeternity/aepp-sdk-js/commit/f6b8999ac70d10c5455e9a45d8ad65e161d28ca4))

For example, replace

```js
sdk.aensUpdate('test.chain', ['ak_2519mBsgjJEVEFoRgno1ryDsn3BEaCZGRbXPEjThWYLX9MTpmk']);
```

with

```js
sdk.aensUpdate('test.chain', {
  account_pubkey: 'ak_2519mBsgjJEVEFoRgno1ryDsn3BEaCZGRbXPEjThWYLX9MTpmk',
});
```

Additionally, `getDefaultPointerKey` (was named `classify` before) helper function can be used

```js
import { getDefaultPointerKey } from '@aeternity/aepp-sdk';

const address = 'ak_2519mBsgjJEVEFoRgno1ryDsn3BEaCZGRbXPEjThWYLX9MTpmk';
sdk.aensUpdate('test.chain', { [getDefaultPointerKey(address)]: address });
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
