Skip to content

Commit

Permalink
feat!: rename npm org from enjin to enjin-io (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
justraman authored Dec 19, 2024
1 parent c2ca18a commit 15fa159
Show file tree
Hide file tree
Showing 32 changed files with 50 additions and 49 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ jobs:
fix
feat
chore
refactor
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"packages/*"
],
"scripts": {
"build:snap": "yarn workspace @enjin/snap build",
"build:adapter": "yarn workspace @enjin/metamask-enjin-adapter build",
"start:snap": "yarn workspace @enjin/snap serve",
"build:snap": "yarn workspace @enjin-io/snap build",
"build:adapter": "yarn workspace @enjin-io/metamask-enjin-adapter build",
"start:snap": "yarn workspace @enjin-io/snap serve",
"start:example": "yarn workspace example start",
"predemo": "yarn run build:snap && yarn run build:adapter",
"build": "yarn workspaces foreach -Avpt run build",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@enjin/metamask-enjin-adapter",
"name": "@enjin-io/metamask-enjin-adapter",
"version": "0.1.0",
"main": "./build/index.js",
"module": "./build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter/src/extension/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Injected, InjectedAccount, InjectedWindow } from '@polkadot/extension-inject/types';
import type { SignerPayloadJSON, SignerPayloadRaw, SignerResult } from '@polkadot/types/types';
import type { HexString } from '@polkadot/util/types';
import type { SnapConfig } from '@enjin/metamask-enjin-types';
import type { SnapConfig } from '@enjin-io/metamask-enjin-types';
import type { SnapInstallationParamNames } from '../index';
import { enablePolkadotSnap } from '../index';
import { hasMetaMask, isMetamaskSnapsSupported } from '../utils';
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import '@polkadot/types-augment';
import type { SnapConfig } from '@enjin/metamask-enjin-types';
import type { SnapConfig } from '@enjin-io/metamask-enjin-types';
import { MetamaskPolkadotSnap } from './snap';
import { hasMetaMask, isMetamaskSnapsSupported, isPolkadotSnapInstalled } from './utils';

const defaultSnapOrigin = 'npm:@enjin/snap';
const defaultSnapOrigin = 'npm:@enjin-io/snap';

export type SnapInstallationParamNames = string;

Expand Down
2 changes: 1 addition & 1 deletion packages/adapter/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
SnapConfig,
Transaction,
TxPayload
} from '@enjin/metamask-enjin-types';
} from '@enjin-io/metamask-enjin-types';
import type { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
import type { MetamaskPolkadotSnap } from './snap';

Expand Down
2 changes: 1 addition & 1 deletion packages/adapter/src/snap.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SnapConfig } from '@enjin/metamask-enjin-types';
import type { SnapConfig } from '@enjin-io/metamask-enjin-types';
import {
getAddress,
getAllTransactions,
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
SnapRpcMethodRequest,
Transaction,
TxPayload
} from '@enjin/metamask-enjin-types';
} from '@enjin-io/metamask-enjin-types';
import type { InjectedExtension } from '@polkadot/extension-inject/types';
import type { SignerPayloadRaw } from '@polkadot/types/types/extrinsic';
import type { SignerPayloadJSON } from '@polkadot/types/types';
Expand Down
4 changes: 2 additions & 2 deletions packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@enjin/metamask-enjin-adapter": "workspace:^",
"@enjin/metamask-enjin-types": "workspace:^",
"@enjin-io/metamask-enjin-adapter": "workspace:^",
"@enjin-io/metamask-enjin-types": "workspace:^",
"@material-ui/core": "4.12.4",
"@material-ui/icons": "4.11.3",
"@material-ui/lab": "4.0.0-alpha.61",
Expand Down
4 changes: 2 additions & 2 deletions packages/example/src/@types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SnapConfig } from '@enjin/metamask-enjin-types';
import type { SnapConfig } from '@enjin-io/metamask-enjin-types';

