Migration to 10.0.0
This guide describes all breaking changes introduced with v10.0.0
.
pollForQueryResponse
returns response as string (#1285)
pollForQueryResponse
returns response as string (#1285)replace
oldResult.decode
withnew Buffer(newResult)
.replace
oldResult.response
withTxBuilderHelper.encode(new Buffer(newResult), 'or')
.
removed skipArgsConvert
option of contract call and deployment (6d4a599)
skipArgsConvert
option of contract call and deployment (6d4a599)Convert arguments in intermediate Sophia representation to JavaScript types. For example:
rewrite to
removed skipTransformDecoded
option of contract call and deployment (bb49239)
skipTransformDecoded
option of contract call and deployment (bb49239)Decoding to JavaScript types is enforced, please use it instead.
ak_ addresses are not accepted as hashes, bytes, and signatures anymore (cbaac62)
Encode addresses as an ak_
-prefixed string instead.
removed contractEncodeCall
(a4b303f)
contractEncodeCall
(a4b303f)Use contractEncodeCallDataAPI
instead.
removed contractDecodeData
(5df2285)
contractDecodeData
(5df2285)Use contractDecodeCallResultAPI
instead.
removed setOptions
on contract instance (b88e767)
setOptions
on contract instance (b88e767)Pass them through getContractInstance
options instead.
Use getContractInstance
instead. Also, these methods will accept JavaScript-type variables instead of Sophia-encoded. For example:
should be replaced with
dropped compatibility with [email protected] (f9cef12)
Use compiler 6.0.0 and above.
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)
getConsensusProtocolVersion
method (75f0447)Use node.consensusProtocolVersion
instead.
switched to @aeternity/aepp-calldata package (#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 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)
sdk.getContractInstance
(5c690d2)For example:
rewrite to
Contract instance can be generated by ACI and 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)
getContractInstance
accepted as usual ones (10fb7ba)For example, replace
with
drop compatibility with es5 (#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 node_modules
folder except for this package in babe-loader
rule. In @vue/cli
you can use transpileDependencies option.
removed primitives for encryption/decryption by keypairs (#1183)
Use third-party cryptographic packages instead of Crypto.encryptData
, Crypto.decryptData
methods.
aensUpdate
accepts pointers as object (f6b8999)
aensUpdate
accepts pointers as object (f6b8999)For example, replace
with
Additionally, getDefaultPointerKey
(was named classify
before) helper function can be used
Last updated