Skip to content

Commit

Permalink
Adjust object index typings (#1265)
Browse files Browse the repository at this point in the history
* Adjust object index typings

* CHANGELOG

* Bump common

* Bumpo ui

* 0.46.5

* Bump util
  • Loading branch information
jacogr authored Jun 12, 2023
1 parent 50b61b2 commit 727f14f
Show file tree
Hide file tree
Showing 30 changed files with 524 additions and 502 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# CHANGELOG

## 0.46.5 Jun 12, 2023

- **Important** Not published to the stores, aligns with latest released packages.

Changes:

- Adjust object index access for stricter tsconfig settings
- Upgrade to `@polkadot/api` 10.9.1
- Bump to `@polkadot/util` 12.3.2


## 0.46.4 Jun 5, 2023

- **Important** Not published to the stores, aligns with latest released packages.
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"sideEffects": false,
"type": "module",
"version": "0.46.4",
"version": "0.46.5",
"versions": {
"git": "0.46.4",
"npm": "0.46.4"
Expand All @@ -40,19 +40,19 @@
"watch": "cd packages/extension && yarn polkadot-exec-webpack --config webpack.watch.cjs --mode development --watch"
},
"devDependencies": {
"@polkadot/dev": "^0.75.16",
"@polkadot/dev": "^0.75.19",
"@types/node": "^20.2.5",
"i18next-scanner": "^4.2.0",
"sinon-chrome": "^3.0.1"
},
"resolutions": {
"@polkadot/api": "^10.8.1",
"@polkadot/keyring": "^12.2.2",
"@polkadot/networks": "^12.2.2",
"@polkadot/types": "^10.8.1",
"@polkadot/util": "^12.2.2",
"@polkadot/util-crypto": "^12.2.2",
"@polkadot/x-fetch": "^12.2.2",
"@polkadot/api": "^10.9.1",
"@polkadot/keyring": "^12.3.2",
"@polkadot/networks": "^12.3.2",
"@polkadot/types": "^10.9.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"@polkadot/x-fetch": "^12.3.2",
"safe-buffer": "^5.2.1",
"typescript": "^5.0.3"
}
Expand Down
30 changes: 15 additions & 15 deletions packages/extension-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "0.46.4",
"version": "0.46.5",
"main": "index.js",
"dependencies": {
"@polkadot/api": "^10.8.1",
"@polkadot/extension-chains": "0.46.4",
"@polkadot/extension-dapp": "0.46.4",
"@polkadot/extension-inject": "0.46.4",
"@polkadot/keyring": "^12.2.2",
"@polkadot/networks": "^12.2.2",
"@polkadot/phishing": "^0.21.4",
"@polkadot/rpc-provider": "^10.8.1",
"@polkadot/types": "^10.8.1",
"@polkadot/ui-keyring": "^3.4.2",
"@polkadot/ui-settings": "^3.4.2",
"@polkadot/util": "^12.2.2",
"@polkadot/util-crypto": "^12.2.2",
"@polkadot/api": "^10.9.1",
"@polkadot/extension-chains": "0.46.5",
"@polkadot/extension-dapp": "0.46.5",
"@polkadot/extension-inject": "0.46.5",
"@polkadot/keyring": "^12.3.2",
"@polkadot/networks": "^12.3.2",
"@polkadot/phishing": "^0.21.5",
"@polkadot/rpc-provider": "^10.9.1",
"@polkadot/types": "^10.9.1",
"@polkadot/ui-keyring": "^3.5.1",
"@polkadot/ui-settings": "^3.5.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"eventemitter3": "^5.0.1",
"rxjs": "^7.8.1",
"tslib": "^2.5.3"
},
"devDependencies": {
"@polkadot/extension-mocks": "0.46.4"
"@polkadot/extension-mocks": "0.46.5"
}
}
24 changes: 7 additions & 17 deletions packages/extension-base/src/background/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ export type SeedLengths = 12 | 24;

export interface AccountJson extends KeyringPair$Meta {
address: string;
genesisHash?: string | null;
isExternal?: boolean;
isHardware?: boolean;
isHidden?: boolean;
isDefaultAuthSelected?: boolean
name?: string;
parentAddress?: string;
suri?: string;
type?: KeypairType;
whenCreated?: number;
}

