Migration to 11.0.0

This guide describes all breaking changes introduced with v11.0.0.

Changes to decodeEvents method

rewrite

cInstance.methods.emitEvents.decodeEvents(log);

to

cInstance.decodeEvents(log);
  • Removed raw fields from the decodeEvents response (45bae5farrow-up-right) use processed fields for the same.

  • Renamed decoded events response field decoded to args

old response

// events emitted by contract calls are automatically decoded
const tx = await contractInstance.methods.emitEvents(1337, 'this message is not indexed');
console.log(tx.decodedEvents);

/*
[
  {
    address: 'ct_6y3N9KqQb74QsvR9NrESyhWeLNiA9aJgJ7ua8CvsTuGot6uzh',
    data: 'cb_dGhpcyBtZXNzYWdlIGlzIG5vdCBpbmRleGVkdWmUpw==',
    topics: [
      '101640830366340000167918459210098337687948756568954742276612796897811614700269',
      '39519965516565108473327470053407124751867067078530473195651550649472681599133'
    ],
    name: 'AnotherEvent',
    decoded: [
      'fUq2NesPXcYZ1CcqBcGC3StpdnQw3iVxMA3YSeCNAwfN4myQk',
      'this message is not indexed'
    ]
  },
  {
    address: 'ct_6y3N9KqQb74QsvR9NrESyhWeLNiA9aJgJ7ua8CvsTuGot6uzh',
    data: 'cb_Xfbg4g==',
    topics: [
      '59505622142252318624300825714684802559980671551955787864303522023309554554980',
      1337
    ],
    name: 'FirstEvent',
    decoded: [ '1337' ]
  }
]
*/

new response

Removed allowUnsynced option of poll method (6baa15darrow-up-right)

Transaction poll method now checks if Tx is in the node pool (690db5barrow-up-right)

The default polling interval of 5000 is replaced by a method which calculates the default interval using expected mine rate and micro block cycle (d9c6cf9arrow-up-right)

Following contract instance methods are dropped(#1368arrow-up-right)

  • topBlock

    • use aeSdk.api.getTopHeader() instead

  • contractCall

    • replace await aeSdk.contractCall(identityContract, contractId, 'getArg', [42])

    • with (await aeSdk.getContractInstance({ source, contractAddress: contractId })).methods.getArg(42)

  • contractCompile

    • replace await aeSdk.contractCompile(CONTRACT_SOURCE)

    • with (await aeSdk.getContractInstance({ source: CONTRACT_SOURCE })).compile()

  • contractDeploy

    • replace await aeSdk.contractDeploy(bytecode, identityContract)

    • with (await aeSdk.getContractInstance({ bytecode, source: identityContract })).deploy()

  • contractCallStatic

    • replace await aeSdk.contractCallStatic(identityContract, null, 'init', [], { bytecode })

    • with await contract.deploy([], { callStatic: true })

  • Removed property createdAt from contract.deploy method response

  • call/callStatic

    • removed call and callStatic methods from deploy response

rewrite

to

The default gas of 25000 limit has been dropped. Instead, SDK attempts to estimate the gas using dry-run feature (#1367arrow-up-right)

See documentation on transaction-options.md for detailed explanation.

Removed Wrappers around CompilerApi (#1363arrow-up-right)

  • Removed getBytecodeCompilerVersion method.

  • Removed encodeCall method from contractCompile response.

  • Removed getCompilerVersion method, use aeSdk. sdk.compilerVersion instead.

  • Removed contractDecodeCallDataByCodeAPI method.

  • Removed contractDecodeCallResultAPI method.

  • Removed getFateAssembler method.

  • Removed compileContractAPI method.

rewrite

to

  • Removed contractEncodeCallDataAPI:

rewrite

to

  • Removed contractGetACI:

rewrite

to

  • Removed validateByteCodeAPI:

rewrite

to

Native build of claim tx now accepts unencoded name instead of encoded name (eea92bearrow-up-right)

rewrite

to

Removed forceValidation flag from aepp-rpc and wallet-rpc stamps. (9f958c3arrow-up-right)

Renamed hd-wallet methods (f6243adarrow-up-right)

  • Renamed generateSaveHDWallet to generateSaveHDWalletFromSeed

  • Renamed getHdWalletAccountFromMnemonic to getHdWalletAccountFromSeed

Last updated

Was this helpful?