Skip to content

Commit

Permalink
Prerelease/2.0.0 alpha.0 (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
jordy25519 authored May 7, 2021
1 parent b9a3055 commit e60be10
Show file tree
Hide file tree
Showing 48 changed files with 37 additions and 707 deletions.
2 changes: 1 addition & 1 deletion docs/examples/promise/01_simple_connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/promise/02_listen_to_blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/promise/05_unsubscribe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/promise/06_make_transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2",
"@cennznet/api": "^2.0.0-alpha.0",
"@polkadot/keyring": "^4.1.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/promise/07_read_storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/promise/08_read_storage_at/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2",
"@cennznet/api": "^2.0.0-alpha.0",
"@polkadot/keyring": "^4.1.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/promise/10_system_events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
6 changes: 2 additions & 4 deletions docs/examples/promise/11_transfer_events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ const { Api } = require('@cennznet/api');

// import the test keyring (already has dev keys for Alice, Bob, Charlie, Eve & Ferdie)
const { Keyring } = require('@polkadot/keyring');
// utility function for random values
const { randomAsU8a } = require('@cennznet/util');

const AMOUNT = 10000;

Expand All @@ -29,8 +27,8 @@ async function main () {
// get the nonce for the admin key
const nonce = await api.rpc.system.accountNextIndex(alicePair.address);

// create a new random recipient
const recipient = keyring.addFromSeed(randomAsU8a(32)).address;
// create a new recipient
const recipient = keyring.createFromUri('//TransferEventsTest').address;

console.log('Sending', AMOUNT, 'from', alicePair.address, 'to', recipient, 'with nonce', nonce.toString());

Expand Down
3 changes: 1 addition & 2 deletions docs/examples/promise/11_transfer_events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2",
"@cennznet/util": "^1.3.2",
"@cennznet/api": "^2.0.0-alpha.0",
"@polkadot/keyring": "^4.1.1"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const {Api} = require('@cennznet/api');
// import the test keyring (already has dev keys for Alice, Bob, Charlie, Eve & Ferdie)
const { Keyring } = require('@polkadot/keyring');

// utility function for random values
const {randomAsU8a} = require('@cennznet/util');

const AMOUNT = 10000;
const FEE_ASSET_ID = 16000;
const MIN_REQUIRED_POOL_BALANCE = 1000000;
Expand Down Expand Up @@ -44,8 +41,8 @@ async function main() {
// get the nonce for the admin key
const nonce = await api.rpc.system.accountNextIndex(alicePair.address);

// create a new random recipient
const recipient = keyring.addFromSeed(randomAsU8a(32)).address;
// create a new recipient
const recipient = keyring.addFromUri('//ChooseFeeAssetToPayTest').address;

const [poolAssetBalance, poolCoreAssetBalance] = await queryPoolBalance(api);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2",
"@cennznet/util": "^1.3.2",
"@polkadot/keyring": "^4.1.1"
"@cennznet/api": "^2.0.0-alpha.0",
"@polkadot/keyring": "^6.3.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/promise/13_batch_all_transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "1.3.5-alpha.1",
"@polkadot/keyring": "^4.1.1"
"@cennznet/api": "^2.0.0-alpha.0",
"@polkadot/keyring": "^6.3.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rx/01_simple_connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"rxjs": "^6.6.0",
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rx/02_listen_to_blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"rxjs": "^6.6.0",
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rx/03_listen_to_balance_change/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"rxjs": "^6.6.0",
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rx/04_unsubscribe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"rxjs": "^6.6.0",
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rx/05_read_storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"rxjs": "^6.6.0",
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rx/06_make_transfer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2",
"@cennznet/api": "^2.0.0-alpha.0",
"@polkadot/keyring": "^4.1.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/rx/07_system_events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"rxjs": "^6.6.0",
"@cennznet/api": "^1.3.2"
"@cennznet/api": "^2.0.0-alpha.0"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
5 changes: 1 addition & 4 deletions docs/examples/rx/08_transfer_events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ const { ApiRx } = require('@cennznet/api');
// import the test keyring (already has dev keys for Alice, Bob, Charlie, Eve & Ferdie)
const { Keyring } = require('@polkadot/keyring');

// utility function for random values
const { randomAsU8a } = require('@cennznet/util');

// some constants we are using in this sample
const AMOUNT = 10000;

Expand All @@ -26,7 +23,7 @@ async function main () {
const alicePair = keyring.addFromUri('//Alice');

// create a new random recipient
const recipient = keyring.addFromSeed(randomAsU8a(32)).address;
const recipient = keyring.addFromSeed('//TransferEventsTest').address;

console.log('Sending', AMOUNT, 'from', alicePair.address, 'to', recipient);

Expand Down
5 changes: 2 additions & 3 deletions docs/examples/rx/08_transfer_events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
"start": "node index.js"
},
"dependencies": {
"@cennznet/api": "^1.3.2",
"@cennznet/util": "^1.3.2",
"@polkadot/keyring": "^4.1.1"
"@cennznet/api": "^2.0.0-alpha.0",
"@polkadot/keyring": "^6.3.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
5 changes: 1 addition & 4 deletions docs/examples/rx/09_chose_fee_asset_to_pay_tx_fee/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const {ApiRx} = require('@cennznet/api');
// import the test keyring (already has dev keys for Alice, Bob, Charlie, Eve & Ferdie)
const { Keyring } = require('@polkadot/keyring');

// utility function for random values
const {randomAsU8a} = require('@cennznet/util');

const {combineLatest, of} = require('rxjs');
const {first, switchMap, tap} = require('rxjs/operators');

Expand Down Expand Up @@ -49,7 +46,7 @@ async function main() {
const nonce = await api.rpc.system.accountNextIndex(alicePair.address).pipe(first()).toPromise();;

// create a new random recipient
const recipient = keyring.addFromSeed(randomAsU8a(32)).address;
const recipient = keyring.addFromUri('//ChoseAssetToPayFee').address;

queryPoolBalance(api).pipe(
switchMap(([poolAssetBalance, poolCoreAssetBalance])=>{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
},
"dependencies": {
"rxjs": "^6.6.0",
"@cennznet/api": "^1.3.2",
"@cennznet/util": "^1.3.2",
"@polkadot/keyring": "^4.1.1"
"@cennznet/api": "^2.0.0-alpha.0",
"@polkadot/keyring": "^6.3.1"
},
"devDependencies": {
"rimraf": "^3.0.2"
Expand Down
2 changes: 0 additions & 2 deletions jest/integration.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ module.exports = {
moduleNameMapper: {
'@cennznet/api(.*)$': '<rootDir>/packages/api/src/$1',
'@cennznet/types(.*)$': '<rootDir>/packages/types/src/$1',
'@cennznet/util(.*)$': '<rootDir>/packages/util/src/$1',
},
modulePathIgnorePatterns: [
'<rootDir>/packages/api/build',
'<rootDir>/packages/types/build',
'<rootDir>/packages/util/build',
],
transformIgnorePatterns: ['/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)'],
testTimeout: 30000,
Expand Down
2 changes: 0 additions & 2 deletions jest/unit.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ module.exports = {
moduleNameMapper: {
'@cennznet/api(.*)$': '<rootDir>/packages/api/src/$1',
'@cennznet/types(.*)$': '<rootDir>/packages/types/src/$1',
'@cennznet/util(.*)$': '<rootDir>/packages/util/src/$1',
},
modulePathIgnorePatterns: [
'<rootDir>/packages/api/build',
'<rootDir>/packages/types/build',
'<rootDir>/packages/util/build',
],
transformIgnorePatterns: ['/node_modules/(?!@polkadot|@babel/runtime/helpers/esm/)']
};
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "1.3.5-alpha.1"
"version": "^2.0.0-alpha.0"
}
4 changes: 2 additions & 2 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cennznet/api",
"version":"1.3.5-alpha.1",
"version":"2.0.0-alpha.0",
"description": "CENNZnet's javascript api",
"keywords": [
"CENNZnet"
Expand All @@ -19,7 +19,7 @@
"doc": "npx compodoc --tsconfig ../../tsconfig.json --hideGenerator --theme readthedocs --includes compodoc --output ../../docs/api"
},
"dependencies": {
"@cennznet/types": "^1.3.5-alpha.1",
"@cennznet/types": "^2.0.0-alpha.0",
"@polkadot/api": "4.5.1",
"@polkadot/metadata": "4.5.1",
"@polkadot/rpc-core": "4.5.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cennznet/types",
"version": "1.3.5-alpha.1",
"version": "2.0.0-alpha.0",
"description": "Additional type definitions for the CENNZnet runtime",
"author": "Centrality Developers <[email protected]>",
"keywords": [
Expand Down
Loading

0 comments on commit e60be10

Please sign in to comment.