export type AccountWithChildren = AccountJson & {
Expand Down Expand Up @@ -194,13 +184,13 @@ export type RequestMetadataSubscribe = null;

export interface RequestAccountCreateExternal {
address: string;
genesisHash?: string | null;
genesisHash?: HexString | null;
name: string;
}

export interface RequestAccountCreateSuri {
name: string;
genesisHash?: string | null;
genesisHash?: HexString | null;
password: string;
suri: string;
type?: KeypairType;
Expand All @@ -210,7 +200,7 @@ export interface RequestAccountCreateHardware {
accountIndex: number;
address: string;
addressOffset: number;
genesisHash: string;
genesisHash: HexString;
hardwareType: string;
name: string;
}
Expand All @@ -223,7 +213,7 @@ export interface RequestAccountChangePassword {

export interface RequestAccountEdit {
address: string;
genesisHash?: string | null;
genesisHash?: HexString | null;
name: string;
}

Expand All @@ -238,7 +228,7 @@ export interface RequestAccountShow {

export interface RequestAccountTie {
address: string;
genesisHash: string | null;
genesisHash: HexString | null;
}

export interface RequestAccountValidate {
Expand All @@ -248,7 +238,7 @@ export interface RequestAccountValidate {

export interface RequestDeriveCreate {
name: string;
genesisHash?: string | null;
genesisHash?: HexString | null;
suri: string;
parentAddress: string;
parentPassword: string;
Expand Down Expand Up @@ -429,7 +419,7 @@ export type AllowedPath = typeof ALLOWED_PATH[number];
export interface ResponseJsonGetAccountInfo {
address: string;
name: string;
genesisHash: string;
genesisHash: HexString;
type: KeypairType;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/extension-base/src/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// SPDX-License-Identifier: Apache-2.0

// this _must_ be changed for each extension
export const EXTENSION_PREFIX = process.env.EXTENSION_PREFIX || '';
export const EXTENSION_PREFIX = process.env['EXTENSION_PREFIX'] || '';

if (!EXTENSION_PREFIX && !process.env.PORT_PREFIX) {
if (!EXTENSION_PREFIX && !process.env['PORT_PREFIX']) {
throw new Error('CRITICAL: The extension does not define an own EXTENSION_PREFIX environment variable as part of the build, this is required to ensure that messages are not shared between extensions. Failure to do so will yield messages sent to multiple extensions.');
}

const PORT_PREFIX = `${EXTENSION_PREFIX || 'unknown'}-${process.env.PORT_PREFIX || 'unknown'}`;
const PORT_PREFIX = `${EXTENSION_PREFIX || 'unknown'}-${process.env['PORT_PREFIX'] || 'unknown'}`;

export const PORT_CONTENT = `${PORT_PREFIX}-content`;
export const PORT_EXTENSION = `${PORT_PREFIX}-extension`;
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-base/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/extension-base', path: 'auto', type: 'auto', version: '0.46.4' };
export const packageInfo = { name: '@polkadot/extension-base', path: 'auto', type: 'auto', version: '0.46.5' };
10 changes: 5 additions & 5 deletions packages/extension-chains/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "0.46.4",
"version": "0.46.5",
"main": "index.js",
"dependencies": {
"@polkadot/extension-inject": "0.46.4",
"@polkadot/networks": "^12.2.2",
"@polkadot/util": "^12.2.2",
"@polkadot/util-crypto": "^12.2.2",
"@polkadot/extension-inject": "0.46.5",
"@polkadot/networks": "^12.3.2",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"tslib": "^2.5.3"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-chains/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/extension-chains', path: 'auto', type: 'auto', version: '0.46.4' };
export const packageInfo = { name: '@polkadot/extension-chains', path: 'auto', type: 'auto', version: '0.46.5' };
8 changes: 4 additions & 4 deletions packages/extension-compat-metamask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "0.46.4",
"version": "0.46.5",
"main": "index.js",
"dependencies": {
"@metamask/detect-provider": "^2.0.0",
"@polkadot/extension-inject": "0.46.4",
"@polkadot/types": "^10.8.1",
"@polkadot/util": "^12.2.2",
"@polkadot/extension-inject": "0.46.5",
"@polkadot/types": "^10.9.1",
"@polkadot/util": "^12.3.2",
"tslib": "^2.5.3",
"web3": "^1.10.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-compat-metamask/src/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function transformAccounts (accounts: string[]): InjectedAccount[] {
// add a compat interface of metaMaskSource to window.injectedWeb3
function injectMetaMaskWeb3 (win: Web3Window): void {
// decorate the compat interface
win.injectedWeb3.Web3Source = {
win.injectedWeb3['Web3Source'] = {
enable: async (): Promise<Injected> => {
const providerRaw = await detectEthereumProvider({ mustBeMetaMask: true });
const provider = isMetaMaskProvider(providerRaw);
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-compat-metamask/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/extension-compat-metamask', path: 'auto', type: 'auto', version: '0.46.4' };
export const packageInfo = { name: '@polkadot/extension-compat-metamask', path: 'auto', type: 'auto', version: '0.46.5' };
8 changes: 4 additions & 4 deletions packages/extension-dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"./detectPackage.cjs"
],
"type": "module",
"version": "0.46.4",
"version": "0.46.5",
"main": "index.js",
"dependencies": {
"@polkadot/extension-inject": "0.46.4",
"@polkadot/util": "^12.2.2",
"@polkadot/util-crypto": "^12.2.2",
"@polkadot/extension-inject": "0.46.5",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"tslib": "^2.5.3"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-dapp/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/extension-dapp', path: 'auto', type: 'auto', version: '0.46.4' };
export const packageInfo = { name: '@polkadot/extension-dapp', path: 'auto', type: 'auto', version: '0.46.5' };
14 changes: 7 additions & 7 deletions packages/extension-inject/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
},
"sideEffects": true,
"type": "module",
"version": "0.46.4",
"version": "0.46.5",
"main": "index.js",
"dependencies": {
"@polkadot/api": "^10.8.1",
"@polkadot/rpc-provider": "^10.8.1",
"@polkadot/types": "^10.8.1",
"@polkadot/util": "^12.2.2",
"@polkadot/util-crypto": "^12.2.2",
"@polkadot/x-global": "^12.2.2",
"@polkadot/api": "^10.9.1",
"@polkadot/rpc-provider": "^10.9.1",
"@polkadot/types": "^10.9.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"@polkadot/x-global": "^12.3.2",
"tslib": "^2.5.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-inject/src/packageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

// Do not edit, auto-generated by @polkadot/dev

export const packageInfo = { name: '@polkadot/extension-inject', path: 'auto', type: 'auto', version: '0.46.4' };
export const packageInfo = { name: '@polkadot/extension-inject', path: 'auto', type: 'auto', version: '0.46.5' };
3 changes: 2 additions & 1 deletion packages/extension-inject/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import type { Signer as InjectedSigner } from '@polkadot/api/types';
import type { ProviderInterface } from '@polkadot/rpc-provider/types';
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
import type { HexString } from '@polkadot/util/types';
import type { KeypairType } from '@polkadot/util-crypto/types';

// eslint-disable-next-line no-undef
Expand Down Expand Up @@ -52,7 +53,7 @@ export interface ProviderMeta {

export interface MetadataDefBase {
chain: string;
genesisHash: string;
genesisHash: HexString;
icon: string;
ss58Format: number;
chainType?: 'substrate' | 'ethereum'
Expand Down
2 changes: 1 addition & 1 deletion packages/extension-mocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"sideEffects": false,
"type": "module",
"version": "0.46.4",
"version": "0.46.5",
"main": "index.js",
"dependencies": {
"sinon-chrome": "^3.0.1",
Expand Down
38 changes: 19 additions & 19 deletions packages/extension-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@
},
"sideEffects": true,
"type": "module",
"version": "0.46.4",
"version": "0.46.5",
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.4.0",
"@fortawesome/free-brands-svg-icons": "^6.4.0",
"@fortawesome/free-regular-svg-icons": "^6.4.0",
"@fortawesome/free-solid-svg-icons": "^6.4.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@polkadot/api": "^10.8.1",
"@polkadot/extension-base": "0.46.4",
"@polkadot/extension-chains": "0.46.4",
"@polkadot/extension-dapp": "0.46.4",
"@polkadot/extension-inject": "0.46.4",
"@polkadot/hw-ledger": "^12.2.2",
"@polkadot/keyring": "^12.2.2",
"@polkadot/networks": "^12.2.2",
"@polkadot/react-identicon": "^3.4.2",
"@polkadot/react-qr": "^3.4.2",
"@polkadot/types": "^10.8.1",
"@polkadot/types-augment": "^10.8.1",
"@polkadot/ui-keyring": "^3.4.2",
"@polkadot/ui-settings": "^3.4.2",
"@polkadot/util": "^12.2.2",
"@polkadot/util-crypto": "^12.2.2",
"@polkadot/api": "^10.9.1",
"@polkadot/extension-base": "0.46.5",
"@polkadot/extension-chains": "0.46.5",
"@polkadot/extension-dapp": "0.46.5",
"@polkadot/extension-inject": "0.46.5",
"@polkadot/hw-ledger": "^12.3.2",
"@polkadot/keyring": "^12.3.2",
"@polkadot/networks": "^12.3.2",
"@polkadot/react-identicon": "^3.5.1",
"@polkadot/react-qr": "^3.5.1",
"@polkadot/types": "^10.9.1",
"@polkadot/types-augment": "^10.9.1",
"@polkadot/ui-keyring": "^3.5.1",
"@polkadot/ui-settings": "^3.5.1",
"@polkadot/util": "^12.3.2",
"@polkadot/util-crypto": "^12.3.2",
"file-saver": "^2.0.5",
"i18next": "^22.5.0",
"i18next": "^22.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-dropzone": "^11.7.1",
Expand All @@ -51,7 +51,7 @@
"tslib": "^2.5.3"
},
"devDependencies": {
"@polkadot/extension-mocks": "0.46.4",
"@polkadot/extension-mocks": "0.46.5",
"@types/enzyme": "^3.10.13",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/file-saver": "^2.0.5",
Expand Down
Loading

0 comments on commit 727f14f

Please sign in to comment.