Skip to content

Commit

Permalink
chore: run eslint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed Dec 5, 2023
1 parent 7557d13 commit a1ef5df
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion packages/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"clean": "rimraf public",
"lint": "npm run lint:eslint && npm run lint:misc --check",
"lint:eslint": "eslint . --cache --ext js,ts",
"lint:fix": "npm run lint:eslint --fix && npm run lint:misc --write",
"lint:fix": "npm run lint:eslint -- --fix && npm run lint:misc -- --write",
"lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path .gitignore",
"start": "cross-env GATSBY_TELEMETRY_DISABLED=1 gatsby develop",
"test": "echo TODO"
Expand Down
3 changes: 2 additions & 1 deletion packages/snap/src/authorizer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable jsdoc/require-jsdoc */
import { XmtpEnv } from '@xmtp/xmtp-js';
import type { XmtpEnv } from '@xmtp/xmtp-js';

import { AUTHORIZATION_EXPIRY_MS } from './config';
import storage from './storage';

Expand Down
17 changes: 7 additions & 10 deletions packages/snap/src/handlers.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
/* eslint-disable jsdoc/require-jsdoc */
import {
InMemoryKeystore,
Keystore,
PrivateKeyBundleV1,
keystoreApiDefs,
} from '@xmtp/xmtp-js';
import { fetcher, keystore as keystoreProto } from '@xmtp/proto';
import { Reader, Writer } from 'protobufjs/minimal';
import {
import type {
InitKeystoreRequest as InitKeystoreRequestType,
InitKeystoreResponse as InitKeystoreResponseType,
GetKeystoreStatusRequest as GetKeystoreStatusRequestType,
GetKeystoreStatusResponse as GetKeystoreStatusResponseType,
// eslint-disable-next-line import/extensions
} from '@xmtp/proto/ts/dist/types/keystore_api/v1/keystore.pb';
import { getKeys, getPersistence, setKeys } from './utils';
import type { InMemoryKeystore, Keystore } from '@xmtp/xmtp-js';
import { PrivateKeyBundleV1, keystoreApiDefs } from '@xmtp/xmtp-js';
import type { Reader, Writer } from 'protobufjs/minimal';

import type { SnapMeta } from '.';
import { KeyNotFoundError } from './errors';
import { SnapMeta } from '.';
import { getKeys, getPersistence, setKeys } from './utils';

const {
GetKeystoreStatusResponse_KeystoreStatus: KeystoreStatus,
Expand Down
1 change: 1 addition & 0 deletions packages/snap/src/snapPersistence.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Persistence } from '@xmtp/xmtp-js';

import storage from './storage';

const ENCODING = 'binary';
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/storage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Json } from '@metamask/snaps-types';
import type { Json } from '@metamask/snaps-types';
import { Mutex } from 'async-mutex';

export type StorageProvider = {
Expand Down
3 changes: 2 additions & 1 deletion packages/snap/src/testHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable jsdoc/require-jsdoc */
import { Wallet } from 'ethers';
import { SnapMeta } from '.';

import type { SnapMeta } from '.';

export function newWallet() {
return Wallet.createRandom();
Expand Down
15 changes: 9 additions & 6 deletions packages/snap/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* eslint-disable jsdoc/require-jsdoc */
import { privateKey, fetcher } from '@xmtp/proto';
import {
InMemoryKeystore,
Persistence,
PrefixedPersistence,
PrivateKeyBundleV1,
} from '@xmtp/xmtp-js';
import { privateKey, fetcher } from '@xmtp/proto';
import type { XmtpEnv } from '@xmtp/xmtp-js';
import SnapPersistence from './snapPersistence';
import { type SnapRequest, KeystoreHandler } from './handlers';
import type { XmtpEnv, Persistence } from '@xmtp/xmtp-js';

import { KeyNotFoundError } from './errors';
import { type SnapRequest, KeystoreHandler } from './handlers';
import SnapPersistence from './snapPersistence';

const { b64Encode } = fetcher;

Expand All @@ -32,7 +32,10 @@ export async function getKeys(persistence: Persistence) {
}

// Store the keys in the provided persistence
export function setKeys(persistence: Persistence, keys: PrivateKeyBundleV1) {
export async function setKeys(
persistence: Persistence,
keys: PrivateKeyBundleV1,
) {
return persistence.setItem(`keys`, keys.encode());
}

Expand Down

0 comments on commit a1ef5df

Please sign in to comment.