Updated all modules with method docs to support object based network connection & destruction.
For demo below working scripts are updated to demonstrate the same.
demo/src/func-test.ts
demo/src/network-score-test.ts
demo/src/asset-tx.ts
Example Usage:
let network = "api-1";
await Cord.connect(networkAddress, network);
const api = Cord.ConfigService.get(network);
const space = await Cord.ChainSpace.dispatchToChain(
spaceProperties,
issuerDid.uri,
networkAuthorityIdentity,
async ({ data }) => ({
signature: issuerKeys.authentication.sign(data),
keyType: issuerKeys.authentication.type,
}),
network
)
Similarly the disconnect should be made using api-1 itself.
Usage of api-2 for ex. when chain is connected to api-1 object would result in error.
Where network is a optional parameter.
One more minor feature left as TODO is having ability to use dynamic variable names for the api without the use of ApiPromise type definition externally to avoid type missing warnings at some places.
Ex:
Updated all modules with method docs to support object based network connection & destruction.
For demo below working scripts are updated to demonstrate the same.
demo/src/func-test.ts
demo/src/network-score-test.ts
demo/src/asset-tx.ts
Example Usage:
Similarly the disconnect should be made using
api-1
itself. Usage ofapi-2
for ex. when chain is connected toapi-1
object would result in error.Where
network
is a optional parameter.One more minor feature left as
TODO
is having ability to use dynamic variable names for the api without the use ofApiPromise
type definition externally to avoid type missing warnings at some places. Ex:The target branch for this PR is
base:multichain