Skip to content

Commit

Permalink
Merge pull request #178 from argentlabs/fix/build-errors
Browse files Browse the repository at this point in the history
fix: ts build errors
  • Loading branch information
bluecco authored Jan 6, 2025
2 parents 862cc11 + b5fbeb7 commit a717f32
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 42 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"plugins": ["@typescript-eslint"],
"rules": {
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-unused-vars": [
Expand Down
14 changes: 7 additions & 7 deletions src/connectors/argentMobile/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { type AccountChangeEventHandler } from "@starknet-io/get-starknet-core"
import {
Permission,
RequestFnCall,
RpcMessage,
RpcTypeToMessageMap,
type RequestFnCall,
type RpcMessage,
type RpcTypeToMessageMap,
type StarknetWindowObject,
} from "@starknet-io/types-js"
import {
Account,
AccountInterface,
ProviderInterface,
ProviderOptions,
constants,
ProviderInterface,
type ProviderOptions,
} from "starknet"
import {
ConnectorNotConnectedError,
Expand All @@ -23,12 +23,12 @@ import { removeStarknetLastConnectedWallet } from "../../helpers/lastConnected"
import { getRandomPublicRPCNode } from "../../helpers/publicRcpNodes"
import { resetWalletConnect } from "../../helpers/resetWalletConnect"
import {
ConnectArgs,
Connector,
type ConnectArgs,
type ConnectorData,
type ConnectorIcons,
} from "../connector"
import { InjectedConnector, InjectedConnectorOptions } from "../injected"
import { InjectedConnector, type InjectedConnectorOptions } from "../injected"
import { DEFAULT_ARGENT_MOBILE_ICON, DEFAULT_PROJECT_ID } from "./constants"
import { isInArgentMobileAppBrowser } from "./helpers"
import type { StarknetAdapter } from "./modal/starknet/adapter"
Expand Down
7 changes: 3 additions & 4 deletions src/connectors/argentMobile/modal/adapter.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { EventEmitter } from "events"

import type { JsonRpcProvider } from "@walletconnect/jsonrpc-provider"
import type SignClient from "@walletconnect/sign-client"
import type { SignerConnectionClientOpts } from "@walletconnect/signer-connection"
import {
SIGNER_EVENTS,
SignerConnection,
} from "@walletconnect/signer-connection"
import type { SignerConnectionClientOpts } from "@walletconnect/signer-connection"
import type { ProposalTypes, SessionTypes } from "@walletconnect/types"
import {
getAccountsFromNamespaces,
getChainsFromNamespaces,
} from "@walletconnect/utils"
import { EventEmitter } from "events"

import type { EthereumRpcConfig } from "./starknet/adapter"
import { ProviderInterface } from "starknet"
import type { EthereumRpcConfig } from "./starknet/adapter"

export interface NamespaceAdapterOptions {
client: SignClient
Expand Down
2 changes: 1 addition & 1 deletion src/connectors/argentMobile/modal/starknet/adapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import type {
AddInvokeTransactionParameters,
RequestFn,
TypedData,
Expand Down
2 changes: 1 addition & 1 deletion src/connectors/argentMobile/modal/starknet/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
Signature,
SignerInterface,
} from "starknet"
import { TypedData } from "@starknet-io/types-js"
import type { TypedData } from "@starknet-io/types-js"
import type { IStarknetRpc } from "./starknet.model"

export class StarknetRemoteSigner implements SignerInterface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type {
InvokeFunctionResponse,
Signature,
} from "starknet"
import { TypedData } from "@starknet-io/types-js"
import type { TypedData } from "@starknet-io/types-js"

// see https://github.com/WalletConnect/walletconnect-docs/pull/288/files
export interface IStarknetRpc {
Expand Down
16 changes: 10 additions & 6 deletions src/connectors/braavosMobile/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import { type AccountChangeEventHandler } from "@starknet-io/get-starknet-core"
import {
import type {
RequestFnCall,
RpcMessage,
RpcTypeToMessageMap,
type StarknetWindowObject,
StarknetWindowObject,
} from "@starknet-io/types-js"
import { AccountInterface, ProviderInterface, ProviderOptions } from "starknet"
import {
ConnectArgs,
AccountInterface,
ProviderInterface,
type ProviderOptions,
} from "starknet"
import {
Connector,
type ConnectArgs,
type ConnectorData,
type ConnectorIcons,
} from "../connector"
import { InjectedConnector, InjectedConnectorOptions } from "../injected"
import { isInBraavosMobileAppBrowser } from "./helpers/inAppBrowser"
import { InjectedConnector, type InjectedConnectorOptions } from "../injected"
import { BRAAVOS_MOBILE_APP_ICON } from "./constants"
import { isInBraavosMobileAppBrowser } from "./helpers/inAppBrowser"

export class BraavosMobileBaseConnector extends Connector {
private _wallet: StarknetWindowObject | null = null
Expand Down
6 changes: 5 additions & 1 deletion src/connectors/connector.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import EventEmitter from "eventemitter3"
import { AccountInterface, ProviderInterface, ProviderOptions } from "starknet"
import {
AccountInterface,
ProviderInterface,
type ProviderOptions,
} from "starknet"
import type {
RequestFnCall,
RpcMessage,
Expand Down
12 changes: 6 additions & 6 deletions src/connectors/injected/index.ts

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/connectors/webwallet/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {
Permission,
RequestFnCall,
RpcMessage,
RpcTypeToMessageMap,
type RequestFnCall,
type RpcMessage,
type RpcTypeToMessageMap,
type AccountChangeEventHandler,
type StarknetWindowObject,
} from "@starknet-io/types-js"
import {
Account,
AccountInterface,
ProviderInterface,
ProviderOptions,
type ProviderOptions,
} from "starknet"
import {
ConnectorNotConnectedError,
Expand All @@ -20,8 +20,8 @@ import {
import { getStarknetChainId } from "../../helpers/getStarknetChainId"
import { removeStarknetLastConnectedWallet } from "../../helpers/lastConnected"
import {
ConnectArgs,
Connector,
type ConnectArgs,
type ConnectorData,
type ConnectorIcons,
} from "../connector"
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/getStarknetChainId.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { constants } from "starknet"
import { ChainId } from "@starknet-io/types-js"
import type { ChainId } from "@starknet-io/types-js"

export const getStarknetChainId = (
chainId: ChainId,
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/mapModalWallets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WalletProvider } from "@starknet-io/get-starknet-core"
import type { WalletProvider } from "@starknet-io/get-starknet-core"
import { isString } from "lodash-es"
import type { StarknetWindowObject } from "@starknet-io/types-js"
import { StarknetkitConnector } from "../connectors/connector"
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useStarknetkitConnectModal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { connect } from "../main"
import { ConnectOptionsWithConnectors, ModalResult } from "../types/modal"
import type { ConnectOptionsWithConnectors, ModalResult } from "../types/modal"

type UseStarknetkitConnectors = {
starknetkitConnectModal: () => Promise<ModalResult>
Expand Down
6 changes: 5 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import type { DisconnectOptions } from "@starknet-io/get-starknet"
import sn from "@starknet-io/get-starknet-core"
import type { StarknetWindowObject } from "@starknet-io/types-js"
import { Connector, ConnectorData, StarknetkitConnector } from "./connectors"
import {
Connector,
StarknetkitConnector,
type ConnectorData,
} from "./connectors"
import { DEFAULT_WEBWALLET_URL } from "./connectors/webwallet/constants"
import { defaultConnectors } from "./helpers/defaultConnectors"
import { getStoreVersionFromBrowser } from "./helpers/getStoreVersionFromBrowser"
Expand Down
2 changes: 1 addition & 1 deletion src/modal/ConnectorButton.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { ModalWallet } from "../types/modal"
import type { ModalWallet } from "../types/modal"
import type { StarknetkitConnector } from "../connectors/connector"
export let wallet: ModalWallet
Expand Down
6 changes: 3 additions & 3 deletions src/modal/Modal.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import { onMount } from "svelte"
import type { StarknetWindowObject } from "@starknet-io/types-js"
import ConnectorButton from "./ConnectorButton.svelte"
import { onMount } from "svelte"
import type { StarknetkitConnector } from "../connectors/connector"
import { InjectedConnector } from "../connectors/injected"
import { ModalWallet } from "../types/modal"
import type { ModalWallet } from "../types/modal"
import ConnectorButton from "./ConnectorButton.svelte"
export let dappName: string = window?.document.title ?? ""
export let modalWallets: ModalWallet[]
Expand Down
2 changes: 1 addition & 1 deletion src/types/modal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { GetWalletOptions } from "@starknet-io/get-starknet-core"
import { StarknetWindowObject } from "@starknet-io/types-js"
import type { StarknetWindowObject } from "@starknet-io/types-js"
import type { ArgentMobileConnectorOptions } from "../connectors/argentMobile"
import type {
ConnectorData,
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"allowJs": true,
"checkJs": true,
"declaration": true,
"verbatimModuleSyntax": false
"verbatimModuleSyntax": true
},
"include": ["src"],
"exclude": ["node_modules"]
Expand Down

0 comments on commit a717f32

Please sign in to comment.