This guide describes all breaking changes introduced with v13.0.0
.
Check allowance to sign on the account side instead, using aeppOrigin
, aeppRpcClientId
options.
Specified in name
option of connectToWallet
.
If you are using connectNode
then the current node would always be the same as wallet provides.
aesophia_http old format
{
"encoded_aci": { contract: <1> },
"external_encoded_aci": [<2>]
}
aesophia_cli format
[<2>, { contract: <1> }]
Apply a patch:
-const contract = aeSdk.getContractInstance(<contract args>);
+const contract = aeSdk.getContractInstance<{ foo: (a: bigint) => bigint }>(<contract args>);
-await contract.methods.foo(<arguments>);
+await contract.foo(<arguments>);
Use callStatic
option instead.
Use contract._calldata
(considered to be a private field) or aepp-calldata package directly.
Use the return value of contract.$deploy
instead.
contract.deployInfo.address
moved to contract.$options.address
.
Use createDelegationSignature
instead.
It is related to getContractInstance
and signing using Generalized accounts. Apply a change:
-aeSdk.getContractInstance({ source: <contract source code>, ... })
+aeSdk.getContractInstance({ sourceCode: <contract source code>, ... })
-aeSdk.spend(..., { authData: { source: <contract source code>, args: [...] } })
+aeSdk.spend(..., { authData: { sourceCode: <contract source code>, args: [...] } })
Apply a change:
-aeSdk.getContractInstance({ contractAddress: <contract address>, ... })
+aeSdk.getContractInstance({ address: <contract address>, ... })
Apply a patch:
-contract = await getContractInstance(<options>);
+contract = await Contract.initialize(<options>);
Use buildTx
instead.
Use (await aeSdk.getAccount(<address>)).kind === 'generalized'
instead.
Use toBytes
util instead.
Apply a patch:
-contractCall.returnType === "error"
+contractCall.returnType === CallReturnType.Error
Use transaction builder instead.
Use transaction builder instead.
Use Buffer.from(<salt>.toString(16).padStart(64, '0'), 'hex')
instead.
Use transaction builder instead.
If necessary, use 0
instead.
Use 0
instead.
They are exported as VmVersion
, AbiVersion
, ConsensusProtocolVersion
.
Provide a ba_
-encoded string instead.
-payload: 'test',
+payload: encode(Buffer.from('test'), Encoding.Bytearray),
Consider opening an issue, if you need this functionality.
Apply a change:
-buildTx({ ... }, Tag.SpendTx, { version: 2 })
+buildTx({ ..., tag: Tag.SpendTx, version: 2 })
Replace aeSdk.buildTx(Tag.SpendTx, { ... })
with aeSdk.buildTx({ ..., tag: Tag.SpendTx })
.
-buildTx({ ... }, { denomination: AE_AMOUNT_FORMATS.AETTOS })
+buildTx({ ..., denomination: AE_AMOUNT_FORMATS.AETTOS })
Use unpackTx(...)
instead of unpackTx(...).tx
.
Use decode(buildTx(unpackTx(...)))
instead.
Use unpackTx(...).tag
instead.
Use just buildTx(...)
instead of buildTx(...).tx
.
Use unpackTx(buildTx(...))
instead.
Use require('rlp').decode(decode(buildTx(...)))
instead.
Use decode(buildTx(...))
instead.
Apply a change:
-unpackTx(tree.get(decode('ak_97...')))
+tree.get('ak_97...')
A compiler instance needs to be passed explicitly in onCompiler
option:
-import { AeSdk } from '@aeternity/aepp-sdk';
+import { AeSdk, CompilerHttp } from '@aeternity/aepp-sdk';
const aeSdk = new AeSdk({
- compilerUrl: <compiler url>,
+ onCompiler: new CompilerHttp(<compiler url>),
});
Apply a patch:
-compilerHttp.generateACI({ code: sourceCode });
+compilerHttp.api.generateACI({ code: sourceCode });
Apply a patch:
-aeSdk.createGeneralizedAccount('authorize', sourceCode, ['arg-1']);
+aeSdk.createGeneralizedAccount('authorize', ['arg-1'], { sourceCode });
Use AccountGeneralized.signTransaction
instead.
Apply a change:
-new AccountRpc({ rpcClient: <rpc client>, address: <address> })
+new AccountRpc(<rpc client>, <address>)
networkId
removedgetNetworkId
method removedsignTransaction
,signMessage
made abstract
Apply a change:
-await accountMemory.address(options)
+accountMemory.address
Apply a change:
-new MemoryAccount({ keypair: { publicKey: 'ak_..', secretKey: <secret key> } })
+new MemoryAccount(<secret key>)
Apply a change:
-new MemoryAccount({ gaId: <address> })
+new AccountGeneralized(<address>)
Use autorest's $host
property instead.
Use 30000 instead if necessary.
Specify queryFee
in registerOracle
if needed.
Remove the first argument.
It was accepting an array before. Apply a patch:
-aeSdk.pollForQueries(oracleId, (queries) => queries.forEach(handleQuery));
+aeSdk.pollForQueries(oracleId, handleQuery);
Pass not signed transaction to sendTransaction
.
If you need to post signed transaction use Node:postTransaction.
Use blockHeight
instead:
const res = aeSdk.aensPreclaim('name.chain');
-res.height
+res.blockHeight - 1
Use buildTx
to pack them back if needed.
Affected events: 'own_withdraw_locked', 'withdraw_locked', 'own_deposit_locked', 'deposit_locked', 'peer_disconnected', 'channel_reestablished'.
Use just await channel.poi(...)
instead of unpackTx(await channel.poi(...))
.
Apply a change:
-aeSdk.<metnod name>(..., { onAccount: <keypair> })
+aeSdk.<metnod name>(..., { onAccount: new MemoryAccount(<keypair>.secretKey) })
Use toBytes
instead.
Use Buffer.from(<data>, <encoding>)
instead.
Use Buffer.from(<bytes>).toString('hex')
instead.
Use Buffer.from(<hex string>, 'hex')
instead.
SDK does versioning only for the API provided in the root export. Replace subpaths imports with imports of the package root.
-import MemoryAccount from '@aeternity/aepp-sdk/es/account/Memory.mjs';
+import { MemoryAccount } from '@aeternity/aepp-sdk';
Use Node.getNetworkId
instead.
Apply a change:
-await aeSdk.address()
+aeSdk.address
Use verifyMessage
exported in the root instead.
Convert public key in Uint8Array to address using encode(pk, 'ak')
.
Convert public key in hex to address using encode(Buffer.from(pk, 'hex'), 'ak')
.
Use node@14.19 or newer.
Use Buffer.from(signature).toString('hex')
to convert it to hex.
Use 'sha.js' and 'aes-js' packages directly instead.
Use SubtleCrypto.digest
or sha.js
package instead.
Use getHeight
instead.
Use AccountGeneralized.signTransaction
instead.
Use getDefaultPointerKey
instead.
Use transaction builder instead.
Use Tag
instead.
The maximum gas limit depends on transaction size, this value is outdated, sdk check/provides gasLimit by itself while building a transaction.
Use buildTx
to generate a transaction, unpack it and refer to fee
field.
Use genSalt
instead.
Use NamePointer from apis/node instead.