This guide describes all breaking changes introduced with v14.0.0
.
Minimum supported versions:
- [email protected]
- [email protected]
- aeternity node 7.1.0
- [email protected]
- aesophia@8
Stick to a previous sdk version if it is required.
If you are importing files explicitly from dist
folder then you need to update the extension
- https://unpkg.com/@aeternity/aepp-sdk/dist/aepp-sdk.browser-script.js
+ https://unpkg.com/@aeternity/aepp-sdk/dist/aepp-sdk.browser-script.cjs
Copy the removed implementation to your project or add a previous sdk as a separate dependency
"dependencies": {
"@aeternity/aepp-sdk": "^14.0.0",
"@aeternity/aepp-sdk-13": "npm:@aeternity/aepp-sdk@^13.3.3"
}
It is made to don't break caching. If you need to change a server URL, create a new server instance instead.
- node.$host = 'http://example.com';
+ node = new Node('http://example.com');
Because it is not thrown by wallet as well.
Use signDelegation
api instead.
Provide a function throwing RpcMethodNotFoundError
if you don't want to support network change by
aepp.
You couldn't use it because it is not supported on the node side.
These values provided by default in buildTx, if necessary define them as
const ORACLE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 500 };
const QUERY_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };
const RESPONSE_TTL = { type: ORACLE_TTL_TYPES.delta, value: 10 };
If you need to work with node's entry use packEntry
/unpackEntry
.
Node entries tags moved to EntryTag
.
Use decode
/encode
to convert payload to desired format.
These values provided by default in buildTx, if necessary define them as
const NAME_TTL = 180000;
const NAME_MAX_TTL = 36000;
const NAME_MAX_CLIENT_TTL = 86400;
const CLIENT_TTL = 86400;
Apply a change
-const time = new Date(
- (await node.getTopHeader()).time,
-);
+const time = (await node.getTopHeader()).time;
Namely: deriveChild
, derivePathFromKey
, getMasterKeyFromSeed
,
derivePathFromSeed
, getKeyPair
, generateSaveHDWalletFromSeed
,
getSaveHDWalletAccounts
, getHdWalletAccountFromSeed
.
Use AccountMnemonicFactory instead.
Use MemoryAccount:sign, MemoryAccount:signMessage instead.
Create a MemoryAccount by a secret key and compare it's address with an address in the key pair instead.
Use MemoryAccount instead.
- address = getAddressFromPriv(secretKeyOldFormat)
+ address = new MemoryAccount(secretKeyNewFormat).address
Use SDK tools page to convert secret keys.
Use MemoryAccount::generate instead.
Optionally add decode
if you need raw keys.
Obtain the secret key via MemoryAccount:secretKey.
Use MemoryAccount instead.
- const keyPair = generateKeyPairFromSecret(rawSecretKey)
+ const secretKey = encode(rawSecretKey.subarray(0, 32), Encoding.AccountSecretKey)
+ const account = new MemoryAccount(secretKey)
+ const keyPair = {
+ publicKey: decode(account.address),
+ secretKey: rawSecretKey,
+ }
Convert secret key as hex to new format as
const oldSk =
'9ebd7beda0c79af72a42ece3821a56eff16359b6df376cf049aee995565f022f840c974b97164776454ba119d84edc4d6058a8dec92b6edc578ab2d30b4c4200';
const newSk = encode(Buffer.from(oldSk, 'hex').subarray(0, 32), Encoding.AccountSecretKey);
// 'sk_2CuofqWZHrABCrM7GY95YSQn8PyFvKQadnvFnpwhjUnDCFAWmf'
Use SDK tools page to convert secret keys.
You can throw an exception if the account operation is not doable.
Use Name class instead.
-await aeSdk.aensPreclaim('example.chain')
+const name = new Name('example.chain', aeSdk.getContext())
+await name.preclaim()
Accordingly for other methods:
aensRevoke => Name:revoke
aensUpdate => Name:update
aensTransfer => Name:transfer
aensQuery => Name:getState
aensClaim => Name:claim
aensBid => Name:bid
Use isAuctionName
function instead.
Use Oracle, OracleClient classes instead.
-aeSdk.pollForQueries(queryHandler)
+const oracle = new Oracle(account, aeSdk.getContext());
+oracle.pollQueries(queryHandler)
Accordingly for other methods:
extendOracleTtl => Oracle:extendTtl
respondToQuery => Oracle:respondToQuery
getOracleObject => Oracle:getState
registerOracle => Oracle:register
getQueryObject => Oracle:getQuery, OracleClient:getQuery
postQueryToOracle => OracleClient:postQuery
pollForQueryResponse => OracleClient:pollForResponse
Use includeResponded
option to restore the previous behavior.
Use CompilerCli instead.
Use ContractByteArrayEncoder:encodeWithType, decodeWithType from @aeternity/aepp-calldata
.
Use Contract.initialize
instead:
- aeSdk.initializeContract(options)
+ Contract.initialize({ ...aeSdk.getContext(), ...options })
Use packDelegation
and AccountBase::signDelegation instead.
-const dlg = await aeSdk.createDelegationSignature(contractAddress, [name]);
+const dlg = await aeSdk.signDelegation(
+ packDelegation({
+ tag: DelegationTag.AensName,
+ accountAddress: aeSdk.address,
+ contractAddress,
+ nameId: name,
+ }),
+);
Namely:
signDelegationToContract
,signNameDelegationToContract
,signAllNamesDelegationToContract
,signOracleQueryDelegationToContract
.
Use signDelegation
instead.