Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Use semicolons to delimit interface members
Alexis Sellier committed 4 years ago
commit 0b6d60c69ac36f6d05142a8ef8f02e1a45aded88
parent 97d3ae0bfd4d15a5b0639e891cb98afd710d012a
6 files changed +37 -37
modified src/blockies.ts
@@ -98,12 +98,12 @@ function createCanvas(
}

export interface Options {
-
  seed: string
-
  size: number
-
  scale: number
-
  color?: string
-
  bgcolor?: string
-
  spotcolor?: string
+
  seed: string;
+
  size: number;
+
  scale: number;
+
  color?: string;
+
  bgcolor?: string;
+
  spotcolor?: string;
}

export function createIcon(opts: Options): HTMLCanvasElement {
modified src/config.ts
@@ -10,28 +10,28 @@ declare global {

  interface ImportMeta {
    env: {
-
      RADICLE_ALCHEMY_API_KEY: string | null,
-
      RADICLE_HTTP_API: string | null,
-
    }
+
      RADICLE_ALCHEMY_API_KEY: string | null;
+
      RADICLE_HTTP_API: string | null;
+
    };
  }
}

export class Config {
-
  network: { name: string, chainId: number };
-
  registrar: { address: string, domain: string };
+
  network: { name: string; chainId: number };
+
  registrar: { address: string; domain: string };
  radToken: { address: string };
  orgFactory: { address: string };
-
  orgs: { subgraph: string, contractHash: string };
+
  orgs: { subgraph: string; contractHash: string };
  gasLimits: { createOrg: number };
  provider: ethers.providers.JsonRpcProvider;
  signer: ethers.Signer & TypedDataSigner | null;
-
  safe: { api: string | null, viewer: string | null };
+
  safe: { api: string | null; viewer: string | null };
  abi: { [contract: string]: string[] }
  seed: { api: string | null };
  tokens: string[];

  constructor(
-
    network: { name: string, chainId: number },
+
    network: { name: string; chainId: number },
    provider: ethers.providers.JsonRpcProvider,
    signer: ethers.Signer & TypedDataSigner | null,
  ) {
modified src/error.ts
@@ -1,9 +1,9 @@
import { writable } from "svelte/store";

export interface Err {
-
  type: Failure,
-
  txHash?: string,
-
  message?: string,
+
  type: Failure;
+
  txHash?: string;
+
  message?: string;
}

export enum Failure {
modified src/project.ts
@@ -1,22 +1,22 @@
import type { Config } from '@app/config';

export interface Project {
-
  id: string
+
  id: string;
  anchor: {
-
    stateHash: string
-
    stateHashFormat: string
-
  }
+
    stateHash: string;
+
    stateHashFormat: string;
+
  };
}

export interface Person {
-
  urn: string
-
  avatar: { emoji: string, background: { r: number, g: number, b: number } }
+
  urn: string;
+
  avatar: { emoji: string; background: { r: number; g: number; b: number } };
}

export interface Meta {
-
  name: string
-
  description: string
-
  maintainers: Person[]
+
  name: string;
+
  description: string;
+
  maintainers: Person[];
}

export interface Author {
modified src/session.ts
@@ -13,20 +13,20 @@ export enum Connection {

export type TxState =
    { state: 'signing' }
-
  | { state: 'pending', hash: string }
-
  | { state: 'success', hash: string, blockHash: string, blockNumber: number }
-
  | { state: 'fail', hash: string, blockHash: string, blockNumber: number, error: string }
+
  | { state: 'pending'; hash: string }
+
  | { state: 'success'; hash: string; blockHash: string; blockNumber: number }
+
  | { state: 'fail'; hash: string; blockHash: string; blockNumber: number; error: string }
  | null;

export type State =
    { connection: Connection.Disconnected }
  | { connection: Connection.Connecting }
-
  | { connection: Connection.Connected, session: Session };
+
  | { connection: Connection.Connected; session: Session };

export interface Session {
-
  address: string
-
  tokenBalance: BigNumber
-
  tx: TxState
+
  address: string;
+
  tokenBalance: BigNumber;
+
  tx: TxState;
}

export interface Store extends Readable<State> {
modified src/utils.ts
@@ -12,9 +12,9 @@ export enum AddressType {
}

export interface Safe {
-
  address: string
-
  owners: string[]
-
  threshold: number
+
  address: string;
+
  owners: string[];
+
  threshold: number;
}

export function formatBalance(n: BigNumber): string {
@@ -189,7 +189,7 @@ export async function getSafe(address: string, config: Config): Promise<Safe | n

// Get token balances for an address.
export async function getTokens(address: string, config: Config):
-
  Promise<Array<{ tokenName: string, tokenLogo: string }>>
+
  Promise<Array<{ tokenName: string; tokenLogo: string }>>
{
  await config.provider.send("alchemy_getTokenBalances", [address, config.tokens]);