From 48e57f9a55c2c576fa35c5e2668dad725bbaebfc Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 2 Oct 2018 11:30:45 +0200 Subject: [PATCH] Rename api-codec -> types (#183) * Rename api-codec -> types * Cleanups with exports (as found with use) * Docs to build for /types --- jest.config.js | 5 +++-- packages/api-codec/.nodoc | 0 packages/api-codec/README.md | 3 --- packages/api-observable/src/Base.ts | 2 +- packages/api-observable/src/Calls.ts | 2 +- packages/api-observable/src/Combined.ts | 2 +- packages/api-observable/src/Queries.ts | 4 ++-- packages/api-observable/src/classes.ts | 4 ++-- packages/api-observable/src/types.d.ts | 4 ++-- packages/api-provider/src/mock/mocks.ts | 4 ++-- packages/api/src/index.ts | 4 ++-- packages/type-extrinsics/src/fromMetadata.spec.js | 4 ++-- packages/type-extrinsics/src/fromMetadata.ts | 2 +- packages/type-extrinsics/src/utils/createExtrinsic.ts | 6 +++--- packages/type-jsonrpc/src/create/param.ts | 2 +- packages/type-jsonrpc/src/types.d.ts | 2 +- packages/type-storage/package.json | 2 +- packages/type-storage/src/fromMetadata.spec.js | 4 ++-- packages/type-storage/src/fromMetadata.ts | 2 +- packages/type-storage/src/substrate.ts | 6 +++--- packages/type-storage/src/testing.ts | 4 ++-- packages/type-storage/src/types.d.ts | 2 +- packages/type-storage/src/utils/createFunction.ts | 8 ++++---- packages/{api-codec => types}/LICENSE | 2 +- packages/types/README.md | 3 +++ packages/{api-codec => types}/package.json | 4 ++-- packages/{api-codec => types}/src/AccountId.spec.js | 2 +- packages/{api-codec => types}/src/AccountId.ts | 2 +- packages/{api-codec => types}/src/AccountIndex.ts | 2 +- packages/{api-codec => types}/src/Address.spec.js | 2 +- packages/{api-codec => types}/src/Address.ts | 2 +- packages/{api-codec => types}/src/AuthorityId.ts | 2 +- packages/{api-codec => types}/src/Balance.ts | 2 +- packages/{api-codec => types}/src/Bft.spec.js | 2 +- packages/{api-codec => types}/src/Bft.ts | 2 +- packages/{api-codec => types}/src/Block.spec.js | 2 +- packages/{api-codec => types}/src/Block.ts | 2 +- packages/{api-codec => types}/src/BlockNumber.ts | 2 +- packages/{api-codec => types}/src/Bool.ts | 2 +- packages/{api-codec => types}/src/Bytes.ts | 2 +- packages/{api-codec => types}/src/Extrinsic.ts | 2 +- packages/{api-codec => types}/src/Extrinsics.ts | 2 +- packages/{api-codec => types}/src/Gas.ts | 2 +- packages/{api-codec => types}/src/H256.ts | 2 +- packages/{api-codec => types}/src/H512.ts | 2 +- packages/{api-codec => types}/src/Hash.ts | 2 +- packages/{api-codec => types}/src/Header.only.json | 0 packages/{api-codec => types}/src/Header.spec.js | 2 +- packages/{api-codec => types}/src/Header.ts | 2 +- packages/{api-codec => types}/src/KeyValue.spec.js | 2 +- packages/{api-codec => types}/src/KeyValue.ts | 2 +- packages/{api-codec => types}/src/Metadata.decoded.json | 0 packages/{api-codec => types}/src/Metadata.rpc.ts | 2 +- packages/{api-codec => types}/src/Metadata.spec.js | 2 +- packages/{api-codec => types}/src/Metadata.ts | 2 +- .../{api-codec => types}/src/MisbehaviorReport.spec.js | 2 +- packages/{api-codec => types}/src/MisbehaviorReport.ts | 2 +- packages/{api-codec => types}/src/Moment.spec.js | 2 +- packages/{api-codec => types}/src/Moment.ts | 2 +- .../{api-codec => types}/src/NewAccountOutcome.spec.js | 2 +- packages/{api-codec => types}/src/NewAccountOutcome.ts | 2 +- packages/{api-codec => types}/src/Nonce.ts | 2 +- packages/{api-codec => types}/src/Origin.spec.js | 2 +- packages/{api-codec => types}/src/Origin.ts | 2 +- packages/{api-codec => types}/src/ParachainId.ts | 2 +- packages/{api-codec => types}/src/PendingExtrinsics.ts | 2 +- packages/{api-codec => types}/src/Perbill.ts | 2 +- packages/{api-codec => types}/src/Permill.ts | 2 +- packages/{api-codec => types}/src/PropIndex.ts | 2 +- packages/{api-codec => types}/src/Proposal.ts | 2 +- packages/{api-codec => types}/src/ProposalIndex.ts | 2 +- packages/{api-codec => types}/src/RawAddress.ts | 2 +- packages/{api-codec => types}/src/ReferendumIndex.ts | 2 +- packages/{api-codec => types}/src/RuntimeVersion.rpc.json | 0 packages/{api-codec => types}/src/RuntimeVersion.spec.js | 2 +- packages/{api-codec => types}/src/RuntimeVersion.ts | 4 ++-- packages/{api-codec => types}/src/Signature.ts | 2 +- packages/{api-codec => types}/src/SignedBlock.rpc.json | 0 packages/{api-codec => types}/src/SignedBlock.spec.js | 2 +- packages/{api-codec => types}/src/SignedBlock.ts | 2 +- .../{api-codec => types}/src/StorageChangeSet.spec.js | 2 +- packages/{api-codec => types}/src/StorageChangeSet.ts | 2 +- packages/{api-codec => types}/src/StorageData.ts | 2 +- packages/{api-codec => types}/src/StorageKey.ts | 2 +- packages/{api-codec => types}/src/Text.ts | 2 +- packages/{api-codec => types}/src/Type.spec.js | 2 +- packages/{api-codec => types}/src/Type.ts | 2 +- packages/{api-codec => types}/src/U128.ts | 2 +- packages/{api-codec => types}/src/U16.ts | 2 +- packages/{api-codec => types}/src/U256.ts | 2 +- packages/{api-codec => types}/src/U32.ts | 2 +- packages/{api-codec => types}/src/U64.ts | 2 +- packages/{api-codec => types}/src/U8.ts | 2 +- packages/{api-codec => types}/src/ValidatorPrefs.spec.js | 2 +- packages/{api-codec => types}/src/ValidatorPrefs.ts | 2 +- packages/{api-codec => types}/src/VoteIndex.ts | 2 +- packages/{api-codec => types}/src/VoteThreshold.spec.js | 2 +- packages/{api-codec => types}/src/VoteThreshold.ts | 2 +- packages/{api-codec => types}/src/codec/Base.spec.js | 2 +- packages/{api-codec => types}/src/codec/Base.ts | 2 +- packages/{api-codec => types}/src/codec/Compact.ts | 2 +- packages/{api-codec => types}/src/codec/Enum.spec.js | 2 +- packages/{api-codec => types}/src/codec/Enum.ts | 2 +- packages/{api-codec => types}/src/codec/EnumType.spec.js | 2 +- packages/{api-codec => types}/src/codec/EnumType.ts | 2 +- packages/{api-codec => types}/src/codec/Length.spec.js | 2 +- packages/{api-codec => types}/src/codec/Length.ts | 2 +- packages/{api-codec => types}/src/codec/Option.spec.js | 2 +- packages/{api-codec => types}/src/codec/Option.ts | 2 +- packages/{api-codec => types}/src/codec/Struct.spec.js | 2 +- packages/{api-codec => types}/src/codec/Struct.ts | 2 +- packages/{api-codec => types}/src/codec/Tuple.spec.js | 2 +- packages/{api-codec => types}/src/codec/Tuple.ts | 2 +- packages/{api-codec => types}/src/codec/U8a.spec.js | 2 +- packages/{api-codec => types}/src/codec/U8a.ts | 2 +- packages/{api-codec => types}/src/codec/U8aFixed.spec.js | 2 +- packages/{api-codec => types}/src/codec/U8aFixed.ts | 2 +- packages/{api-codec => types}/src/codec/UInt.spec.js | 2 +- packages/{api-codec => types}/src/codec/UInt.ts | 2 +- packages/{api-codec => types}/src/codec/Vector.spec.js | 2 +- packages/{api-codec => types}/src/codec/Vector.ts | 2 +- .../{api-codec => types}/src/codec/createType.spec.js | 2 +- packages/{api-codec => types}/src/codec/createType.ts | 2 +- packages/{api-codec => types}/src/codec/index.ts | 8 +++++++- packages/{api-codec => types}/src/index.ts | 2 +- packages/{api-codec => types}/src/types.d.ts | 5 ++--- tsconfig.json | 2 +- 127 files changed, 149 insertions(+), 143 deletions(-) delete mode 100644 packages/api-codec/.nodoc delete mode 100644 packages/api-codec/README.md rename packages/{api-codec => types}/LICENSE (91%) create mode 100644 packages/types/README.md rename packages/{api-codec => types}/package.json (93%) rename packages/{api-codec => types}/src/AccountId.spec.js (95%) rename packages/{api-codec => types}/src/AccountId.ts (96%) rename packages/{api-codec => types}/src/AccountIndex.ts (95%) rename packages/{api-codec => types}/src/Address.spec.js (97%) rename packages/{api-codec => types}/src/Address.ts (98%) rename packages/{api-codec => types}/src/AuthorityId.ts (85%) rename packages/{api-codec => types}/src/Balance.ts (78%) rename packages/{api-codec => types}/src/Bft.spec.js (95%) rename packages/{api-codec => types}/src/Bft.ts (97%) rename packages/{api-codec => types}/src/Block.spec.js (97%) rename packages/{api-codec => types}/src/Block.ts (93%) rename packages/{api-codec => types}/src/BlockNumber.ts (75%) rename packages/{api-codec => types}/src/Bool.ts (92%) rename packages/{api-codec => types}/src/Bytes.ts (95%) rename packages/{api-codec => types}/src/Extrinsic.ts (90%) rename packages/{api-codec => types}/src/Extrinsics.ts (81%) rename packages/{api-codec => types}/src/Gas.ts (76%) rename packages/{api-codec => types}/src/H256.ts (87%) rename packages/{api-codec => types}/src/H512.ts (85%) rename packages/{api-codec => types}/src/Hash.ts (84%) rename packages/{api-codec => types}/src/Header.only.json (100%) rename packages/{api-codec => types}/src/Header.spec.js (95%) rename packages/{api-codec => types}/src/Header.ts (96%) rename packages/{api-codec => types}/src/KeyValue.spec.js (95%) rename packages/{api-codec => types}/src/KeyValue.ts (96%) rename packages/{api-codec => types}/src/Metadata.decoded.json (100%) rename packages/{api-codec => types}/src/Metadata.rpc.ts (99%) rename packages/{api-codec => types}/src/Metadata.spec.js (87%) rename packages/{api-codec => types}/src/Metadata.ts (99%) rename packages/{api-codec => types}/src/MisbehaviorReport.spec.js (95%) rename packages/{api-codec => types}/src/MisbehaviorReport.ts (97%) rename packages/{api-codec => types}/src/Moment.spec.js (93%) rename packages/{api-codec => types}/src/Moment.ts (96%) rename packages/{api-codec => types}/src/NewAccountOutcome.spec.js (84%) rename packages/{api-codec => types}/src/NewAccountOutcome.ts (85%) rename packages/{api-codec => types}/src/Nonce.ts (83%) rename packages/{api-codec => types}/src/Origin.spec.js (82%) rename packages/{api-codec => types}/src/Origin.ts (86%) rename packages/{api-codec => types}/src/ParachainId.ts (78%) rename packages/{api-codec => types}/src/PendingExtrinsics.ts (79%) rename packages/{api-codec => types}/src/Perbill.ts (84%) rename packages/{api-codec => types}/src/Permill.ts (84%) rename packages/{api-codec => types}/src/PropIndex.ts (80%) rename packages/{api-codec => types}/src/Proposal.ts (84%) rename packages/{api-codec => types}/src/ProposalIndex.ts (80%) rename packages/{api-codec => types}/src/RawAddress.ts (82%) rename packages/{api-codec => types}/src/ReferendumIndex.ts (82%) rename packages/{api-codec => types}/src/RuntimeVersion.rpc.json (100%) rename packages/{api-codec => types}/src/RuntimeVersion.spec.js (93%) rename packages/{api-codec => types}/src/RuntimeVersion.ts (93%) rename packages/{api-codec => types}/src/Signature.ts (83%) rename packages/{api-codec => types}/src/SignedBlock.rpc.json (100%) rename packages/{api-codec => types}/src/SignedBlock.spec.js (91%) rename packages/{api-codec => types}/src/SignedBlock.ts (91%) rename packages/{api-codec => types}/src/StorageChangeSet.spec.js (89%) rename packages/{api-codec => types}/src/StorageChangeSet.ts (93%) rename packages/{api-codec => types}/src/StorageData.ts (75%) rename packages/{api-codec => types}/src/StorageKey.ts (96%) rename packages/{api-codec => types}/src/Text.ts (97%) rename packages/{api-codec => types}/src/Type.spec.js (93%) rename packages/{api-codec => types}/src/Type.ts (98%) rename packages/{api-codec => types}/src/U128.ts (82%) rename packages/{api-codec => types}/src/U16.ts (81%) rename packages/{api-codec => types}/src/U256.ts (82%) rename packages/{api-codec => types}/src/U32.ts (81%) rename packages/{api-codec => types}/src/U64.ts (81%) rename packages/{api-codec => types}/src/U8.ts (81%) rename packages/{api-codec => types}/src/ValidatorPrefs.spec.js (90%) rename packages/{api-codec => types}/src/ValidatorPrefs.ts (91%) rename packages/{api-codec => types}/src/VoteIndex.ts (74%) rename packages/{api-codec => types}/src/VoteThreshold.spec.js (87%) rename packages/{api-codec => types}/src/VoteThreshold.ts (86%) rename packages/{api-codec => types}/src/codec/Base.spec.js (89%) rename packages/{api-codec => types}/src/codec/Base.ts (95%) rename packages/{api-codec => types}/src/codec/Compact.ts (97%) rename packages/{api-codec => types}/src/codec/Enum.spec.js (91%) rename packages/{api-codec => types}/src/codec/Enum.ts (95%) rename packages/{api-codec => types}/src/codec/EnumType.spec.js (92%) rename packages/{api-codec => types}/src/codec/EnumType.ts (96%) rename packages/{api-codec => types}/src/codec/Length.spec.js (96%) rename packages/{api-codec => types}/src/codec/Length.ts (96%) rename packages/{api-codec => types}/src/codec/Option.spec.js (94%) rename packages/{api-codec => types}/src/codec/Option.ts (96%) rename packages/{api-codec => types}/src/codec/Struct.spec.js (93%) rename packages/{api-codec => types}/src/codec/Struct.ts (98%) rename packages/{api-codec => types}/src/codec/Tuple.spec.js (92%) rename packages/{api-codec => types}/src/codec/Tuple.ts (95%) rename packages/{api-codec => types}/src/codec/U8a.spec.js (88%) rename packages/{api-codec => types}/src/codec/U8a.ts (95%) rename packages/{api-codec => types}/src/codec/U8aFixed.spec.js (90%) rename packages/{api-codec => types}/src/codec/U8aFixed.ts (93%) rename packages/{api-codec => types}/src/codec/UInt.spec.js (94%) rename packages/{api-codec => types}/src/codec/UInt.ts (98%) rename packages/{api-codec => types}/src/codec/Vector.spec.js (96%) rename packages/{api-codec => types}/src/codec/Vector.ts (97%) rename packages/{api-codec => types}/src/codec/createType.spec.js (97%) rename packages/{api-codec => types}/src/codec/createType.ts (97%) rename packages/{api-codec => types}/src/codec/index.ts (67%) rename packages/{api-codec => types}/src/index.ts (98%) rename packages/{api-codec => types}/src/types.d.ts (73%) diff --git a/jest.config.js b/jest.config.js index c5958d3857..7f4cb51f08 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,12 +2,13 @@ const config = require('@polkadot/dev/config/jest'); module.exports = Object.assign({}, config, { moduleNameMapper: { - '@polkadot/api-(codec|jsonrpc|observable|provider|rx)(.*)$': '/packages/api-$1/src/$2', + '@polkadot/api-(jsonrpc|observable|provider|rx)(.*)$': '/packages/api-$1/src/$2', '@polkadot/api(.*)$': '/packages/api/src/$1', '@polkadot/extrinsics(.*)$': '/packages/type-extrinsics/src/$1', '@polkadot/jsonrpc(.*)$': '/packages/type-jsonrpc/src/$1', '@polkadot/params(.*)$': '/packages/type-params/src/$1', '@polkadot/primitives(.*)$': '/packages/type-primitives/src/$1', - '@polkadot/storage(.*)$': '/packages/type-storage/src/$1' + '@polkadot/storage(.*)$': '/packages/type-storage/src/$1', + '@polkadot/types(.*)$': '/packages/types/src/$1' } }); diff --git a/packages/api-codec/.nodoc b/packages/api-codec/.nodoc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/api-codec/README.md b/packages/api-codec/README.md deleted file mode 100644 index 0e19b4d496..0000000000 --- a/packages/api-codec/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# @polkadot/api-codec - -Implementation of the parity-codec diff --git a/packages/api-observable/src/Base.ts b/packages/api-observable/src/Base.ts index e0bbea8f08..229f70f4e1 100644 --- a/packages/api-observable/src/Base.ts +++ b/packages/api-observable/src/Base.ts @@ -7,7 +7,7 @@ import { Method } from '@polkadot/jsonrpc/types'; import { Observable, combineLatest } from 'rxjs'; import { defaultIfEmpty, map } from 'rxjs/operators'; -import { StorageFunction } from '@polkadot/api-codec/StorageKey'; +import { StorageFunction } from '@polkadot/types/StorageKey'; import assert from '@polkadot/util/assert'; import isUndefined from '@polkadot/util/is/undefined'; diff --git a/packages/api-observable/src/Calls.ts b/packages/api-observable/src/Calls.ts index a48e9dee5c..62b2d0660d 100644 --- a/packages/api-observable/src/Calls.ts +++ b/packages/api-observable/src/Calls.ts @@ -4,7 +4,7 @@ import { Observable } from 'rxjs'; import { defaultIfEmpty, map } from 'rxjs/operators'; -import { BlockNumber, Header, SignedBlock } from '@polkadot/api-codec/index'; +import { BlockNumber, Header, SignedBlock } from '@polkadot/types/index'; import ApiQueries from './Queries'; diff --git a/packages/api-observable/src/Combined.ts b/packages/api-observable/src/Combined.ts index c603c0bd2d..0499b52d97 100644 --- a/packages/api-observable/src/Combined.ts +++ b/packages/api-observable/src/Combined.ts @@ -7,7 +7,7 @@ import { RxBalance, RxBalanceMap, RxReferendumVote } from './types'; import BN from 'bn.js'; import { EMPTY, Observable } from 'rxjs'; import { switchMap, defaultIfEmpty, map } from 'rxjs/operators'; -import { AccountId, Balance, Bool, BlockNumber, Moment, ReferendumIndex } from '@polkadot/api-codec/index'; +import { AccountId, Balance, Bool, BlockNumber, Moment, ReferendumIndex } from '@polkadot/types/index'; import isString from '@polkadot/util/is/string'; import ApiCalls from './Calls'; diff --git a/packages/api-observable/src/Queries.ts b/packages/api-observable/src/Queries.ts index 997ebf74bc..e4acb80a06 100644 --- a/packages/api-observable/src/Queries.ts +++ b/packages/api-observable/src/Queries.ts @@ -7,8 +7,8 @@ import { RxFees } from './types'; import BN from 'bn.js'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { AccountId, Balance, Bool, BlockNumber, Index, Moment, Perbill, PropIndex, ReferendumIndex, u32 } from '@polkadot/api-codec/index'; -import { Tuple } from '@polkadot/api-codec/codec'; +import { AccountId, Balance, Bool, BlockNumber, Index, Moment, Perbill, PropIndex, ReferendumIndex, u32 } from '@polkadot/types/index'; +import { Tuple } from '@polkadot/types/codec'; import storage from '@polkadot/storage/testing'; import ApiBase from './Base'; diff --git a/packages/api-observable/src/classes.ts b/packages/api-observable/src/classes.ts index b696c3834c..ac1407d3fd 100644 --- a/packages/api-observable/src/classes.ts +++ b/packages/api-observable/src/classes.ts @@ -3,8 +3,8 @@ // of the ISC license. See the LICENSE file for details. import BN from 'bn.js'; -import { AccountId, Balance, BlockNumber, PropIndex, Proposal, ReferendumIndex, VoteThreshold } from '@polkadot/api-codec/index'; -import { Struct, Tuple, Vector } from '@polkadot/api-codec/codec'; +import { AccountId, Balance, BlockNumber, PropIndex, Proposal, ReferendumIndex, VoteThreshold } from '@polkadot/types/index'; +import { Struct, Tuple, Vector } from '@polkadot/types/codec'; export class RxProposal extends Struct.with({ id: PropIndex, proposal: Proposal, address: AccountId }) { constructor (value: Tuple) { diff --git a/packages/api-observable/src/types.d.ts b/packages/api-observable/src/types.d.ts index 05d47346cf..158fd0780d 100644 --- a/packages/api-observable/src/types.d.ts +++ b/packages/api-observable/src/types.d.ts @@ -3,8 +3,8 @@ // of the ISC license. See the LICENSE file for details. import { Observable } from 'rxjs'; -import { AccountId, Balance, BlockNumber, Bool, Header, PropIndex, Proposal, ReferendumIndex, u32, VoteThreshold } from '@polkadot/api-codec/index'; -import { Tuple } from '@polkadot/api-codec/codec'; +import { AccountId, Balance, BlockNumber, Bool, Header, PropIndex, Proposal, ReferendumIndex, u32, VoteThreshold } from '@polkadot/types/index'; +import { Tuple } from '@polkadot/types/codec'; import ApiBase from './Base'; import ApiCalls from './Calls'; diff --git a/packages/api-provider/src/mock/mocks.ts b/packages/api-provider/src/mock/mocks.ts index 847d19664d..56c8326506 100644 --- a/packages/api-provider/src/mock/mocks.ts +++ b/packages/api-provider/src/mock/mocks.ts @@ -4,13 +4,13 @@ // FIXME: This file is way too long and way too messy -import { StorageFunction } from '@polkadot/api-codec/StorageKey'; +import { StorageFunction } from '@polkadot/types/StorageKey'; import { KeyringPair } from '@polkadot/util-keyring/types'; import { ProviderInterface$Emitted } from '../types'; import { MockState, MockState$Db, MockState$Subscriptions } from './types'; import BN from 'bn.js'; -import Header from '@polkadot/api-codec/Header'; +import Header from '@polkadot/types/Header'; import storage from '@polkadot/storage/testing'; import bnToU8a from '@polkadot/util/bn/toU8a'; import u8aToHex from '@polkadot/util/u8a/toHex'; diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index 2427e2ec23..f2922b5e75 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -6,8 +6,8 @@ import { ProviderInterface, ProviderInterface$Callback } from '@polkadot/api-pro import { Section, Method } from '@polkadot/jsonrpc/types'; import { ApiInterface, ApiInterface$Section, ApiInterface$Section$Method } from './types'; -import { Base, Vector, createType } from '@polkadot/api-codec/codec'; -import { StorageChangeSet, StorageKey } from '@polkadot/api-codec/index'; +import { Base, Vector, createType } from '@polkadot/types/codec'; +import { StorageChangeSet, StorageKey } from '@polkadot/types/index'; import interfaces from '@polkadot/jsonrpc/index'; import assert from '@polkadot/util/assert'; import ExtError from '@polkadot/util/ext/error'; diff --git a/packages/type-extrinsics/src/fromMetadata.spec.js b/packages/type-extrinsics/src/fromMetadata.spec.js index 8ee77e4d72..e4d2960101 100644 --- a/packages/type-extrinsics/src/fromMetadata.spec.js +++ b/packages/type-extrinsics/src/fromMetadata.spec.js @@ -2,8 +2,8 @@ // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. -import Metadata from '@polkadot/api-codec/Metadata'; -import json from '@polkadot/api-codec/Metadata.rpc'; +import Metadata from '@polkadot/types/Metadata'; +import json from '@polkadot/types/Metadata.rpc'; import fromMetadata from './fromMetadata'; diff --git a/packages/type-extrinsics/src/fromMetadata.ts b/packages/type-extrinsics/src/fromMetadata.ts index 75db4841f9..35ce839838 100644 --- a/packages/type-extrinsics/src/fromMetadata.ts +++ b/packages/type-extrinsics/src/fromMetadata.ts @@ -3,7 +3,7 @@ // of the ISC license. See the LICENSE file for details. import camelCase from '@polkadot/util/string/camelCase'; -import Metadata, { RuntimeModuleMetadata } from '@polkadot/api-codec/Metadata'; +import Metadata, { RuntimeModuleMetadata } from '@polkadot/types/Metadata'; import createExtrinsic from './utils/createExtrinsic'; import { Extrinsics, ModuleExtrinsics } from './types'; diff --git a/packages/type-extrinsics/src/utils/createExtrinsic.ts b/packages/type-extrinsics/src/utils/createExtrinsic.ts index ebfc02e986..3d72292eed 100644 --- a/packages/type-extrinsics/src/utils/createExtrinsic.ts +++ b/packages/type-extrinsics/src/utils/createExtrinsic.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. -import { createType } from '@polkadot/api-codec/codec'; -import { FunctionMetadata } from '@polkadot/api-codec/Metadata'; -import { Extrinsic, Text } from '@polkadot/api-codec/index'; +import { createType } from '@polkadot/types/codec'; +import { FunctionMetadata } from '@polkadot/types/Metadata'; +import { Extrinsic, Text } from '@polkadot/types/index'; import u8aConcat from '@polkadot/util/u8a/concat'; import { ExtrinsicFunction } from '../types'; diff --git a/packages/type-jsonrpc/src/create/param.ts b/packages/type-jsonrpc/src/create/param.ts index d2d9a858ce..3143410ad5 100644 --- a/packages/type-jsonrpc/src/create/param.ts +++ b/packages/type-jsonrpc/src/create/param.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. -import { CodecTypes } from '@polkadot/api-codec/types'; +import { CodecTypes } from '@polkadot/types/types'; import { Param } from '../types'; type ParamOptions = { diff --git a/packages/type-jsonrpc/src/types.d.ts b/packages/type-jsonrpc/src/types.d.ts index cf2052f18e..9ba6a33527 100644 --- a/packages/type-jsonrpc/src/types.d.ts +++ b/packages/type-jsonrpc/src/types.d.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. -import { CodecTypes } from '@polkadot/api-codec/types'; +import { CodecTypes } from '@polkadot/types/types'; export type Param = { isOptional: boolean, diff --git a/packages/type-storage/package.json b/packages/type-storage/package.json index 1b3fd77d3c..4b2b048516 100644 --- a/packages/type-storage/package.json +++ b/packages/type-storage/package.json @@ -30,7 +30,7 @@ "homepage": "https://github.com/polkadot-js/api/tree/master/packages/type-storage#readme", "dependencies": { "@babel/runtime": "^7.0.0", - "@polkadot/api-codec": "^0.30.9", + "@polkadot/types": "^0.30.9", "@polkadot/params": "^0.30.3", "@polkadot/primitives": "^0.30.3", "@polkadot/util": "^0.30.7", diff --git a/packages/type-storage/src/fromMetadata.spec.js b/packages/type-storage/src/fromMetadata.spec.js index 68b26aaef5..06c39734ee 100644 --- a/packages/type-storage/src/fromMetadata.spec.js +++ b/packages/type-storage/src/fromMetadata.spec.js @@ -2,8 +2,8 @@ // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. -import Metadata from '@polkadot/api-codec/Metadata'; -import json from '@polkadot/api-codec/Metadata.rpc'; +import Metadata from '@polkadot/types/Metadata'; +import json from '@polkadot/types/Metadata.rpc'; import fromMetadata from './fromMetadata'; diff --git a/packages/type-storage/src/fromMetadata.ts b/packages/type-storage/src/fromMetadata.ts index fbbf99a800..ac529a84a1 100644 --- a/packages/type-storage/src/fromMetadata.ts +++ b/packages/type-storage/src/fromMetadata.ts @@ -4,7 +4,7 @@ import { ModuleStorage, Storage } from './types'; -import Metadata from '@polkadot/api-codec/Metadata'; +import Metadata from '@polkadot/types/Metadata'; import { stringLowerFirst } from '@polkadot/util/string'; import createFunction from './utils/createFunction'; diff --git a/packages/type-storage/src/substrate.ts b/packages/type-storage/src/substrate.ts index 8382ed1386..a761adb9b4 100644 --- a/packages/type-storage/src/substrate.ts +++ b/packages/type-storage/src/substrate.ts @@ -2,9 +2,9 @@ // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. -import { StorageFunctionModifier, StorageFunctionType } from '@polkadot/api-codec/Metadata'; -import Text from '@polkadot/api-codec/Text'; -import Vector from '@polkadot/api-codec/codec/Vector'; +import { StorageFunctionModifier, StorageFunctionType } from '@polkadot/types/Metadata'; +import Text from '@polkadot/types/Text'; +import Vector from '@polkadot/types/codec/Vector'; import createFunction from './utils/createFunction'; diff --git a/packages/type-storage/src/testing.ts b/packages/type-storage/src/testing.ts index 817de1532d..ec0c2d376b 100644 --- a/packages/type-storage/src/testing.ts +++ b/packages/type-storage/src/testing.ts @@ -2,8 +2,8 @@ // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. -import metadataRpc from '@polkadot/api-codec/Metadata.rpc'; -import Metadata from '@polkadot/api-codec/Metadata'; +import metadataRpc from '@polkadot/types/Metadata.rpc'; +import Metadata from '@polkadot/types/Metadata'; import storage from './index'; import fromMetadata from './fromMetadata'; diff --git a/packages/type-storage/src/types.d.ts b/packages/type-storage/src/types.d.ts index 3db29898a5..8f266487ec 100644 --- a/packages/type-storage/src/types.d.ts +++ b/packages/type-storage/src/types.d.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. -import { StorageFunction } from '@polkadot/api-codec/StorageKey'; +import { StorageFunction } from '@polkadot/types/StorageKey'; import BN from 'bn.js'; import * as substrate from './substrate'; diff --git a/packages/type-storage/src/utils/createFunction.ts b/packages/type-storage/src/utils/createFunction.ts index 4e62219181..a269fa2745 100644 --- a/packages/type-storage/src/utils/createFunction.ts +++ b/packages/type-storage/src/utils/createFunction.ts @@ -2,10 +2,10 @@ // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. -import { createType } from '@polkadot/api-codec/codec'; -import { StorageFunctionMetadata } from '@polkadot/api-codec/Metadata'; -import { StorageFunction } from '@polkadot/api-codec/StorageKey'; -import { Text } from '@polkadot/api-codec/index'; +import { createType } from '@polkadot/types/codec'; +import { StorageFunctionMetadata } from '@polkadot/types/Metadata'; +import { StorageFunction } from '@polkadot/types/StorageKey'; +import { Text } from '@polkadot/types/index'; import { stringLowerFirst } from '@polkadot/util/string'; import u8aConcat from '@polkadot/util/u8a/concat'; import u8aFromUtf8 from '@polkadot/util/u8a/fromUtf8'; diff --git a/packages/api-codec/LICENSE b/packages/types/LICENSE similarity index 91% rename from packages/api-codec/LICENSE rename to packages/types/LICENSE index b26ce95c95..1d31865b2e 100644 --- a/packages/api-codec/LICENSE +++ b/packages/types/LICENSE @@ -1,6 +1,6 @@ ISC License (ISC) -Copyright 2017-2018 @polkadot/api-codec authors & contributors +Copyright 2017-2018 @polkadot/types authors & contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/packages/types/README.md b/packages/types/README.md new file mode 100644 index 0000000000..a2ae3fa9ac --- /dev/null +++ b/packages/types/README.md @@ -0,0 +1,3 @@ +# @polkadot/types + +Implementation of the types and their serialisation via parity-codec diff --git a/packages/api-codec/package.json b/packages/types/package.json similarity index 93% rename from packages/api-codec/package.json rename to packages/types/package.json index b0bf2548e9..9833ef588e 100644 --- a/packages/api-codec/package.json +++ b/packages/types/package.json @@ -1,5 +1,5 @@ { - "name": "@polkadot/api-codec", + "name": "@polkadot/types", "version": "0.30.9", "description": "Implementation of the Parity codec", "main": "index.js", @@ -27,7 +27,7 @@ "bugs": { "url": "https://github.com/polkadot-js/api/issues" }, - "homepage": "https://github.com/polkadot-js/api/tree/master/packages/api-codec#readme", + "homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme", "dependencies": { "@babel/runtime": "^7.0.0", "@polkadot/util": "^0.30.7", diff --git a/packages/api-codec/src/AccountId.spec.js b/packages/types/src/AccountId.spec.js similarity index 95% rename from packages/api-codec/src/AccountId.spec.js rename to packages/types/src/AccountId.spec.js index a8cd3384d5..4d17d4299a 100644 --- a/packages/api-codec/src/AccountId.spec.js +++ b/packages/types/src/AccountId.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/AccountId.ts b/packages/types/src/AccountId.ts similarity index 96% rename from packages/api-codec/src/AccountId.ts rename to packages/types/src/AccountId.ts index 1110fe895c..e472b5bf8d 100644 --- a/packages/api-codec/src/AccountId.ts +++ b/packages/types/src/AccountId.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/AccountIndex.ts b/packages/types/src/AccountIndex.ts similarity index 95% rename from packages/api-codec/src/AccountIndex.ts rename to packages/types/src/AccountIndex.ts index a34f1a8365..4f21541c46 100644 --- a/packages/api-codec/src/AccountIndex.ts +++ b/packages/types/src/AccountIndex.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Address.spec.js b/packages/types/src/Address.spec.js similarity index 97% rename from packages/api-codec/src/Address.spec.js rename to packages/types/src/Address.spec.js index b1a2c9d87d..a6f6b18008 100644 --- a/packages/api-codec/src/Address.spec.js +++ b/packages/types/src/Address.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Address.ts b/packages/types/src/Address.ts similarity index 98% rename from packages/api-codec/src/Address.ts rename to packages/types/src/Address.ts index 14e61c2647..8a57c89207 100644 --- a/packages/api-codec/src/Address.ts +++ b/packages/types/src/Address.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/AuthorityId.ts b/packages/types/src/AuthorityId.ts similarity index 85% rename from packages/api-codec/src/AuthorityId.ts rename to packages/types/src/AuthorityId.ts index 51a438c24f..815a417d82 100644 --- a/packages/api-codec/src/AuthorityId.ts +++ b/packages/types/src/AuthorityId.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Balance.ts b/packages/types/src/Balance.ts similarity index 78% rename from packages/api-codec/src/Balance.ts rename to packages/types/src/Balance.ts index 626026c299..5f1ab8cbb2 100644 --- a/packages/api-codec/src/Balance.ts +++ b/packages/types/src/Balance.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Bft.spec.js b/packages/types/src/Bft.spec.js similarity index 95% rename from packages/api-codec/src/Bft.spec.js rename to packages/types/src/Bft.spec.js index 79e567fb26..3d43a298d9 100644 --- a/packages/api-codec/src/Bft.spec.js +++ b/packages/types/src/Bft.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Bft.ts b/packages/types/src/Bft.ts similarity index 97% rename from packages/api-codec/src/Bft.ts rename to packages/types/src/Bft.ts index 2b1c33a1ba..0bafa9305d 100644 --- a/packages/api-codec/src/Bft.ts +++ b/packages/types/src/Bft.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Block.spec.js b/packages/types/src/Block.spec.js similarity index 97% rename from packages/api-codec/src/Block.spec.js rename to packages/types/src/Block.spec.js index a5086141f8..8deb0d4ba5 100644 --- a/packages/api-codec/src/Block.spec.js +++ b/packages/types/src/Block.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Block.ts b/packages/types/src/Block.ts similarity index 93% rename from packages/api-codec/src/Block.ts rename to packages/types/src/Block.ts index 471e1e5fd4..1ab5fec7c0 100644 --- a/packages/api-codec/src/Block.ts +++ b/packages/types/src/Block.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/BlockNumber.ts b/packages/types/src/BlockNumber.ts similarity index 75% rename from packages/api-codec/src/BlockNumber.ts rename to packages/types/src/BlockNumber.ts index eac1c1218a..fa88c75bae 100644 --- a/packages/api-codec/src/BlockNumber.ts +++ b/packages/types/src/BlockNumber.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Bool.ts b/packages/types/src/Bool.ts similarity index 92% rename from packages/api-codec/src/Bool.ts rename to packages/types/src/Bool.ts index 18d0c9b8fd..9a6658fdcb 100644 --- a/packages/api-codec/src/Bool.ts +++ b/packages/types/src/Bool.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Bytes.ts b/packages/types/src/Bytes.ts similarity index 95% rename from packages/api-codec/src/Bytes.ts rename to packages/types/src/Bytes.ts index 1739946a55..50e929efc5 100644 --- a/packages/api-codec/src/Bytes.ts +++ b/packages/types/src/Bytes.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Extrinsic.ts b/packages/types/src/Extrinsic.ts similarity index 90% rename from packages/api-codec/src/Extrinsic.ts rename to packages/types/src/Extrinsic.ts index 7e0185d45a..3548d48638 100644 --- a/packages/api-codec/src/Extrinsic.ts +++ b/packages/types/src/Extrinsic.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Extrinsics.ts b/packages/types/src/Extrinsics.ts similarity index 81% rename from packages/api-codec/src/Extrinsics.ts rename to packages/types/src/Extrinsics.ts index ce0f8202ef..6b9cee95f0 100644 --- a/packages/api-codec/src/Extrinsics.ts +++ b/packages/types/src/Extrinsics.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Gas.ts b/packages/types/src/Gas.ts similarity index 76% rename from packages/api-codec/src/Gas.ts rename to packages/types/src/Gas.ts index 48210126da..c6ce57f5ee 100644 --- a/packages/api-codec/src/Gas.ts +++ b/packages/types/src/Gas.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/H256.ts b/packages/types/src/H256.ts similarity index 87% rename from packages/api-codec/src/H256.ts rename to packages/types/src/H256.ts index bb5604341c..bf82e735b9 100644 --- a/packages/api-codec/src/H256.ts +++ b/packages/types/src/H256.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/H512.ts b/packages/types/src/H512.ts similarity index 85% rename from packages/api-codec/src/H512.ts rename to packages/types/src/H512.ts index 4b00d4c57c..fe145ce339 100644 --- a/packages/api-codec/src/H512.ts +++ b/packages/types/src/H512.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Hash.ts b/packages/types/src/Hash.ts similarity index 84% rename from packages/api-codec/src/Hash.ts rename to packages/types/src/Hash.ts index 757f71fc3a..f0f7382ce7 100644 --- a/packages/api-codec/src/Hash.ts +++ b/packages/types/src/Hash.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Header.only.json b/packages/types/src/Header.only.json similarity index 100% rename from packages/api-codec/src/Header.only.json rename to packages/types/src/Header.only.json diff --git a/packages/api-codec/src/Header.spec.js b/packages/types/src/Header.spec.js similarity index 95% rename from packages/api-codec/src/Header.spec.js rename to packages/types/src/Header.spec.js index c5da72112a..ba65a1fb48 100644 --- a/packages/api-codec/src/Header.spec.js +++ b/packages/types/src/Header.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Header.ts b/packages/types/src/Header.ts similarity index 96% rename from packages/api-codec/src/Header.ts rename to packages/types/src/Header.ts index 3619b24951..bf3fc4e303 100644 --- a/packages/api-codec/src/Header.ts +++ b/packages/types/src/Header.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/KeyValue.spec.js b/packages/types/src/KeyValue.spec.js similarity index 95% rename from packages/api-codec/src/KeyValue.spec.js rename to packages/types/src/KeyValue.spec.js index feaa0f26a8..311350e247 100644 --- a/packages/api-codec/src/KeyValue.spec.js +++ b/packages/types/src/KeyValue.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/KeyValue.ts b/packages/types/src/KeyValue.ts similarity index 96% rename from packages/api-codec/src/KeyValue.ts rename to packages/types/src/KeyValue.ts index cd45a1dd31..a911d63ba5 100644 --- a/packages/api-codec/src/KeyValue.ts +++ b/packages/types/src/KeyValue.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Metadata.decoded.json b/packages/types/src/Metadata.decoded.json similarity index 100% rename from packages/api-codec/src/Metadata.decoded.json rename to packages/types/src/Metadata.decoded.json diff --git a/packages/api-codec/src/Metadata.rpc.ts b/packages/types/src/Metadata.rpc.ts similarity index 99% rename from packages/api-codec/src/Metadata.rpc.ts rename to packages/types/src/Metadata.rpc.ts index a3d2baced5..727bbb490e 100644 --- a/packages/api-codec/src/Metadata.rpc.ts +++ b/packages/types/src/Metadata.rpc.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Metadata.spec.js b/packages/types/src/Metadata.spec.js similarity index 87% rename from packages/api-codec/src/Metadata.spec.js rename to packages/types/src/Metadata.spec.js index b00102fec2..0b84f7e049 100644 --- a/packages/api-codec/src/Metadata.spec.js +++ b/packages/types/src/Metadata.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Metadata.ts b/packages/types/src/Metadata.ts similarity index 99% rename from packages/api-codec/src/Metadata.ts rename to packages/types/src/Metadata.ts index 708c0f9775..7dd57f2fa6 100644 --- a/packages/api-codec/src/Metadata.ts +++ b/packages/types/src/Metadata.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/MisbehaviorReport.spec.js b/packages/types/src/MisbehaviorReport.spec.js similarity index 95% rename from packages/api-codec/src/MisbehaviorReport.spec.js rename to packages/types/src/MisbehaviorReport.spec.js index 8f3322310d..c16df5e627 100644 --- a/packages/api-codec/src/MisbehaviorReport.spec.js +++ b/packages/types/src/MisbehaviorReport.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/MisbehaviorReport.ts b/packages/types/src/MisbehaviorReport.ts similarity index 97% rename from packages/api-codec/src/MisbehaviorReport.ts rename to packages/types/src/MisbehaviorReport.ts index f79d344324..5487dbec1d 100644 --- a/packages/api-codec/src/MisbehaviorReport.ts +++ b/packages/types/src/MisbehaviorReport.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Moment.spec.js b/packages/types/src/Moment.spec.js similarity index 93% rename from packages/api-codec/src/Moment.spec.js rename to packages/types/src/Moment.spec.js index 195275a826..fd793e22a9 100644 --- a/packages/api-codec/src/Moment.spec.js +++ b/packages/types/src/Moment.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Moment.ts b/packages/types/src/Moment.ts similarity index 96% rename from packages/api-codec/src/Moment.ts rename to packages/types/src/Moment.ts index 88559513b0..76db500e42 100644 --- a/packages/api-codec/src/Moment.ts +++ b/packages/types/src/Moment.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/NewAccountOutcome.spec.js b/packages/types/src/NewAccountOutcome.spec.js similarity index 84% rename from packages/api-codec/src/NewAccountOutcome.spec.js rename to packages/types/src/NewAccountOutcome.spec.js index f4ce2059f7..fab5ff9041 100644 --- a/packages/api-codec/src/NewAccountOutcome.spec.js +++ b/packages/types/src/NewAccountOutcome.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/NewAccountOutcome.ts b/packages/types/src/NewAccountOutcome.ts similarity index 85% rename from packages/api-codec/src/NewAccountOutcome.ts rename to packages/types/src/NewAccountOutcome.ts index 961c92c91d..7d6e0ee178 100644 --- a/packages/api-codec/src/NewAccountOutcome.ts +++ b/packages/types/src/NewAccountOutcome.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Nonce.ts b/packages/types/src/Nonce.ts similarity index 83% rename from packages/api-codec/src/Nonce.ts rename to packages/types/src/Nonce.ts index f53f965789..6b2e14992a 100644 --- a/packages/api-codec/src/Nonce.ts +++ b/packages/types/src/Nonce.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Origin.spec.js b/packages/types/src/Origin.spec.js similarity index 82% rename from packages/api-codec/src/Origin.spec.js rename to packages/types/src/Origin.spec.js index f08e05c7b3..a8e98c1c2f 100644 --- a/packages/api-codec/src/Origin.spec.js +++ b/packages/types/src/Origin.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Origin.ts b/packages/types/src/Origin.ts similarity index 86% rename from packages/api-codec/src/Origin.ts rename to packages/types/src/Origin.ts index 0cb34655d3..c7a89d61b7 100644 --- a/packages/api-codec/src/Origin.ts +++ b/packages/types/src/Origin.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/ParachainId.ts b/packages/types/src/ParachainId.ts similarity index 78% rename from packages/api-codec/src/ParachainId.ts rename to packages/types/src/ParachainId.ts index c7e4edac3d..6e06be5de2 100644 --- a/packages/api-codec/src/ParachainId.ts +++ b/packages/types/src/ParachainId.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/PendingExtrinsics.ts b/packages/types/src/PendingExtrinsics.ts similarity index 79% rename from packages/api-codec/src/PendingExtrinsics.ts rename to packages/types/src/PendingExtrinsics.ts index 90702c633b..a8963a1b75 100644 --- a/packages/api-codec/src/PendingExtrinsics.ts +++ b/packages/types/src/PendingExtrinsics.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Perbill.ts b/packages/types/src/Perbill.ts similarity index 84% rename from packages/api-codec/src/Perbill.ts rename to packages/types/src/Perbill.ts index 9599cc550a..1a0c01c29f 100644 --- a/packages/api-codec/src/Perbill.ts +++ b/packages/types/src/Perbill.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Permill.ts b/packages/types/src/Permill.ts similarity index 84% rename from packages/api-codec/src/Permill.ts rename to packages/types/src/Permill.ts index 4d1c26aa8c..b9f95c7bf6 100644 --- a/packages/api-codec/src/Permill.ts +++ b/packages/types/src/Permill.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/PropIndex.ts b/packages/types/src/PropIndex.ts similarity index 80% rename from packages/api-codec/src/PropIndex.ts rename to packages/types/src/PropIndex.ts index 072a6ac78d..2640f83cbb 100644 --- a/packages/api-codec/src/PropIndex.ts +++ b/packages/types/src/PropIndex.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Proposal.ts b/packages/types/src/Proposal.ts similarity index 84% rename from packages/api-codec/src/Proposal.ts rename to packages/types/src/Proposal.ts index 6507255706..832644aa46 100644 --- a/packages/api-codec/src/Proposal.ts +++ b/packages/types/src/Proposal.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/ProposalIndex.ts b/packages/types/src/ProposalIndex.ts similarity index 80% rename from packages/api-codec/src/ProposalIndex.ts rename to packages/types/src/ProposalIndex.ts index d2d73ce3f5..b8d90f2414 100644 --- a/packages/api-codec/src/ProposalIndex.ts +++ b/packages/types/src/ProposalIndex.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/RawAddress.ts b/packages/types/src/RawAddress.ts similarity index 82% rename from packages/api-codec/src/RawAddress.ts rename to packages/types/src/RawAddress.ts index 9c0650f9c9..644eb9a106 100644 --- a/packages/api-codec/src/RawAddress.ts +++ b/packages/types/src/RawAddress.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/ReferendumIndex.ts b/packages/types/src/ReferendumIndex.ts similarity index 82% rename from packages/api-codec/src/ReferendumIndex.ts rename to packages/types/src/ReferendumIndex.ts index f28691c5b2..ea0b7a75c1 100644 --- a/packages/api-codec/src/ReferendumIndex.ts +++ b/packages/types/src/ReferendumIndex.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/RuntimeVersion.rpc.json b/packages/types/src/RuntimeVersion.rpc.json similarity index 100% rename from packages/api-codec/src/RuntimeVersion.rpc.json rename to packages/types/src/RuntimeVersion.rpc.json diff --git a/packages/api-codec/src/RuntimeVersion.spec.js b/packages/types/src/RuntimeVersion.spec.js similarity index 93% rename from packages/api-codec/src/RuntimeVersion.spec.js rename to packages/types/src/RuntimeVersion.spec.js index 9aac940c8e..17963ce5cf 100644 --- a/packages/api-codec/src/RuntimeVersion.spec.js +++ b/packages/types/src/RuntimeVersion.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/RuntimeVersion.ts b/packages/types/src/RuntimeVersion.ts similarity index 93% rename from packages/api-codec/src/RuntimeVersion.ts rename to packages/types/src/RuntimeVersion.ts index abe1a0595b..6d57f90933 100644 --- a/packages/api-codec/src/RuntimeVersion.ts +++ b/packages/types/src/RuntimeVersion.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. @@ -6,10 +6,10 @@ import { AnyNumber, AnyU8a } from './types'; import Struct from './codec/Struct'; import Tuple from './codec/Tuple'; +import U8aFixed from './codec/U8aFixed'; import Vector from './codec/Vector'; import Text from './Text'; import U32 from './U32'; -import U8aFixed from '@polkadot/api-codec/codec/U8aFixed'; class ApiId extends U8aFixed { constructor (value?: AnyU8a) { diff --git a/packages/api-codec/src/Signature.ts b/packages/types/src/Signature.ts similarity index 83% rename from packages/api-codec/src/Signature.ts rename to packages/types/src/Signature.ts index 9bb2ea27f4..d4bc03f717 100644 --- a/packages/api-codec/src/Signature.ts +++ b/packages/types/src/Signature.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/SignedBlock.rpc.json b/packages/types/src/SignedBlock.rpc.json similarity index 100% rename from packages/api-codec/src/SignedBlock.rpc.json rename to packages/types/src/SignedBlock.rpc.json diff --git a/packages/api-codec/src/SignedBlock.spec.js b/packages/types/src/SignedBlock.spec.js similarity index 91% rename from packages/api-codec/src/SignedBlock.spec.js rename to packages/types/src/SignedBlock.spec.js index 6ebf3b9135..85435ae08c 100644 --- a/packages/api-codec/src/SignedBlock.spec.js +++ b/packages/types/src/SignedBlock.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/SignedBlock.ts b/packages/types/src/SignedBlock.ts similarity index 91% rename from packages/api-codec/src/SignedBlock.ts rename to packages/types/src/SignedBlock.ts index c46dd85ad1..8809b274f6 100644 --- a/packages/api-codec/src/SignedBlock.ts +++ b/packages/types/src/SignedBlock.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/StorageChangeSet.spec.js b/packages/types/src/StorageChangeSet.spec.js similarity index 89% rename from packages/api-codec/src/StorageChangeSet.spec.js rename to packages/types/src/StorageChangeSet.spec.js index 045d63db1f..d5f44b78ae 100644 --- a/packages/api-codec/src/StorageChangeSet.spec.js +++ b/packages/types/src/StorageChangeSet.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/StorageChangeSet.ts b/packages/types/src/StorageChangeSet.ts similarity index 93% rename from packages/api-codec/src/StorageChangeSet.ts rename to packages/types/src/StorageChangeSet.ts index 6588197fba..7ed8fb26e6 100644 --- a/packages/api-codec/src/StorageChangeSet.ts +++ b/packages/types/src/StorageChangeSet.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/StorageData.ts b/packages/types/src/StorageData.ts similarity index 75% rename from packages/api-codec/src/StorageData.ts rename to packages/types/src/StorageData.ts index 564abceab9..fc844826ee 100644 --- a/packages/api-codec/src/StorageData.ts +++ b/packages/types/src/StorageData.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/StorageKey.ts b/packages/types/src/StorageKey.ts similarity index 96% rename from packages/api-codec/src/StorageKey.ts rename to packages/types/src/StorageKey.ts index 00afc2121d..8af4211028 100644 --- a/packages/api-codec/src/StorageKey.ts +++ b/packages/types/src/StorageKey.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Text.ts b/packages/types/src/Text.ts similarity index 97% rename from packages/api-codec/src/Text.ts rename to packages/types/src/Text.ts index 398aed1521..baa5a640f4 100644 --- a/packages/api-codec/src/Text.ts +++ b/packages/types/src/Text.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Type.spec.js b/packages/types/src/Type.spec.js similarity index 93% rename from packages/api-codec/src/Type.spec.js rename to packages/types/src/Type.spec.js index 514835e6eb..9ffa87b65b 100644 --- a/packages/api-codec/src/Type.spec.js +++ b/packages/types/src/Type.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/Type.ts b/packages/types/src/Type.ts similarity index 98% rename from packages/api-codec/src/Type.ts rename to packages/types/src/Type.ts index 9e6527f93e..86f50cd855 100644 --- a/packages/api-codec/src/Type.ts +++ b/packages/types/src/Type.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/U128.ts b/packages/types/src/U128.ts similarity index 82% rename from packages/api-codec/src/U128.ts rename to packages/types/src/U128.ts index bc08af199c..8205782140 100644 --- a/packages/api-codec/src/U128.ts +++ b/packages/types/src/U128.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/U16.ts b/packages/types/src/U16.ts similarity index 81% rename from packages/api-codec/src/U16.ts rename to packages/types/src/U16.ts index 0dcbd016fa..e22f6b2343 100644 --- a/packages/api-codec/src/U16.ts +++ b/packages/types/src/U16.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/U256.ts b/packages/types/src/U256.ts similarity index 82% rename from packages/api-codec/src/U256.ts rename to packages/types/src/U256.ts index fab6d6d346..90b3285544 100644 --- a/packages/api-codec/src/U256.ts +++ b/packages/types/src/U256.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/U32.ts b/packages/types/src/U32.ts similarity index 81% rename from packages/api-codec/src/U32.ts rename to packages/types/src/U32.ts index fbc95f3d82..b72504d668 100644 --- a/packages/api-codec/src/U32.ts +++ b/packages/types/src/U32.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/U64.ts b/packages/types/src/U64.ts similarity index 81% rename from packages/api-codec/src/U64.ts rename to packages/types/src/U64.ts index 0fd1062781..fba44503c9 100644 --- a/packages/api-codec/src/U64.ts +++ b/packages/types/src/U64.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/U8.ts b/packages/types/src/U8.ts similarity index 81% rename from packages/api-codec/src/U8.ts rename to packages/types/src/U8.ts index 4455896e12..bbba95c5cd 100644 --- a/packages/api-codec/src/U8.ts +++ b/packages/types/src/U8.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/ValidatorPrefs.spec.js b/packages/types/src/ValidatorPrefs.spec.js similarity index 90% rename from packages/api-codec/src/ValidatorPrefs.spec.js rename to packages/types/src/ValidatorPrefs.spec.js index 92b5f16f62..977ee63588 100644 --- a/packages/api-codec/src/ValidatorPrefs.spec.js +++ b/packages/types/src/ValidatorPrefs.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/ValidatorPrefs.ts b/packages/types/src/ValidatorPrefs.ts similarity index 91% rename from packages/api-codec/src/ValidatorPrefs.ts rename to packages/types/src/ValidatorPrefs.ts index b6bacd82f8..f22c508cf2 100644 --- a/packages/api-codec/src/ValidatorPrefs.ts +++ b/packages/types/src/ValidatorPrefs.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/VoteIndex.ts b/packages/types/src/VoteIndex.ts similarity index 74% rename from packages/api-codec/src/VoteIndex.ts rename to packages/types/src/VoteIndex.ts index 40f3212277..bd9df193a2 100644 --- a/packages/api-codec/src/VoteIndex.ts +++ b/packages/types/src/VoteIndex.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/VoteThreshold.spec.js b/packages/types/src/VoteThreshold.spec.js similarity index 87% rename from packages/api-codec/src/VoteThreshold.spec.js rename to packages/types/src/VoteThreshold.spec.js index a35da9e617..b375320ec1 100644 --- a/packages/api-codec/src/VoteThreshold.spec.js +++ b/packages/types/src/VoteThreshold.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/VoteThreshold.ts b/packages/types/src/VoteThreshold.ts similarity index 86% rename from packages/api-codec/src/VoteThreshold.ts rename to packages/types/src/VoteThreshold.ts index 1d9acce74a..3e7791c224 100644 --- a/packages/api-codec/src/VoteThreshold.ts +++ b/packages/types/src/VoteThreshold.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Base.spec.js b/packages/types/src/codec/Base.spec.js similarity index 89% rename from packages/api-codec/src/codec/Base.spec.js rename to packages/types/src/codec/Base.spec.js index 879bb61748..1aecc435ea 100644 --- a/packages/api-codec/src/codec/Base.spec.js +++ b/packages/types/src/codec/Base.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Base.ts b/packages/types/src/codec/Base.ts similarity index 95% rename from packages/api-codec/src/codec/Base.ts rename to packages/types/src/codec/Base.ts index 15d60c1bcc..6c39bab7da 100644 --- a/packages/api-codec/src/codec/Base.ts +++ b/packages/types/src/codec/Base.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Compact.ts b/packages/types/src/codec/Compact.ts similarity index 97% rename from packages/api-codec/src/codec/Compact.ts rename to packages/types/src/codec/Compact.ts index 1a57709e17..f7115a720a 100644 --- a/packages/api-codec/src/codec/Compact.ts +++ b/packages/types/src/codec/Compact.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Enum.spec.js b/packages/types/src/codec/Enum.spec.js similarity index 91% rename from packages/api-codec/src/codec/Enum.spec.js rename to packages/types/src/codec/Enum.spec.js index 191f408514..880d500eb9 100644 --- a/packages/api-codec/src/codec/Enum.spec.js +++ b/packages/types/src/codec/Enum.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Enum.ts b/packages/types/src/codec/Enum.ts similarity index 95% rename from packages/api-codec/src/codec/Enum.ts rename to packages/types/src/codec/Enum.ts index fedb77462a..1fbdcb24fc 100644 --- a/packages/api-codec/src/codec/Enum.ts +++ b/packages/types/src/codec/Enum.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/EnumType.spec.js b/packages/types/src/codec/EnumType.spec.js similarity index 92% rename from packages/api-codec/src/codec/EnumType.spec.js rename to packages/types/src/codec/EnumType.spec.js index 9876656209..932b08822f 100644 --- a/packages/api-codec/src/codec/EnumType.spec.js +++ b/packages/types/src/codec/EnumType.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/EnumType.ts b/packages/types/src/codec/EnumType.ts similarity index 96% rename from packages/api-codec/src/codec/EnumType.ts rename to packages/types/src/codec/EnumType.ts index b4cbf02a27..cc6073eca2 100644 --- a/packages/api-codec/src/codec/EnumType.ts +++ b/packages/types/src/codec/EnumType.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Length.spec.js b/packages/types/src/codec/Length.spec.js similarity index 96% rename from packages/api-codec/src/codec/Length.spec.js rename to packages/types/src/codec/Length.spec.js index 8ef0237cc5..a950122212 100644 --- a/packages/api-codec/src/codec/Length.spec.js +++ b/packages/types/src/codec/Length.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Length.ts b/packages/types/src/codec/Length.ts similarity index 96% rename from packages/api-codec/src/codec/Length.ts rename to packages/types/src/codec/Length.ts index 1fa3aea476..3c6f3080fc 100644 --- a/packages/api-codec/src/codec/Length.ts +++ b/packages/types/src/codec/Length.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Option.spec.js b/packages/types/src/codec/Option.spec.js similarity index 94% rename from packages/api-codec/src/codec/Option.spec.js rename to packages/types/src/codec/Option.spec.js index 0ad4027461..95ce559611 100644 --- a/packages/api-codec/src/codec/Option.spec.js +++ b/packages/types/src/codec/Option.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Option.ts b/packages/types/src/codec/Option.ts similarity index 96% rename from packages/api-codec/src/codec/Option.ts rename to packages/types/src/codec/Option.ts index bcefc31804..f08bd2e9af 100644 --- a/packages/api-codec/src/codec/Option.ts +++ b/packages/types/src/codec/Option.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Struct.spec.js b/packages/types/src/codec/Struct.spec.js similarity index 93% rename from packages/api-codec/src/codec/Struct.spec.js rename to packages/types/src/codec/Struct.spec.js index d177008f27..a1bab3adf5 100644 --- a/packages/api-codec/src/codec/Struct.spec.js +++ b/packages/types/src/codec/Struct.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Struct.ts b/packages/types/src/codec/Struct.ts similarity index 98% rename from packages/api-codec/src/codec/Struct.ts rename to packages/types/src/codec/Struct.ts index 9de43454d0..01f1fe078e 100644 --- a/packages/api-codec/src/codec/Struct.ts +++ b/packages/types/src/codec/Struct.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Tuple.spec.js b/packages/types/src/codec/Tuple.spec.js similarity index 92% rename from packages/api-codec/src/codec/Tuple.spec.js rename to packages/types/src/codec/Tuple.spec.js index 53decaedcb..57b42738a8 100644 --- a/packages/api-codec/src/codec/Tuple.spec.js +++ b/packages/types/src/codec/Tuple.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Tuple.ts b/packages/types/src/codec/Tuple.ts similarity index 95% rename from packages/api-codec/src/codec/Tuple.ts rename to packages/types/src/codec/Tuple.ts index a8f14dc1c2..9556646c8d 100644 --- a/packages/api-codec/src/codec/Tuple.ts +++ b/packages/types/src/codec/Tuple.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/U8a.spec.js b/packages/types/src/codec/U8a.spec.js similarity index 88% rename from packages/api-codec/src/codec/U8a.spec.js rename to packages/types/src/codec/U8a.spec.js index bc5902de22..f8d00a23ce 100644 --- a/packages/api-codec/src/codec/U8a.spec.js +++ b/packages/types/src/codec/U8a.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/U8a.ts b/packages/types/src/codec/U8a.ts similarity index 95% rename from packages/api-codec/src/codec/U8a.ts rename to packages/types/src/codec/U8a.ts index 563231b963..ae0ada42c5 100644 --- a/packages/api-codec/src/codec/U8a.ts +++ b/packages/types/src/codec/U8a.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/U8aFixed.spec.js b/packages/types/src/codec/U8aFixed.spec.js similarity index 90% rename from packages/api-codec/src/codec/U8aFixed.spec.js rename to packages/types/src/codec/U8aFixed.spec.js index 3d194f3235..912b9378dd 100644 --- a/packages/api-codec/src/codec/U8aFixed.spec.js +++ b/packages/types/src/codec/U8aFixed.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/U8aFixed.ts b/packages/types/src/codec/U8aFixed.ts similarity index 93% rename from packages/api-codec/src/codec/U8aFixed.ts rename to packages/types/src/codec/U8aFixed.ts index 7779e08676..a734e0dfd4 100644 --- a/packages/api-codec/src/codec/U8aFixed.ts +++ b/packages/types/src/codec/U8aFixed.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/UInt.spec.js b/packages/types/src/codec/UInt.spec.js similarity index 94% rename from packages/api-codec/src/codec/UInt.spec.js rename to packages/types/src/codec/UInt.spec.js index e151b851ef..02b8f21e9a 100644 --- a/packages/api-codec/src/codec/UInt.spec.js +++ b/packages/types/src/codec/UInt.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/UInt.ts b/packages/types/src/codec/UInt.ts similarity index 98% rename from packages/api-codec/src/codec/UInt.ts rename to packages/types/src/codec/UInt.ts index 43a2c394ae..dfb9706b50 100644 --- a/packages/api-codec/src/codec/UInt.ts +++ b/packages/types/src/codec/UInt.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Vector.spec.js b/packages/types/src/codec/Vector.spec.js similarity index 96% rename from packages/api-codec/src/codec/Vector.spec.js rename to packages/types/src/codec/Vector.spec.js index 2865e121aa..bbed107ace 100644 --- a/packages/api-codec/src/codec/Vector.spec.js +++ b/packages/types/src/codec/Vector.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/Vector.ts b/packages/types/src/codec/Vector.ts similarity index 97% rename from packages/api-codec/src/codec/Vector.ts rename to packages/types/src/codec/Vector.ts index 95a65afeda..b9f9208993 100644 --- a/packages/api-codec/src/codec/Vector.ts +++ b/packages/types/src/codec/Vector.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/createType.spec.js b/packages/types/src/codec/createType.spec.js similarity index 97% rename from packages/api-codec/src/codec/createType.spec.js rename to packages/types/src/codec/createType.spec.js index a9ccb28879..451674e23b 100644 --- a/packages/api-codec/src/codec/createType.spec.js +++ b/packages/types/src/codec/createType.spec.js @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/createType.ts b/packages/types/src/codec/createType.ts similarity index 97% rename from packages/api-codec/src/codec/createType.ts rename to packages/types/src/codec/createType.ts index b26619e723..b943ca6614 100644 --- a/packages/api-codec/src/codec/createType.ts +++ b/packages/types/src/codec/createType.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/codec/index.ts b/packages/types/src/codec/index.ts similarity index 67% rename from packages/api-codec/src/codec/index.ts rename to packages/types/src/codec/index.ts index 360ba6dd13..75d86f9f2d 100644 --- a/packages/api-codec/src/codec/index.ts +++ b/packages/types/src/codec/index.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. @@ -7,9 +7,15 @@ // expand with slight care (for instance, Length is really only used internally to // others, so there _should_ not be need for direct use) +// These are the base codec types, generally used for construction export { default as Base } from './Base'; export { default as Struct } from './Struct'; export { default as Tuple } from './Tuple'; export { default as Vector } from './Vector'; +// Convenience base classes, used as "anything of this type" bases +export { default as U8a } from './U8a'; +export { default as UInt } from './UInt'; + +// Type management helper functions export { default as createType } from './createType'; diff --git a/packages/api-codec/src/index.ts b/packages/types/src/index.ts similarity index 98% rename from packages/api-codec/src/index.ts rename to packages/types/src/index.ts index 39105119cc..9f19959f75 100644 --- a/packages/api-codec/src/index.ts +++ b/packages/types/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. diff --git a/packages/api-codec/src/types.d.ts b/packages/types/src/types.d.ts similarity index 73% rename from packages/api-codec/src/types.d.ts rename to packages/types/src/types.d.ts index 55555bc206..0fd303829c 100644 --- a/packages/api-codec/src/types.d.ts +++ b/packages/types/src/types.d.ts @@ -1,12 +1,11 @@ -// Copyright 2017-2018 @polkadot/api-codec authors & contributors +// Copyright 2017-2018 @polkadot/types authors & contributors // This software may be modified and distributed under the terms // of the ISC license. See the LICENSE file for details. import BN from 'bn.js'; import * as Classes from './index'; -import U8a from './codec/U8a'; -import UInt from './codec/UInt'; +import { U8a, UInt } from './codec'; export type AnyNumber = UInt | BN | Uint8Array | number | string; diff --git a/tsconfig.json b/tsconfig.json index 85802bdb9a..19270bd7bd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,6 @@ "baseUrl": ".", "paths": { - "@polkadot/api-codec/*": ["packages/api-codec/src/*"], "@polkadot/api-observable/*": ["packages/api-observable/src/*"], "@polkadot/api-provider/*": ["packages/api-provider/src/*"], "@polkadot/api-rx/*": ["packages/api-rx/src/*"], @@ -15,6 +14,7 @@ "@polkadot/params/*": ["packages/type-params/src/*"], "@polkadot/primitives/*": ["packages/type-primitives/src/*"], "@polkadot/storage/*": ["packages/type-storage/src/*"], + "@polkadot/types/*": ["packages/types/src/*"] }, "typeRoots": [ "./node_modules/@polkadot/ts",