declare module '@enjin/metamask-enjin-adapter' {
declare module '@enjin-io/metamask-enjin-adapter' {
export function injectMetamaskPolkadotSnapProvider(
network: 'enjin-relaychain' | 'enjin-matrixchain' | 'canary-relaychain' | 'canary-matrixchain',
config?: SnapConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Box, Card, CardContent, CardHeader, Divider, Grid, Typography } from '@material-ui/core';
import type { BlockInfo } from '@enjin/metamask-enjin-types';
import type { BlockInfo } from '@enjin-io/metamask-enjin-types';

export const LatestBlock = (props: { block: BlockInfo }): React.JSX.Element => {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TableRow
} from '@material-ui/core';
import { formatBalance } from '@polkadot/util';
import type { Transaction } from '@enjin/metamask-enjin-types';
import type { Transaction } from '@enjin-io/metamask-enjin-types';
import { shortAddress } from '../../services/format';

export interface TransactionTableProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/components/Transfer/Transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
TextField
} from '@material-ui/core';
import { Alert } from '@material-ui/lab';
import type { BlockInfo } from '@enjin/metamask-enjin-types';
import type { BlockInfo } from '@enjin-io/metamask-enjin-types';
import type { ApiPromise } from '@polkadot/api';
import { getCurrency } from '../../services/format';
import { MetaMaskContext } from '../../context/metamask';
Expand Down
4 changes: 2 additions & 2 deletions packages/example/src/containers/Dashboard/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import type {
SnapNetworks,
Transaction,
SupportedSnapNetworks
} from '@enjin/metamask-enjin-types';
import type { MetamaskSnapApi } from '@enjin/metamask-enjin-adapter/src/types';
} from '@enjin-io/metamask-enjin-types';
import type { MetamaskSnapApi } from '@enjin-io/metamask-enjin-adapter/src/types';
import { ApiPromise, WsProvider } from '@polkadot/api';
import { Transfer } from '../../components/Transfer/Transfer';
import { SignMessage } from '../../components/SignMessage/SignMessage';
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/context/metamask.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Dispatch, PropsWithChildren, Reducer } from 'react';
import React, { createContext, useReducer } from 'react';
import type { MetamaskPolkadotSnap } from '@enjin/metamask-enjin-adapter/build/snap';
import type { MetamaskPolkadotSnap } from '@enjin-io/metamask-enjin-adapter/build/snap';
import { hasMetaMask } from '../services/metamask';

interface IPolkadotSnap {
Expand Down
6 changes: 3 additions & 3 deletions packages/example/src/services/metamask.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { web3EnablePromise } from '@polkadot/extension-dapp';
import type { InjectedMetamaskExtension } from '@enjin/metamask-enjin-adapter/src/types';
import type { InjectedMetamaskExtension } from '@enjin-io/metamask-enjin-adapter/src/types';
import type { InjectedExtension } from '@polkadot/extension-inject/types';
import { enablePolkadotSnap } from '@enjin/metamask-enjin-adapter';
import type { MetamaskPolkadotSnap } from '@enjin/metamask-enjin-adapter/build/snap';
import { enablePolkadotSnap } from '@enjin-io/metamask-enjin-adapter';
import type { MetamaskPolkadotSnap } from '@enjin-io/metamask-enjin-adapter/build/snap';

export function hasMetaMask(): boolean {
if (!window.ethereum) {
Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/utils/generateTransfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ApiPromise } from '@polkadot/api';
import type { SubmittableExtrinsic } from '@polkadot/api/types';
import type { SignerPayloadJSON } from '@polkadot/types/types/extrinsic';
import type { GenericSignerPayload } from '@polkadot/types/extrinsic/SignerPayload';
import type { BlockInfo } from '@enjin/metamask-enjin-types';
import type { BlockInfo } from '@enjin-io/metamask-enjin-types';

interface TxPayload {
payload: SignerPayloadJSON;
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@enjin/snap",
"name": "@enjin-io/snap",
"version": "0.1.0",
"description": "MetaMask snap for interacting with Enjin dApps",
"main": "dist/bundle.js",
Expand Down Expand Up @@ -61,7 +61,7 @@
}
},
"devDependencies": {
"@enjin/metamask-enjin-types": "workspace:^",
"@enjin-io/metamask-enjin-types": "workspace:^",
"@metamask/snaps-cli": "6.5.2",
"@types/big.js": "6.2.2",
"@types/chai": "4.3.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"url": "git+https://github.com/enjin/metamask-snap-enjin.git"
},
"source": {
"shasum": "UMJ8srx5PyK5TwsrCIVvRCcHH2zoiBI+6cvIyOJUlTc=",
"shasum": "aeoIrgQL2rdsXR6G7wJVF8c2UQiAnNnD/HWEmMjj1CM=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
"iconPath": "images/enjin.svg",
"packageName": "@enjin/snap",
"packageName": "@enjin-io/snap",
"registry": "https://registry.npmjs.org/"
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/configuration/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SnapConfig } from '@enjin/metamask-enjin-types';
import type { SnapConfig } from '@enjin-io/metamask-enjin-types';
import { getMetamaskState } from '../rpc/getMetamaskState';
import {
defaultConfiguration,
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/configuration/predefined.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SnapConfig } from '@enjin/metamask-enjin-types';
import type { SnapConfig } from '@enjin-io/metamask-enjin-types';

export const enjinRelayConfiguration: SnapConfig = {
addressPrefix: 2135,
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/polkadot/account.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { KeyringPair } from '@polkadot/keyring/types';
import { Keyring } from '@polkadot/keyring';
import { stringToU8a } from '@polkadot/util';
import type { SnapNetworks } from '@enjin/metamask-enjin-types';
import type { SnapNetworks } from '@enjin-io/metamask-enjin-types';
import { getConfiguration } from '../configuration';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/polkadot/tx.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Transaction } from '@enjin/metamask-enjin-types';
import type { Transaction } from '@enjin-io/metamask-enjin-types';
import { getMetamaskState } from '../rpc/getMetamaskState';

export async function saveTxToState(tx: Transaction): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/rpc/configure.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import deepmerge from 'deepmerge';
import type { SnapConfig } from '@enjin/metamask-enjin-types';
import type { SnapConfig } from '@enjin-io/metamask-enjin-types';
import { getDefaultConfiguration } from '../configuration';
import { getMetamaskState } from './getMetamaskState';

Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/rpc/send.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ApiPromise } from '@polkadot/api';
import type { Transaction, TxPayload } from '@enjin/metamask-enjin-types';
import type { Transaction, TxPayload } from '@enjin-io/metamask-enjin-types';
import { saveTxToState } from '../polkadot/tx';
import { getAddress } from './getAddress';

Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/rpc/substrate/getBlock.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ApiPromise } from '@polkadot/api';
import type { BlockId, BlockInfo } from '@enjin/metamask-enjin-types';
import type { BlockId, BlockInfo } from '@enjin-io/metamask-enjin-types';
import type { BlockHash } from '@polkadot/types/interfaces';

