Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg clean up #953

Merged
merged 7 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ jobs:

- name: Run Unit Tests
working-directory: ./packages/wallet-sdk
run: yarn test:unit
run: yarn test
4 changes: 2 additions & 2 deletions packages/wallet-sdk/compile-assets.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-var-requires */
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

const fs = require('fs');
Expand All @@ -8,7 +8,7 @@ const sass = require('sass');
const { optimize } = require('svgo');

const COPYRIGHT = `
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0
`;

Expand Down
13 changes: 4 additions & 9 deletions packages/wallet-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
"author": "Coinbase, Inc.",
"license": "Apache-2.0",
"scripts": {
"pretest:unit": "node compile-assets.js",
"test:unit": "jest",
"test:unit:coverage": "yarn test:unit && open coverage/lcov-report/index.html",
"test:karma": "yarn build && karma start",
"pretest": "node compile-assets.js",
"test": "jest",
"test:coverage": "yarn test:unit && open coverage/lcov-report/index.html",
"prebuild": "rm -rf ./build && node -p \"'export const LIB_VERSION = \\'' + require('./package.json').version + '\\';'\" > src/version.ts",
"build": "node compile-assets.js && tsc -p ./tsconfig.build.json && cp -a src/vendor-js dist",
"dev": "node compile-assets.js && cp -a src/vendor-js dist && tsc --watch",
Expand Down Expand Up @@ -61,24 +60,20 @@
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/preact": "^2.0.1",
"@types/bn.js": "^4.11.6",
"@types/eventemitter3": "^2.0.2",
"@types/jest": "^27.5.2",
"@types/node": "^14.18.54",
"@types/sha.js": "^2.4.1",
"babel-jest": "^27.5.1",
"core-js": "^3.31.1",
"jest": "^27.5.1",
"jest-chrome": "^0.7.2",
"jest-websocket-mock": "^2.4.0",
"prettier": "^2.8.8",
"regenerator-runtime": "^0.13.11",
"sass": "^1.64.1",
"svgo": "^2.8.0",
"ts-jest": "^27.1.5",
"ts-node": "^10.9.1",
"tslib": "^2.6.0",
"typescript": "^5.1.6",
"whatwg-fetch": "^3.5.0"
"typescript": "^5.1.6"
},
"engines": {
"node": ">= 10.0.0"
Expand Down
4 changes: 0 additions & 4 deletions packages/wallet-sdk/src/CoinbaseWalletSDK.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ describe('CoinbaseWalletSDK', () => {
});

afterAll(() => {
// @ts-expect-error mocked provider
window.coinbaseWalletExtension = undefined;
});

Expand Down Expand Up @@ -156,7 +155,6 @@ describe('CoinbaseWalletSDK', () => {
});

afterAll(() => {
// @ts-expect-error mocked provider
window.coinbaseWalletExtension = undefined;
});

Expand Down Expand Up @@ -192,9 +190,7 @@ describe('CoinbaseWalletSDK', () => {
});

beforeAll(() => {
// @ts-expect-error mocked provider
window.ethereum = undefined;
// @ts-expect-error mocked provider
window.top!.ethereum = mockCoinbaseBrowserProvider;
});

Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/CoinbaseWalletSDK.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { LogoType, walletLogo } from './assets/wallet-logo';
Expand Down Expand Up @@ -237,7 +237,7 @@
private get coinbaseBrowser(): CoinbaseWalletProvider | undefined {
try {
// Coinbase DApp browser does not inject into iframes so grab provider from top frame if it exists
const ethereum = (window as any).ethereum ?? (window as any).top?.ethereum;

Check warning on line 240 in packages/wallet-sdk/src/CoinbaseWalletSDK.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 240 in packages/wallet-sdk/src/CoinbaseWalletSDK.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 240 in packages/wallet-sdk/src/CoinbaseWalletSDK.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 240 in packages/wallet-sdk/src/CoinbaseWalletSDK.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type
if (!ethereum) {
return undefined;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

@import "../theme.scss";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import clsx from 'clsx';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

@import "../theme.scss";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import clsx from 'clsx';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/components/LinkFlow/LinkFlow.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { h, render } from 'preact';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/components/QRCode.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { FunctionComponent, h } from 'preact';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/components/Snackbar/Snackbar.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

.-cbwsdk-css-reset {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/components/Snackbar/Snackbar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import clsx from 'clsx';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/components/Spinner/Spinner.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

.-cbwsdk-css-reset {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/components/Spinner/Spinner.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { FunctionComponent, h } from 'preact';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

@import "../theme.scss";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import clsx from 'clsx';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/connection/ClientMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { IntNumber } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/connection/RxWebSocket.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { BehaviorSubject, empty, Observable, of, Subject, throwError } from 'rxjs';
Expand Down Expand Up @@ -106,7 +106,7 @@
public get incomingJSONData$(): Observable<T> {
return this.incomingData$.pipe(
flatMap((m) => {
let j: any;

Check warning on line 109 in packages/wallet-sdk/src/connection/RxWebSocket.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 109 in packages/wallet-sdk/src/connection/RxWebSocket.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type
try {
j = JSON.parse(m);
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/connection/ServerMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { IntNumber } from '../types';
Expand All @@ -21,7 +21,7 @@
error: string;
}

export function isServerMessageFail(msg: any): msg is ServerMessageFail {

Check warning on line 24 in packages/wallet-sdk/src/connection/ServerMessage.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 24 in packages/wallet-sdk/src/connection/ServerMessage.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type
return (
msg &&
msg.type === 'Fail' &&
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/connection/SessionConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

export interface SessionConfig {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/connection/WalletLinkConnection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { CoinbaseWalletSDK } from './CoinbaseWalletSDK';
Expand All @@ -15,7 +15,7 @@
/**
* For CoinbaseWalletSDK, window.ethereum is `CoinbaseWalletProvider`
*/
ethereum?: any;

Check warning on line 18 in packages/wallet-sdk/src/index.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 18 in packages/wallet-sdk/src/index.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type
coinbaseWalletExtension?: CoinbaseWalletProvider;

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/lib/ScopedLocalStorage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

export class ScopedLocalStorage {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/lib/cssReset.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

@namespace svg "http://www.w3.org/2000/svg";
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/lib/cssReset.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import css from './cssReset-css';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import BN from 'bn.js';
Expand Down Expand Up @@ -396,10 +396,10 @@
public send(request: JSONRPCRequest[]): JSONRPCResponse[];
public send(request: JSONRPCRequest, callback: Callback<JSONRPCResponse>): void;
public send(request: JSONRPCRequest[], callback: Callback<JSONRPCResponse[]>): void;
public send<T = any>(method: string, params?: any[] | any): Promise<T>;

Check warning on line 399 in packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 399 in packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 399 in packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 399 in packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 399 in packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 399 in packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type
public send(
requestOrMethod: JSONRPCRequest | JSONRPCRequest[] | string,
callbackOrParams?: Callback<JSONRPCResponse> | Callback<JSONRPCResponse[]> | any[] | any

Check warning on line 402 in packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type

Check warning on line 402 in packages/wallet-sdk/src/provider/CoinbaseWalletProvider.ts

View workflow job for this annotation

GitHub Actions / Lint Check

Unexpected any. Specify a different type
): JSONRPCResponse | JSONRPCResponse[] | void | Promise<any> {
// send<T>(method, params): Promise<T>
try {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/provider/FilterPolyfill.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { HexString, IntNumber } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/provider/JSONRPC.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

export enum JSONRPCMethod {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/provider/SolanaProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { PublicKey, SendOptions, Transaction } from '@solana/web3.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/provider/Web3Provider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { Callback } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/RelayMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

export enum RelayMessageType {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/Session.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { sha256 } from 'sha.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/WalletLinkRelay.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import bind from 'bind-decorator';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/Web3Method.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

export enum Web3Method {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/Web3Request.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { RelayMessage, RelayMessageType } from './RelayMessage';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/Web3RequestMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { RelayMessage, RelayMessageType } from './RelayMessage';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/Web3Response.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { AddressString, HexString, ProviderType } from '../types';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/Web3ResponseMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { RelayMessage, RelayMessageType } from './RelayMessage';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/aes256gcm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { hexStringToUint8Array, uint8ArrayToHex } from '../util';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/solana/SolanaWeb3Method.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

export enum SolanaWeb3Method {
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/solana/SolanaWeb3Request.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import { SendOptions, Signer, Transaction } from '@solana/web3.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/relay/solana/SolanaWeb3Response.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

export enum SolanaWeb3Response {
Expand Down
6 changes: 3 additions & 3 deletions packages/wallet-sdk/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

interface Tag<T extends string, RealType> {
Expand All @@ -8,8 +8,8 @@ interface Tag<T extends string, RealType> {

export type OpaqueType<T extends string, U> = U & Tag<T, U>;

export function OpaqueType<T extends Tag<any, any>>() {
return (value: T extends Tag<any, infer U> ? U : never): T => value as T;
export function OpaqueType<T extends Tag<string, unknown>>() {
return (value: T extends Tag<string, infer U> ? U : never): T => value as T;
}

export type HexString = OpaqueType<'HexString', string>;
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet-sdk/src/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2022 Coinbase, Inc. <https://www.coinbase.com/>
// Copyright (c) 2018-2023 Coinbase, Inc. <https://www.coinbase.com/>
// Licensed under the Apache License, version 2.0

import BN from 'bn.js';
Expand Down
3 changes: 1 addition & 2 deletions packages/wallet-sdk/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
"declaration": true,
"outDir": "./dist",
"target": "es2017",
// For Preact
"jsx": "react",
"jsxFactory": "h"
"jsxFactory": "h",
},
"include": ["src"],
"exclude": ["dist", "build", "**/*.test.*"]
Expand Down
9 changes: 5 additions & 4 deletions packages/wallet-sdk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src",
"rootDir": ".",
"target": "es2017",
"jsx": "react",
"jsxFactory": "h",
Expand All @@ -22,12 +22,13 @@
],
},
"include": [
"./src"
"./src",
"**/*.test.*",
"./jest.setup.ts"
],
"exclude": [
"dist",
"build",
"**/*.test.*",
"__tests__"
]
}

Loading
Loading