Migration to 13.0.0
This guide describes all breaking changes introduced with v13.0.0
.
Wallet
onSign
, onMessageSign
callbacks were removed on the wallet side
onSign
, onMessageSign
callbacks were removed on the wallet sideCheck allowance to sign on the account side instead, using aeppOrigin
, aeppRpcClientId
options.
Aepp
All wallet provided nodes have the same name
Specified in name
option of connectToWallet
.
Select option removed from connectToWallet
If you are using connectNode
then the current node would always be the same as wallet provides.
Contract
ACI format used the same as returned by aesophia_cli
aesophia_http old format
aesophia_cli format
params
argument in $deploy
and $call
is required
params
argument in $deploy
and $call
is requiredContract methods accessible on the instance itself
Apply a patch:
contract.methods.<name>.get,send
removed
contract.methods.<name>.get,send
removedUse callStatic
option instead.
contract.bytecode,sourceCode
moved to contract.$options
contract.bytecode,sourceCode
moved to contract.$options
contract.calldata
renamed to contract._calldata
contract.calldata
renamed to contract._calldata
Use contract._calldata
(considered to be a private field) or aepp-calldata package directly.
contract.options
renamed to contract.$options
contract.options
renamed to contract.$options
contract.deployInfo
removed
contract.deployInfo
removedUse the return value of contract.$deploy
instead. contract.deployInfo.address
moved to contract.$options.address
.
contract.decodeEvents
renamed to contract.$decodeEvents
contract.decodeEvents
renamed to contract.$decodeEvents
contract.call
renamed to contract.$call
contract.call
renamed to contract.$call
contract.compile
renamed to contract.$compile
contract.compile
renamed to contract.$compile
contract.deploy
renamed to contract.$deploy
contract.deploy
renamed to contract.$deploy
createAensDelegationSignature
, createOracleDelegationSignature
removed
createAensDelegationSignature
, createOracleDelegationSignature
removedUse createDelegationSignature
instead.
use sourceCode
instead of source
sourceCode
instead of source
It is related to getContractInstance
and signing using Generalized accounts. Apply a change:
getContractInstance
accepts address
instead of contractAddress
getContractInstance
accepts address
instead of contractAddress
Apply a change:
getContractInstance
function replaced with Contract class
getContractInstance
function replaced with Contract classApply a patch:
AeSdk.getContractInstance
renamed to AeSdk.initializeContract
AeSdk.getContractInstance
renamed to AeSdk.initializeContract
prepareTxParams
, getVmVersion
are not exported anymore
prepareTxParams
, getVmVersion
are not exported anymoreUse buildTx
instead.
isGA
method removed
isGA
method removedUse (await aeSdk.getAccount(<address>)).kind === 'generalized'
instead.
Transaction builder
writeInt
function removed
writeInt
function removedUse toBytes
util instead.
returnType
of contract call result structure is a value of CallReturnType enum
returnType
of contract call result structure is a value of CallReturnType enumApply a patch:
writeId
, readId
functions removed
writeId
, readId
functions removedUse transaction builder instead.
readPointers
, buildPointers
functions removed
readPointers
, buildPointers
functions removedUse transaction builder instead.
formatSalt
function removed
formatSalt
function removedUse Buffer.from(<salt>.toString(16).padStart(64, '0'), 'hex')
instead.
validateParams
, unpackRawTx
functions removed
validateParams
, unpackRawTx
functions removedUse transaction builder instead.
AMOUNT
constant removed
AMOUNT
constant removedIf necessary, use 0
instead.
StateTrees fields decoded as objects mapping key to decoded entry instead of internals
The content of Tag.*Mtree entries decoded and moved to payload
field
payload
fieldTX_SCHEMA, TxParamsCommon, TxSchema, TxTypeSchemas are not exported anymore
TX_TTL
is not exported anymore
TX_TTL
is not exported anymoreUse 0
instead.
Enum FIELD_TYPES
is not exported anymore
FIELD_TYPES
is not exported anymoreNot able to build/unpack CompilerSophia entry (tag 70)
Enums PROTOCOL_VM_ABI
, interface CtVersion
not exported anymore
PROTOCOL_VM_ABI
, interface CtVersion
not exported anymoreEnums VM_VERSIONS
, ABI_VERSIONS
, PROTOCOL_VERSIONS
renamed
VM_VERSIONS
, ABI_VERSIONS
, PROTOCOL_VERSIONS
renamedThey are exported as VmVersion
, AbiVersion
, ConsensusProtocolVersion
.
stateHash
of Channel entry decoded as st_
-prefixed string instead of hex
stateHash
of Channel entry decoded as st_
-prefixed string instead of hexSpendTx payload
doesn't accept arbitrary strings anymore
payload
doesn't accept arbitrary strings anymoreProvide a ba_
-encoded string instead.
verifyTransaction
doesn't accept parent tx types anymore
verifyTransaction
doesn't accept parent tx types anymorebuildTx
doesn't accept excludeKeys
option anymore
buildTx
doesn't accept excludeKeys
option anymoreConsider opening an issue, if you need this functionality.
Use version
instead of VSN
, vsn
in unpackTx
, buildTx
version
instead of VSN
, vsn
in unpackTx
, buildTx
buildTx
accepts transaction type and version in the first argument
buildTx
accepts transaction type and version in the first argumentApply a change:
AeSdk.buildTx accepts tag
in options
tag
in optionsReplace aeSdk.buildTx(Tag.SpendTx, { ... })
with aeSdk.buildTx({ ..., tag: Tag.SpendTx })
.
sync buildTx
accepts denomination
in the first argument
buildTx
accepts denomination
in the first argumentunpackTx
return an object of transaction parameters
unpackTx
return an object of transaction parametersUse unpackTx(...)
instead of unpackTx(...).tx
.
unpackTx
doesn't return rlpEncoded
anymore
unpackTx
doesn't return rlpEncoded
anymoreUse decode(buildTx(unpackTx(...)))
instead.
unpackTx
doesn't return txType
anymore
unpackTx
doesn't return txType
anymoreUse unpackTx(...).tag
instead.
buildTx
return string instead of object
buildTx
return string instead of objectUse just buildTx(...)
instead of buildTx(...).tx
.
buildTx
doesn't return txObject
anymore
buildTx
doesn't return txObject
anymoreUse unpackTx(buildTx(...))
instead.
buildTx
doesn't return binary
anymore
buildTx
doesn't return binary
anymoreUse require('rlp').decode(decode(buildTx(...)))
instead.
buildTx
doesn't return rlpEncoded
anymore
buildTx
doesn't return rlpEncoded
anymoreUse decode(buildTx(...))
instead.
key
of MtreeValue entry decoded as a buffer instead of a hex
key
of MtreeValue entry decoded as a buffer instead of a hexTxBuilder accepts and returns poi
field unpacked as TreesPoi
poi
field unpacked as TreesPoiget
method of MPTree accepts and returns typed values
get
method of MPTree accepts and returns typed valuesApply a change:
Compiler
Compiler
export renamed to CompilerHttp
Compiler
export renamed to CompilerHttp
removed AeSdk:compilerUrl, AeSdk:setCompilerUrl
A compiler instance needs to be passed explicitly in onCompiler
option:
Methods of CompilerHttp
moved to api
property
CompilerHttp
moved to api
propertyApply a patch:
Dropped compatibility with aesophia_http below 7.1.1, aesophia_cli below 7.0.1
Account
createGeneralizedAccount
accepts sourceCode
in options
createGeneralizedAccount
accepts sourceCode
in optionsApply a patch:
createMetaTx
removed
createMetaTx
removedUse AccountGeneralized.signTransaction
instead.
AccountRpc
constructor accepts arguments one by one
AccountRpc
constructor accepts arguments one by oneApply a change:
AccountMemory
requires networkId
in signTransaction
AccountMemory
requires networkId
in signTransaction
AccountBase
simplified
AccountBase
simplifiednetworkId
removedgetNetworkId
method removedsignTransaction
,signMessage
made abstract
address
in AccountBase
is a property
address
in AccountBase
is a propertyApply a change:
MemoryAccount accepts only secretKey
Apply a change:
MemoryAccount is not compatible with GA
Apply a change:
Node
url
property of Node
removed
url
property of Node
removedUse autorest's $host
property instead.
Oracle
QUERY_FEE
is not exported anymore
QUERY_FEE
is not exported anymoreUse 30000 instead if necessary.
Oracles created without queryFee by default
Specify queryFee
in registerOracle
if needed.
AeSdk:extendOracleTtl, AeSdk:respondToQuery doesn't accept oracleId
Remove the first argument.
onQuery
callback of pollForQueries
, oracle.pollQueries
accepts a single query
onQuery
callback of pollForQueries
, oracle.pollQueries
accepts a single queryIt was accepting an array before. Apply a patch:
Chain
send
inlined into sendTransaction
send
inlined into sendTransaction
Pass not signed transaction to sendTransaction
. If you need to post signed transaction use Node:postTransaction.
AENS
height
removed from the output of aensPreclaim
height
removed from the output of aensPreclaim
Use blockHeight
instead:
Channel
Channel:state returns unpacked entries
Use buildTx
to pack them back if needed.
All channel events emitted in snakeCase
Affected events: 'own_withdraw_locked', 'withdraw_locked', 'own_deposit_locked', 'deposit_locked', 'peer_disconnected', 'channel_reestablished'.
Channel:poi returns unpacked TreesPoi
Use just await channel.poi(...)
instead of unpackTx(await channel.poi(...))
.
Other
onAccount
doesn't accept keypair
onAccount
doesn't accept keypairApply a change:
bigNumberToByteArray
removed
bigNumberToByteArray
removedUse toBytes
instead.
str2buf
function removed
str2buf
function removedUse Buffer.from(<data>, <encoding>)
instead.
getAddressFromPriv
doesn't accept private key as base64-encoded or raw string
getAddressFromPriv
doesn't accept private key as base64-encoded or raw stringisValidKeypair
doesn't accept public key as base64-encoded string
isValidKeypair
doesn't accept public key as base64-encoded stringbytesToHex
function removed
bytesToHex
function removedUse Buffer.from(<bytes>).toString('hex')
instead.
hexToBytes
function removed
hexToBytes
function removedUse Buffer.from(<hex string>, 'hex')
instead.
rename umd export to Aeternity
Aeternity
Subpaths imports of SDK are not allowed
SDK does versioning only for the API provided in the root export. Replace subpaths imports with imports of the package root.
Removed getNetworkId
from AeSdkBase
getNetworkId
from AeSdkBase
Use Node.getNetworkId
instead.
address
a getter in AeSdkBase
address
a getter in AeSdkBaseApply a change:
addAccount
is a sync function
addAccount
is a sync functionverifyMessage
removed from accounts and AeSdkBase
verifyMessage
removed from accounts and AeSdkBaseUse verifyMessage
exported in the root instead.
verify
and verifyMessage
accepts address instead of hex string or Uint8Array
verify
and verifyMessage
accepts address instead of hex string or Uint8ArrayConvert public key in Uint8Array to address using encode(pk, 'ak')
. Convert public key in hex to address using encode(Buffer.from(pk, 'hex'), 'ak')
.
node@12 not supported
Use [email protected] or newer.
removeAccount
throws an error if the account is not found
removeAccount
throws an error if the account is not foundsignMessage
always returns Uint8Array
signMessage
always returns Uint8Array
Use Buffer.from(signature).toString('hex')
to convert it to hex.
encryptKey
, decryptKey
are not exported anymore
encryptKey
, decryptKey
are not exported anymoreUse 'sha.js' and 'aes-js' packages directly instead.
sha256hash
is not exported anymore
sha256hash
is not exported anymoreUse SubtleCrypto.digest
or sha.js
package instead.
height
method removed
height
method removedUse getHeight
instead.
signUsingGA
method removed
signUsingGA
method removedUse AccountGeneralized.signTransaction
instead.
POINTER_KEY_BY_PREFIX
removed
POINTER_KEY_BY_PREFIX
removedUse getDefaultPointerKey
instead.
ID_TAG_PREFIX
, PREFIX_ID_TAG
, ID_TAG
removed
ID_TAG_PREFIX
, PREFIX_ID_TAG
, ID_TAG
removedUse transaction builder instead.
TX_TYPE
removed.
TX_TYPE
removed.Use Tag
instead.
GAS_MAX
removed
GAS_MAX
removedThe maximum gas limit depends on transaction size, this value is outdated, sdk check/provides gasLimit by itself while building a transaction.
calculateMinFee
removed
calculateMinFee
removedUse buildTx
to generate a transaction, unpack it and refer to fee
field.
salt
, createSalt
removed
salt
, createSalt
removedUse genSalt
instead.
Pointer
removed
Pointer
removedUse NamePointer from apis/node instead.
Last updated