async function _getBlock(blockHash: BlockHash | string, api: ApiPromise): Promise<BlockInfo> {
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/rpc/substrate/getTransactions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Transaction } from '@enjin/metamask-enjin-types';
import type { Transaction } from '@enjin-io/metamask-enjin-types';
import type { MetamaskState } from '../../interfaces';

export async function getTransactions(): Promise<Transaction[]> {
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/util/validation.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BlockId } from '@enjin/metamask-enjin-types';
import type { BlockId } from '@enjin-io/metamask-enjin-types';
import type { SignerPayloadRaw } from '@polkadot/types/types';
import type { Describe, Infer } from 'superstruct';
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/test/unit/configuration/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chai, { expect } from 'chai';
import sinonChai from 'sinon-chai';
import type { SnapConfig } from '@enjin/metamask-enjin-types';
import type { SnapConfig } from '@enjin-io/metamask-enjin-types';
import { getConfiguration, getDefaultConfiguration } from '../../../src/configuration';
import {
defaultConfiguration,
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/test/unit/rpc/configure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import sinonChai from 'sinon-chai';
import { enjinMatrixConfiguration, canaryRelayConfiguration } from '../../../src/configuration/predefined';
import { configure } from '../../../src/rpc/configure';
import { EmptyMetamaskState } from '../../../src/interfaces';
import { SnapConfig } from '@enjin/metamask-enjin-types';
import { SnapConfig } from '@enjin-io/metamask-enjin-types';
import { getWalletMock } from '../wallet.mock';

chai.use(sinonChai);
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@enjin/metamask-enjin-types",
"name": "@enjin-io/metamask-enjin-types",
"version": "0.1.0",
"types": "./index.d.ts",
"author": "Enjinb <contact@enjin.io>",
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3024,9 +3024,9 @@ __metadata:
languageName: node
linkType: hard

"@enjin/metamask-enjin-adapter@workspace:^, @enjin/metamask-enjin-adapter@workspace:packages/adapter":
"@enjin-io/metamask-enjin-adapter@workspace:^, @enjin-io/metamask-enjin-adapter@workspace:packages/adapter":
version: 0.0.0-use.local
resolution: "@enjin/metamask-enjin-adapter@workspace:packages/adapter"
resolution: "@enjin-io/metamask-enjin-adapter@workspace:packages/adapter"
dependencies:
"@polkadot/api": "npm:12.4.2"
"@polkadot/extension-inject": "npm:0.52.3"
Expand All @@ -3039,19 +3039,19 @@ __metadata:
languageName: unknown
linkType: soft

"@enjin/metamask-enjin-types@workspace:^, @enjin/metamask-enjin-types@workspace:packages/types":
"@enjin-io/metamask-enjin-types@workspace:^, @enjin-io/metamask-enjin-types@workspace:packages/types":
version: 0.0.0-use.local
resolution: "@enjin/metamask-enjin-types@workspace:packages/types"
resolution: "@enjin-io/metamask-enjin-types@workspace:packages/types"
dependencies:
"@polkadot/api": "npm:12.4.2"
languageName: unknown
linkType: soft

"@enjin/snap@workspace:packages/snap":
"@enjin-io/snap@workspace:packages/snap":
version: 0.0.0-use.local
resolution: "@enjin/snap@workspace:packages/snap"
resolution: "@enjin-io/snap@workspace:packages/snap"
dependencies:
"@enjin/metamask-enjin-types": "workspace:^"
"@enjin-io/metamask-enjin-types": "workspace:^"
"@metamask/key-tree": "npm:9.1.2"
"@metamask/snaps-cli": "npm:6.5.2"
"@metamask/snaps-sdk": "npm:6.10.0"
Expand Down Expand Up @@ -10912,8 +10912,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "example@workspace:packages/example"
dependencies:
"@enjin/metamask-enjin-adapter": "workspace:^"
"@enjin/metamask-enjin-types": "workspace:^"
"@enjin-io/metamask-enjin-adapter": "workspace:^"
"@enjin-io/metamask-enjin-types": "workspace:^"
"@material-ui/core": "npm:4.12.4"
"@material-ui/icons": "npm:4.11.3"
"@material-ui/lab": "npm:4.0.0-alpha.61"
Expand Down

0 comments on commit 15fa159

Please sign in to comment.