v0.21.0 (2021-04-30)
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
- Flexible balance formatting (#363) (ff6aa7d)
- Adding balance locked, reserved and free (#364) (6f8d52f)
- Optional tip for signing tx (#378) (758890b)
- Tx workflow revamp (#372) (f30cb77)
- Move signandsubmit (#375) (69a289e)
- Use typescript type imports (#366) (1c03765)
- Request claims required Properties and approved attesters (#370) (edb044b)
- encrypted message body naming (#371) (9aea418)
- rm yarn/version files (6b4ed58)
- Current release candidate 0.21.0-rc.7 (4bc2078)
- Integration tests on mashnet-staging (#373) (45290ea)