@@ -1,3 +1,11 @@
|
||||
# 0.93.0-beta.x
|
||||
|
||||
- For TypeScript users `api.query.*.*` is now properly typed for default Substrate calls, i.e. `api.query.balances.freeBalance(...)` will return a `Balance` type. Additionally the `api.queryMulti` and `.multi` on queries not allow generic type params.
|
||||
- Add `api.rpc.accounts.nextIndex`, `api.rpc.contracts.call` and `api.rpc.rpc.methods` calls. Optional calls (such as account/contracts) is decorated based on the results from `rpc.methods`, so they don't show up on nodes where they are not active.
|
||||
- Updated types to support the latest Polkadot/Substrate master changes
|
||||
- Support recursive type registration (self-referencing via `Box`) in addition to better sanitation of user-defined-types
|
||||
- Documentation and example updates (thanks mostly to contributions)
|
||||
|
||||
# 0.92.1
|
||||
|
||||
- The API now correctly sets the ss58 prefix as retrieved from the chain properties via `ss58Format`
|
||||
|
||||
+5
-5
@@ -30,11 +30,11 @@
|
||||
"test:watch": "jest --coverage --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.6.0",
|
||||
"@babel/register": "^7.6.0",
|
||||
"@babel/runtime": "^7.6.0",
|
||||
"@polkadot/dev": "^0.31.0-beta.8",
|
||||
"@polkadot/ts": "^0.1.72",
|
||||
"@babel/core": "^7.6.2",
|
||||
"@babel/register": "^7.6.2",
|
||||
"@babel/runtime": "^7.6.2",
|
||||
"@polkadot/dev": "^0.31.1",
|
||||
"@polkadot/ts": "^0.1.73",
|
||||
"gh-pages": "^2.1.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-contract#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.6.0",
|
||||
"@babel/runtime": "^7.6.2",
|
||||
"@polkadot/types": "^0.93.0-beta.18"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-derive#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.6.0",
|
||||
"@babel/runtime": "^7.6.2",
|
||||
"@polkadot/api": "^0.93.0-beta.18",
|
||||
"@polkadot/types": "^0.93.0-beta.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^1.4.1"
|
||||
"@polkadot/keyring": "^1.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-metadata#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.6.0",
|
||||
"@babel/runtime": "^7.6.2",
|
||||
"@polkadot/types": "^0.93.0-beta.18",
|
||||
"@polkadot/util": "^1.4.1",
|
||||
"@polkadot/util-crypto": "^1.4.1"
|
||||
"@polkadot/util": "^1.5.1",
|
||||
"@polkadot/util-crypto": "^1.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^1.4.1"
|
||||
"@polkadot/keyring": "^1.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,16 +26,16 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/api#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.6.0",
|
||||
"@babel/runtime": "^7.6.2",
|
||||
"@polkadot/api-derive": "^0.93.0-beta.18",
|
||||
"@polkadot/api-metadata": "^0.93.0-beta.18",
|
||||
"@polkadot/keyring": "^1.4.1",
|
||||
"@polkadot/keyring": "^1.5.1",
|
||||
"@polkadot/rpc-core": "^0.93.0-beta.18",
|
||||
"@polkadot/rpc-provider": "^0.93.0-beta.18",
|
||||
"@polkadot/types": "^0.93.0-beta.18",
|
||||
"@polkadot/util-crypto": "^1.4.1"
|
||||
"@polkadot/util-crypto": "^1.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^1.4.1"
|
||||
"@polkadot/keyring": "^1.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { Prefix } from '@polkadot/util-crypto/address/types';
|
||||
import { SignedBlock } from '@polkadot/types/interfaces';
|
||||
import { RegistryTypes } from '@polkadot/types/types';
|
||||
import { ApiInterfaceRx, ApiOptions, ApiTypes, DecorateMethod } from '../types';
|
||||
@@ -132,7 +131,7 @@ export default abstract class Init<ApiType> extends Decorate<ApiType> {
|
||||
this._runtimeVersion = runtimeVersion;
|
||||
|
||||
// set the global ss58Format as detected by the chain
|
||||
setSS58Format(chainProps.ss58Format.unwrapOr(DEFAULT_SS58).toNumber() as Prefix);
|
||||
setSS58Format(chainProps.ss58Format.unwrapOr(DEFAULT_SS58).toNumber());
|
||||
|
||||
// get unique types & validate
|
||||
metadata.getUniqTypes(false);
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-core#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.6.0",
|
||||
"@babel/runtime": "^7.6.2",
|
||||
"@polkadot/jsonrpc": "^0.93.0-beta.18",
|
||||
"@polkadot/rpc-provider": "^0.93.0-beta.18",
|
||||
"@polkadot/types": "^0.93.0-beta.18",
|
||||
"@polkadot/util": "^1.4.1",
|
||||
"@polkadot/util": "^1.5.1",
|
||||
"rxjs": "^6.5.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,18 +26,18 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/rpc-provider#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.6.0",
|
||||
"@babel/runtime": "^7.6.2",
|
||||
"@polkadot/api-metadata": "^0.93.0-beta.18",
|
||||
"@polkadot/util": "^1.4.1",
|
||||
"@polkadot/util-crypto": "^1.4.1",
|
||||
"@types/nock": "^10.0.3",
|
||||
"@polkadot/util": "^1.5.1",
|
||||
"@polkadot/util-crypto": "^1.5.1",
|
||||
"@types/nock": "^11.1.0",
|
||||
"eventemitter3": "^4.0.0",
|
||||
"isomorphic-fetch": "^2.2.1",
|
||||
"websocket": "^1.0.29"
|
||||
"websocket": "^1.0.30"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^1.4.1",
|
||||
"@polkadot/keyring": "^1.5.1",
|
||||
"mock-socket": "^9.0.0",
|
||||
"nock": "^11.3.3"
|
||||
"nock": "^11.3.5"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,6 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-jsonrpc#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.6.0"
|
||||
"@babel/runtime": "^7.6.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
},
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.6.0",
|
||||
"@polkadot/util": "^1.4.1",
|
||||
"@polkadot/util-crypto": "^1.4.1",
|
||||
"@babel/runtime": "^7.6.2",
|
||||
"@polkadot/util": "^1.5.1",
|
||||
"@polkadot/util-crypto": "^1.5.1",
|
||||
"@types/memoizee": "^0.4.3",
|
||||
"memoizee": "^0.4.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@polkadot/keyring": "^1.4.1"
|
||||
"@polkadot/keyring": "^1.5.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,12 +25,13 @@ const { argv: { ws } } = yargs
|
||||
async function main (): Promise<void> {
|
||||
const provider = new WsProvider(ws);
|
||||
const api = await ApiPromise.create({ provider });
|
||||
|
||||
const chain = await api.rpc.system.chain();
|
||||
const props = await api.rpc.system.properties();
|
||||
const [chain, props] = await Promise.all([
|
||||
api.rpc.system.chain(),
|
||||
api.rpc.system.properties()
|
||||
]);
|
||||
|
||||
// output the chain info, for easy re-use
|
||||
console.error(`export default { chain: '${chain.toString()}', genesisHash: '${api.genesisHash.toHex()}', specVersion: ${api.runtimeVersion.specVersion.toNumber()}, ss58Format: ${props.ss58Format.unwrapOr(42)}, tokenDecimals: ${props.tokenDecimals.unwrapOr(0)}, tokenSymbol: '${props.tokenSymbol.unwrapOr('UNIT')}', metaCalls: '${Buffer.from(api.runtimeMetadata.asCallsOnly.toU8a()).toString('base64')}' };`);
|
||||
console.error(`// Generated via 'yarn run chain:info ${ws}'\n\nexport default {\n chain: '${chain.toString()}',\n genesisHash: '${api.genesisHash.toHex()}',\n specVersion: ${api.runtimeVersion.specVersion.toNumber()},\n ss58Format: ${props.ss58Format.unwrapOr(42)},\n tokenDecimals: ${props.tokenDecimals.unwrapOr(0)},\n tokenSymbol: '${props.tokenSymbol.unwrapOr('UNIT')}',\n metaCalls: '${Buffer.from(api.runtimeMetadata.asCallsOnly.toU8a()).toString('base64')}'\n};`);
|
||||
|
||||
// show any missing types
|
||||
api.runtimeMetadata.getUniqTypes(false);
|
||||
|
||||
Reference in New Issue
Block a user