Skip to content

v0.21.0 (2021-04-30)

Compare
Choose a tag to compare
@Dudleyneedham Dudleyneedham released this 30 Apr 12:37
· 618 commits to master since this release

SDK Release notes 0.21.0

Flexible balance formatting (ff6aa7d)

The changes to the balances module give more flexibility by giving an option parameter with the type BalanceOptions to specify number of decimal places and unit and other optional fields.

interface BalanceOptions {
  decimals?: number
  forceUnit?: string
  withSi?: boolean
  withSiFull?: boolean
  withUnit?: boolean | string
}

Displaying locked, reserved and free balances (6f8d52f)

Querying the account balance returns locked reserved and free balances as an overview.

Originally, we only returned the free balance as a number with the changes it returns as an object. To get the free balance:

const balance = await getBalances(address)
balance.free

Tips (758890b)

Adds the ability to provide AnyNumber as tip for the validator when signing the tx, which increases the transactions priority when importing in the pool.

Additional properties for request for claims message (edb044b)

Request for claims message type now has two new optional properties, requiredProperties and approvedAttesters.

interface IRequestClaimsForCTypesContent {
  cTypeHash: ICType['hash']
  acceptedAttester?: Array<IPublicIdentity['address']>
  requiredProperties?: string[]
}

This allows Verifiers to communicate efficiently which credentials they accept, and helps Claimers select AttestedClaims and build presentations in line with these specifications.

Transaction workflow revamp (f30cb77)

Functions creating a SubmittableExtrinsic (e.g. attestation.store()) do not sign the transaction anymore.
These now have to be signed manually before submitting to the chain.
You can use our all purpose BlockchainUtils.signAndSubmitTx function, with which unsigned SubmittableExtrinsic can be signed and dispatched with additional optional resolve/reject criteria and the possibility to apply nonce collision recovery logic with the reSign flag.
Alternatively, you can also use polkadot/api native functions, like tx.signAndSend().

Bug Fixes

Documentation changes

  • Dev vs Master mixups (#358) (9ed2db6)
  • fix listenToBalanceChanges example (#359) (5a3bb9d)
  • Updated our getting started guide, examples, and documentation (daa99e8)
  • Outdated docs, unrequired identity (#376) (063467a)

Features