Releases: aeternity/aepp-sdk-js
13.0.0
⚠ BREAKING CHANGES
Please check out migration guide, and release notes for the beta release.
- aepp: All wallet provided nodes have the same name
Specified inname
option ofconnectToWallet
. - aepp: Select option removed from connectToWallet
If you are usingconnectNode
then the current node would always be the same as wallet provides.
Features
Bug Fixes
13.0.0-beta.0
⚠ BREAKING CHANGES
Please check out migration guide.
Wallet
onSign
,onMessageSign
callbacks were removed on the wallet side
Contract
- ACI format used the same as returned by aesophia_cli
createAensDelegationSignature
,createOracleDelegationSignature
replaced withcreateDelegationSignature
params
argument in$deploy
and$call
is requiredAeSdk.getContractInstance
renamed toAeSdk.initializeContract
getContractInstance
function replaced with Contract class- Contract methods accessible on the instance itself
contract.methods.<name>.get,send
removedcontract.bytecode,sourceCode
moved tocontract.$options
contract.calldata
renamed tocontract._calldata
contract.deployInfo
removedcontract.options
renamed tocontract.$options
contract.decodeEvents
renamed tocontract.$decodeEvents
contract.call
renamed tocontract.$call
contract.compile
renamed tocontract.$compile
contract.deploy
renamed tocontract.$deploy
- use
sourceCode
instead ofsource
getContractInstance
acceptsaddress
instead ofcontractAddress
prepareTxParams
,getVmVersion
are not exported anymoreisGA
method removed
Transaction builder
- 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 - TX_SCHEMA, TxParamsCommon, TxSchema, TxTypeSchemas not exported anymore
- AeSdk.buildTx accepts
tag
in options TX_TTL
not exported anymore- sync
buildTx
acceptsdenomination
in the first argument - Enum
FIELD_TYPES
is not exported anymore - Not able to build/unpack CompilerSophia entry (tag 70)
- Enums
PROTOCOL_VM_ABI
, interfaceCtVersion
not exported anymore - Enums
VM_VERSIONS
,ABI_VERSIONS
,PROTOCOL_VERSIONS
renamed stateHash
of Channel entry decoded asst_
-prefixed string instead of hexkey
of MtreeValue entry decoded as a buffer instead of a hex- SpendTx
payload
doesn't accept arbitrary strings anymore unpackTx
return an object of transaction parametersunpackTx
doesn't returnrlpEncoded
anymoreverifyTransaction
doesn't accept parent tx types anymore- TxBuilder accepts and returns
poi
field unpacked as TreesPoi buildTx
accepts transaction type and version in the first argumentbuildTx
return string instead of objectbuildTx
doesn't returntxObject
anymorebuildTx
doesn't returnbinary
anymorebuildTx
doesn't returnrlpEncoded
anymorebuildTx
doesn't acceptexcludeKeys
option anymore- Use
version
instead ofVSN
,vsn
inunpackTx
,buildTx
txType
property ofunpackTx
removedget
method of MPTree accepts and returns typed valueswriteInt
function removedreturnType
of contract call result structure is a value of CallReturnType enumwriteId
,readId
functions removedreadPointers
,buildPointers
functions removedformatSalt
function removedvalidateParams
,unpackRawTx
functions removedAMOUNT
constant removed
Compiler
- Methods of
CompilerHttp
moved toapi
property Compiler
export renamed toCompilerHttp
- removed
compilerUrl
,setCompilerUrl
- Dropped compatibility with aesophia_http below 7.1.1, aesophia_cli below 7.0.1
Account
createGeneralizedAccount
acceptssourceCode
in optionscreateMetaTx
removedAccountRpc
constructor accepts arguments one by oneAccountMemory
requiresnetworkId
insignTransaction
AccountBase
simplifiedaddress
inAccountBase
is a property- MemoryAccount accepts only secretKey
- MemoryAccount is not compatible with GA
Node
url
property ofNode
removed
Oracle
QUERY_FEE
is not exported anymore- Oracles created without queryFee by default
- AeSdk:extendOracleTtl, AeSdk:respondToQuery doesn't accept oracleId
onQuery
callback ofpollForQueries
,oracle.pollQueries
accepts a single query
Chain
send
inlined intosendTransaction
AENS
height
removed from the output ofaensPreclaim
Channel
- Channel:state returns unpacked entries
- All channel events emitted in snakeCase
- Channel:poi returns unpacked TreesPoi
Other
onAccount
doesn't accept keypairbigNumberToByteArray
removedstr2buf
function removedgetAddressFromPriv
doesn't accept private key as base64-encoded or raw stringisValidKeypair
doesn't accept public key as base64-encoded stringbytesToHex
function removedhexToBytes
function removed- rename umd export to
Aeternity
- Subpaths imports of SDK are not allowed
- Removed
getNetworkId
fromAeSdkBase
address
a getter in AeSdkBaseaddAccount
is a sync functionverifyMessage
removed from accounts and AeSdkBaseverify
andverifyMessage
accepts address instead of hex string or Uint8Array- node@12 not supported
removeAccount
throws an error if the account is not foundsignMessage
always returnsUint8Array
encryptKey
,decryptKey
are not exported anymoresha256hash
not exported anymoreheight
method removedsignUsingGA
method removedPOINTER_KEY_BY_PREFIX
removedID_TAG_PREFIX
,PREFIX_ID_TAG
,ID_TAG
removedTX_TYPE
removed.GAS_MAX
removedcalculateMinFee
removedsalt
,createSalt
removedPointer
removed
Features
- account: accept async function in
authData
of AccountGeneralized (c1066c5) - account: override
fee
,gasPrice
of GaMetaTx inauthData
(177a100) - chain:
getBalance
accepts OracleAddress (df2e5e3) - channel: emit
newContract
event (8d71bba) - contract: add ability to compile by path in node.js (74867b7)
- contract: add CompilerCli (de56cbe)
- contract: allow to create GA using
sourceCodePath
,bytecode
(9410af2) - contract: decode emitted events of contract deploy (bf46eb6)
- contract: don't require compiler (d2f9fa8)
- contract: extract $getCallResultByTxHash method (0a8d138)
- contract: support unit type (b5bf7a8)
- node: exponential retry of requests on failure (aadec0d)
- setup downleveled types for [email protected] and above (fd2b97f)
- support CERES protocol version (8960a91)
- tx-builder: deserialisation of
channels.get.offchain_state
(ed31aff) - tx-builder: implement buildAuthTxHashByGaMetaTx (bd656c2)
- tx-builder: implement getExecutionCost and related functions (33085c2)
- tx-builder: implement getTransactionSignerAddress function (2360cd2)
- tx-builder: support incomplete MPTrees (115bcf5)
- tx-builder: support recursive types (4f4dff6)
- tx-builder: typed decoding of MPTrees (da1e35a)
- tx-builder: unpack
poi
field of channel CloseSolo Slash tx (4a49b03) - tx-builder: validate address and enum fields in runtime (5898b3a)
- account: add
generate
method to MemoryAccount (e0fa641) - add Ledger HW support (587e058)
- ensure that used correct account type while signing transaction (46e8db3)
- extract AeSdkMethods class with minimal interface (fd0fe76)
- restore the ability to specify an array of accounts in AeSdk constructor (aba9b9f)
Bug Fixes
- aepp: don't require connection to wallet...
12.1.3 (2022-08-24)
Bug Fixes
- deps: update calldata to 1.3.0 (3eacc29)
12.1.2 (2022-08-09)
12.1.1 (2022-07-28)
Bug Fixes
- export and implementation of calculateMinFee (cee0f7c)
12.1.0 (2022-07-28)
Features
- export Encoding enum (7ebc67f)
Bug Fixes
- ability to use sdk without nodes (8fa29e4)
- aepp,wallet: avoid invalid message errors using third-party tools (4d4d117)
- AeSdkBase: don't mutate the options argument (a574b7f)
- awaitHeight: allow to wait for arbitrary number of blocks (918a885)
- channel: handle round as number (97d7984)
- getNetworkId throw proper error without node (3d9e73c)
- move type packages required by TS projects to dependencies (90c5eb8)
- node: avoid ts-expect-error missed in generated d.ts file (60d9755)
- node: don't transform autorest properties (7982327)
- Node: tread
nameTtl
,clientTtl
as number (b82c398) - pollForQueryResponse: poll until query is expired (436f4a9)
- sendTransaction: don't fall if
onAccount
missed in AeSdkBase (eebbcb7) - switch to aepp-calldata with fixed decoding of lists (c1a3b24)
12.0.0 (2022-06-17)
Introducing types and classes. Dropped stamps
- Migrated SDK to typescript from javascript
- In this release, stamps have been removed and classes are introduced in its place
⚠ BREAKING CHANGES
General
Universal
,RpcAepp
,RpcWallet
stamps replaced withAeSdk
,AeSdkAepp
,AeSdkWallet
classes- all combined exports are inlined (
require('@aeternity/aepp-sdk').generateKeyPair()
) AccountBase
and inheritors are classes nowChainNode
,Contract
,Oracle
,Aens
,Ae
,GeneralizedAccount
stamps not exported in
the root, their methods exported instead
Node and Compiler
Node
,Compiler
(previouslyContractCompilerHttp
) are classes instead of a stampsNode
,Compiler
doesn't check version on the first request instead of initgetNetworkId
returns a promisegetNetworkId
ignoresforce
optionapi
and static properties are removed inNode
Node
returns BigInts for coin amount fields instead of string or numberNode
not acceptsinternalUrl
- removed
mempool
method inNode
compilerVersion
is removed inCompiler
setCompilerUrl
changes compiler URL in sync- methods of
Compiler
requiresoptions
object according to their specification - methods of
Compiler
returns and accepts keys named in camelCase instead of snake_case
Transaction builder
- removed methods to generate a transaction of specific type
- removed ability to generate transaction on the node side
nonce
,ttl
,gas
decoded and accepted as numbers instead of stringsgas
renamed togasLimit
unpackTx
not accepting transaction asBuffer
, only as tx-encoded stringunpackTx
doesn't havebinary
field in result- encode: since the prefix is evaluated by the type
itself the required prefix parameter is no more accepted calculateMinFee
returns BigNumber instead of string- Fee helpers not exported anymore (
BASE_GAS
,GAS_PER_BYTE
,KEY_BLOCK_INTERVAL
,
TX_FEE_BASE_GAS
,TX_FEE_OTHER_GAS
,calculateFee
,DEFAULT_FEE
) buildRawTx
,calculateTtl
not exported anymoreTX_TYPE
mapped to tag (number) instead of stringOBJECT_ID_TX_TYPE
not exported anymoreTX_SERIALIZATION_SCHEMA
combined withTX_DESERIALIZATION_SCHEMA
- Transaction schemas doesn't contain tag anymore
AENS
computeBidFee
acceptsstartFee
,increment
as optionsNAME_BID_TIMEOUTS
not exposed anymorecomputeAuctionEndBlock
accepts and returns height as number- removed
ensureNameValid
name.update
,name.revoke
doesn't accept address inonAccount
, only instances ofAccountBase
Oracle
extendOracleTtl
accepts oracle ttl inoracleTtlType
andoracleTtlValue
fieldsdecode
method ofgetQueryObject
removed
Contract
createAensDelegationSignature
acceptscontractId
,name
, optionscreateOracleDelegationSignature
acceptscontractId
,queryId
as a property of options- call arguments in
createGeneralizedAccount
is required filesystem
option renamed tofileSystem
- Contract instance doesn't accept address in
onAccount
, only instances ofAccountBase
Chain
- removed
balance
,tx
,getTxInfo
methods
Other
getAccountNonce
removedAeSdk
doesn't accept array of accountsdestroyInstance
method removedNodePool
,AccountMultiple
are removed (reimplemented inAeSdk
)DENOMINATION_MAGNITUDE
not exposed anymore- The result of
unpackTx
returned instead ofTxObject
(intxObject
option ofonSign
handler
on wallet side; intx
field of contract call result) validateKeyObj
removedderiveKeyUsingArgon2id
removed- removed extra implementation of
getAddressFromPriv
in keystore genSwaggerClient
removed
Aepp Wallet communication
- BrowserRuntimeConnection, BrowserWindowMessageConnection are classes
- ContentScriptBridge, WalletDetector rewrited to plain functions (
connectionProxy
,walletDetector
) - RpcClient: removed
origin
property - RpcClient:
sendMessage
is a private method - RpcClient:
handlers
parameter is removed - RpcClient: doesn't contain aepp info anymore
- RpcClient: doesn't contain
networkId
anymore - RPC helpers are not exposed anymore (
isInIframe
,sendMessage
,getHandler
,message
,
responseMessage
,sendResponseMessage
,isValidAccounts
)
Aepp
connectToWallet
accepts wallet connection as the first argumentdisconnectWallet
runs in sync andsendDisconnect
arg removedsendConnectRequest
removed- doesn't accept
connection
anymore - removed
isConnected
,isSubscribedAccount
methods signMessage
returns Buffer by default
Wallet
- BrowserRuntimeConnection requires
port
parameter - requires
id
,type
in params getBrowserAPI
helper removedshareWalletInfo
accepts rpcClientId instead of callbackshareNode
argument in accept callback ofonConnection
removed- can't handle specific set of accounts for an app
txObject
parameter ofonSign
callback is removed- callbacks accepts aeppId, params, and origin
rpcClients
in wallet is not exposed anymoreonDisconnect
callback on wallet side accepts client id instead of RpcClient- wallet can't selectively notify aepps about selecting/adding account
- wallet can't provide metadata for accounts
- removed
action.{accept,deny}
in permission callbacks
Features
- aepp: support external accounts in
onAccount
(9745c73) - ga: implement buildAuthTxHash function (73eae4e)
- NodeInvocationError: store tx-encoded transaction (a74da7c)
Bug Fixes
- aepp: use networkId in rpc tx signing (916dba0)
- importing in mjs (0fc7418)
- messageToHash: support messages longer than 252 chars (b4aa456)
- wallet: revert to returning complete tx data instead of just hash in rpc wallet signing (c3ada74)
Refactoring with breaking changes
- generate compiler api in TypeScript using autorest (777e990)
- generate node api in TypeScript (5576cf9)
- compiler: init in sync, check version on making request (a7fe956)
- aci: accept onAccount as AccountBase (e816428)
- ae: drop stamps and use plain functions (8ed55d0)
- aepp rpc: accept wallet info separately (baad98e)
- aepp-rpc: depend on simplified version of RpcClient (f329549)
- aepp-rpc: extract common error checks (eaa8683)
- aepp-wallet: rewrite to ts all except rpc (19cb42f)
- AeppRpc: make to init in sync (86c9d6c)
- chain: drop stamps and use plain functions (4197b3d)
- chain: remove deprecated methods (cefaa55)
- compiler: extract genVersionCheckPolicy (ac14fd1)
- don't provide default fee when transaction is not present (b004694)
- drop
ensureNameValid
(d0d1258) - drop compiler stamp (ddf1363)
- drop functions to generate txs with specific type (3cf767d)
- drop TxObject wrapper (a083c7b)
- encoder: remove required prefix param (dec13d7)
- export in tree shaking friendly way (40aca86)
- extract all fee-related stuff into a separate module (cebb90b)
- extract base sdk classes (487cc14)
- fix spend types ([6b089e7](6b089e7...
v11.0.1
v11.0.0
11.0.0 (2022-03-22)
Request batching: SDK now supports batching transactions
Custom error types: Introduced error types
Naming convention: Instances of the SDK in the examples and tests are now called as aeSdk
.
⚠ BREAKING CHANGES
- return empty array instead of throwing UnsignedTxError
- rpc: remove forceValidation flag
- hd-wallet: expect that bip39 used externally
- hd-wallet: remove default export
- crypto: make (encode/decode)Base(58/64)Check private
- use bs58 instead of bs58check
- update rlp to 3.0.0
- tx builder: throw exception if deposit is not zero
- tx schema: remove default NAME_FEE equal to 0
- tx builder: accept unencoded name in nameClaimTx
- spelling of GeneralizedAccount
- aci: remove call/callStatic from deployInfo
- aci: remove createdAt property generated at client
- contract: remove deprecated contractCallStatic
- contract: remove deprecated contractDeploy
- contract: remove contractCompile
- contract: remove deprecated contractCall
- remove deprecated topBlock
- remove unused functions
- contract events: remote contract support
- contract instance: store aci as it is
- wallet-rpc: inline resolveOnAccount helper
- aepp-wallet schema: convert to TS
- aepp-wallet schema: rearrange METHODS enum
- aepp-wallet schema: remove unused enums
- contractCompile: remove encodeCall
- compiler: remove contractEncodeCallDataAPI
- compiler: remove getCompilerVersion
- contract: remove compileContractAPI
- contract: remove contractGetACI
- contract: remove contractDecodeCallDataByCodeAPI
- contract: remove contractDecodeCallDataBySourceAPI
- contract: remove contractDecodeCallResultAPI
- compiler: remove validateByteCodeAPI
- compiler: remove getFateAssembler
- compiler: remove getBytecodeCompilerVersion
- poll: avoid extra transaction info request to node
- drop https scheme workaround for hosted compiler
- node: don't wrap internal endpoints if internalUrl missed
- tx builder: inline VALIDATION_MESSAGE
- decodeEvents: accept event schemas as it is in ACI
- contract: remove already processed fields from decoded events
- aci: drop redundant per-method event decoding
Features
- aci: use dry-run to estimate gas and get rich errors (bb6977d)
- calculate default polling intervals depending on node settings (d9c6cf9)
- chain: combine multiple dry-run requests at one (ddcdaef)
- contract events: ability to resolve multiple definitions of event (c5b77fa)
- contract events: remote contract support (c7599c7)
- createGeneralizeAccount: estimate gas limit instead of using const (da88852)
- decode encode: validate base58 prefix and payload length (e836260)
- error: introduce error types (#1345) (444bb33)
- package: build es version compatible with node (480c747)
- poll: use getCheckTxInPool if available (690db5b)
- swagger: converts operationId in snake case to pascal (e52b739)
- swagger: split transactions by queues to post batch of txs from one account (0023fc7)
- tx builder: accept unencoded name in nameClaimTx (eea92be)
- tx builder: don't require produceNameId to create AENS txs (57ef9c7)
- tx builder: provide default name fee (18e4bab)
- validator: check contractId (5e667a5)
- wallet: add switch for aepp wallet node sharing (b5640d6)
- wallet: enable aepp to wallet node connection (d87e1fa)
- wallet: provide switch for aepp wallet node connection (dfbab59)
Bug Fixes
-
aens helpers: improve naming, add additional validations (d2a10e1)
-
babel: compatibility with create-react-app (e4b56fe)
-
babel: depend on buffer package in es build (0ba51e9)
-
babel: don't rewrite import of rlp package for @vue/[email protected] (0fdd296)
-
chain: don't require address function to post transaction (07bc105)
-
channel force progress: add missed binary prefixes (78660d2)
-
channel: ignore messages that can't be handled, print to console (aaad8e3)
-
compatibility: update argon2-browser to version with default export (0e69d8b)
-
compatibility: use blakejs that doesn't refer to Buffer (94f1879)
-
contract events: don't throw error if events emitted by remote (fa1c569)
-
delegate signature: don't encode address depending on onAccount (563a972)
-
dry-run: don't combine requests by default (0f36efc)
-
error: remove duplicate error message (8b4df9a)
-
es: babel build on windows (30f5213)
-
keystore: encoding of hex privateKey, simplify tests (9f3ad6b)
-
spelling of GeneralizedAccount (21c1dd3)
-
tx builder: reject more than 32 pointers (9c06dab)
-
tx builder: throw exception if deposit is not zero (7b3d0e3)
-
aci: drop redundant per-method event decoding (a84d781)
-
aci: remove call/callStatic from deployInfo (84d082d)
-
aci: remove createdAt property generated at client (406684c)
-
aepp-wallet schema: convert to TS (1775e91)
-
aepp-wallet schema: rearrange METHODS enum (8a40105)
-
aepp-wallet schema: remove unused enums (95bf0e9)
-
compiler: remove contractEncodeCallDataAPI (7d02317)
-
compiler: remove getBytecodeCompilerVersion (13283be)
-
compiler: remove getCompilerVersion (fb929f8)
-
compiler: remove getFateAssembler (165d492)
-
**compiler:*...
v10.0.0
Changelog
10.0.0 (2021-12-07)
⚠ BREAKING CHANGES
- crypto: remove unused asymmetric encode/decode functions
- aens: don't limit pointer keys
- specify browserlist to better choice of features to transpile
- aci: don't require source code
- make contractDeploy a wrapper, remove unused code
- inline getConsensusProtocolVersion function
- invert and rename forceCodeCheck option to validateByteCode
- require compiler 6 and above
- make contractCall/Static a wrapper around getContractInstance
- contract instance: thread all extra options as contract's
- contract instance: remove unnecessary
setOptions
function - remove contractDecodeData as extra wrapper
- remove contractEncodeCall as extra wrapper
- don't accept ak_ addresses as hash, bytes and signature
- transformation: drop extra wrapper around bindings
- transformation: don't export extra functions
- drop unnecessary skipTransformDecoded option
- drop unnecessary skipArgsConvert option
Features
- aci: don't require source code (5c690d2)
- aens: don't limit pointer keys (f6b8999)
- aens: enable commitmentHash preclaim in tests (5de05e5)
- decode using calldata package (2bb494d)
- encode using calldata package (eeebbd5)
- poll-interval: reduce poll interval to be a more sensible default (9e55b2b)
- support for new node feature next-nonce of release 6.2.0 (#1299) (e40b046)
Bug Fixes
- commitlint issue (2c1cf54)
- compiler errors: construct error message by server response (8621352)
- don't accept ak_ addresses as hash, bytes and signature (cbaac62)
- events: don't require function name for events decoding (f963bdb)
- events: fix event decoding order and address prefix (faad530)
- events: fix test for incorrect address return type (31aaeec)
- events: ignore unknown events in decoding (45795fa)
- node errors: construct error message by server response (d556936)
- semverSatisfies: ignore build number (c3cce0a)
- swagger: detection of empty response (9bfab02)
- contract instance: remove unnecessary
setOptions
function (b88e767) - contract instance: thread all extra options as contract's (10fb7ba)
- crypto: remove unused asymmetric encode/decode functions (51def34)
- drop unnecessary skipArgsConvert option (6d4a599)
- drop unnecessary skipTransformDecoded option (bb49239)
- inline getConsensusProtocolVersion function (75f0447)
- invert and rename forceCodeCheck option to validateByteCode (72122fa)
- make contractCall/Static a wrapper around getContractInstance (c4ec019)
- make contractDeploy a wrapper, remove unused code (48d36f9)
- remove contractDecodeData as extra wrapper (5df2285)
- remove contractEncodeCall as extra wrapper (a4b303f)
- require compiler 6 and above (f9cef12)
- specify browserlist to better choice of features to transpile (c2ec71a)
- transformation: don't export extra functions (fa38b40)
- transformation: drop extra wrapper around bindings (9b70f8e)