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

Formatting #913

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .husky/pre-commit
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run test:unit
3 changes: 3 additions & 0 deletions .prettierignore
@@ -0,0 +1,3 @@
compiled
bundle
dist
6 changes: 6 additions & 0 deletions .prettierrc
@@ -0,0 +1,6 @@
{
"printWidth": 120,
"singleQuote": true,
"jsxSingleQuote": true,
"semi": false
}
25 changes: 15 additions & 10 deletions @types/@aragon__wrapper/index.d.ts
@@ -1,19 +1,19 @@
declare module '@aragon/wrapper' {
interface WrapperOptions {
provider: any,
provider: any
apm?: {
ipfs?: {
gateway: string,
},
gateway: string
}
ensRegistryAddress?: string
}
}

interface App {
appId: string,
proxyAddress: string,
name: string,
kernel: string,
appId: string
proxyAddress: string
name: string
kernel: string
agent: string
}

Expand All @@ -26,15 +26,20 @@ declare module '@aragon/wrapper' {
}

export default class Wrapper {
constructor (address: string, opts: WrapperOptions)
constructor(address: string, opts: WrapperOptions)
apps: Apps

init(): Promise<void>
calculateTransactionPath(from: string, destination: string, action: string, txData: Array<string | undefined>): Promise<Array<TransactionData>>
calculateTransactionPath(
from: string,
destination: string,
action: string,
txData: Array<string | undefined>
): Promise<Array<TransactionData>>
}

interface ResolveOptions {
provider: any,
provider: any
registryAddress?: string
}

Expand Down
2 changes: 1 addition & 1 deletion @types/eth-ens-namehash/index.d.ts
@@ -1,3 +1,3 @@
declare module 'eth-ens-namehash' {
export function hash (name: string): string
export function hash(name: string): string
}
2 changes: 1 addition & 1 deletion @types/frame/environment.d.ts
Expand Up @@ -2,7 +2,7 @@ declare global {
namespace NodeJS {
interface ProcessEnv {
BUNDLE_LOCATION: string
NODE_ENV: 'test' | 'development' | 'production',
NODE_ENV: 'test' | 'development' | 'production'
// use this to override the log level in development
LOG_LEVEL: 'silly' | 'debug' | 'verbose' | 'info' | 'warn' | 'error'
}
Expand Down
14 changes: 7 additions & 7 deletions @types/frame/ethProvider.d.ts
@@ -1,14 +1,14 @@
declare module 'eth-provider' {
interface ProviderOpts {
name?: string,
name?: string
origin?: string
}

interface RequestPayload {
id?: number,
jsonrpc?: '2.0',
method: string,
params?: any[],
id?: number
jsonrpc?: '2.0'
method: string
params?: any[]
chainId?: string
}

Expand All @@ -21,5 +21,5 @@ declare module 'eth-provider' {
setChain(chainId: string)
}

export default function provider (targets?: string | string[], opts?: ProviderOpts): EthereumProvider
export default function provider(targets?: string | string[], opts?: ProviderOpts): EthereumProvider
}
10 changes: 5 additions & 5 deletions @types/frame/restore.d.ts
Expand Up @@ -6,16 +6,16 @@ interface Action {
updates: any[]
}

declare type CallableStore = (...args: any[]) => any;
declare type CallableStore = (...args: any[]) => any

interface Store extends CallableStore {
observer: (cb: () => void, id?: string) => Observer,
[actionName: string]: (...args: any) => void,
observer: (cb: () => void, id?: string) => Observer
[actionName: string]: (...args: any) => void
api: {
feed: (handler: (state: any, actionBatch: Action[]) => any) => void;
feed: (handler: (state: any, actionBatch: Action[]) => any) => void
}
}

declare module 'react-restore' {
export function create (state: any, actions: any): Store
export function create(state: any, actions: any): Store
}
56 changes: 28 additions & 28 deletions @types/frame/rpc.d.ts
Expand Up @@ -11,11 +11,11 @@ enum SubscriptionType {
ASSETS = 'assetsChanged',
CHAIN = 'chainChanged',
CHAINS = 'chainsChanged',
NETWORK = 'networkChanged'
NETWORK = 'networkChanged',
}

interface RPCId {
id: number,
id: number
jsonrpc: string
}

Expand All @@ -24,8 +24,8 @@ interface InternalPayload {
}

interface JSONRPCRequestPayload extends RPCId {
params: any[],
method: string,
params: any[]
method: string
chainId?: string
}

Expand All @@ -38,7 +38,7 @@ interface JSONRPCErrorResponsePayload extends RPCId {
}

interface EVMError {
message: string,
message: string
code?: number
}

Expand All @@ -47,27 +47,27 @@ type RPCRequestPayload = JSONRPCRequestPayload & InternalPayload
declare namespace RPC {
namespace GetAssets {
interface Balance {
chainId: number,
name: string,
symbol: string,
balance: string,
decimals: number,
chainId: number
name: string
symbol: string
balance: string
decimals: number
displayBalance: string
}

interface NativeCurrency extends Balance {
currencyInfo: Currency
}

interface Erc20 extends Balance {
tokenInfo: {
lastKnownPrice: { usd: { price: number, change24hr?: number } }
},
lastKnownPrice: { usd: { price: number; change24hr?: number } }
}
address: Address
}

interface Assets {
erc20?: Erc20[],
erc20?: Erc20[]
nativeCurrency: Balance[]
}

Expand All @@ -82,29 +82,29 @@ declare namespace RPC {

namespace SendTransaction {
interface TxParams {
nonce?: string;
gasPrice?: string,
gas?: string, // deprecated
maxPriorityFeePerGas?: string,
maxFeePerGas?: string,
gasLimit?: string,
from?: Address,
to?: Address,
data?: string,
value?: string,
chainId: string,
type?: string,
nonce?: string
gasPrice?: string
gas?: string // deprecated
maxPriorityFeePerGas?: string
maxFeePerGas?: string
gasLimit?: string
from?: Address
to?: Address
data?: string
value?: string
chainId: string
type?: string
}

interface Request extends Omit<RPCRequestPayload, 'method'> {
method: 'eth_sendTransaction',
method: 'eth_sendTransaction'
params: TxParams[]
}
}

namespace Subscribe {
interface Request extends Omit<RPCRequestPayload, 'method'> {
method: 'eth_subscribe',
method: 'eth_subscribe'
params: SubscriptionType[]
}
}
Expand Down