Skip to content
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
6 changes: 3 additions & 3 deletions packages/sdk-multichain/biome.json → biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"useIgnoreFile": false
},
"files": {
"includes": ["**", "!**/node_modules/**", "!**/dist/**"],
"includes": ["packages/sdk-multichain/src/**", "!**/node_modules/**", "!**/dist/**"],
"ignoreUnknown": false
},
"formatter": {
Expand All @@ -22,7 +22,7 @@
},
"javascript": {
"formatter": {
"quoteStyle": "double"
"quoteStyle": "single"
}
},
"assist": {
Expand All @@ -33,4 +33,4 @@
}
}
}
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"@babel/core": "^7.23.5",
"@babel/plugin-syntax-flow": "^7.21.4",
"@babel/plugin-transform-react-jsx": "^7.21.5",
"@biomejs/biome": "2.0.0",
"@commitlint/cli": "^17.6.7",
"@commitlint/config-conventional": "^17.6.7",
"@lavamoat/allow-scripts": "^2.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-multichain/src/domain/errors/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ErrorCodes } from "./types";
import type { ErrorCodes } from './types';

export abstract class BaseErr<C extends string, T extends ErrorCodes> extends Error {
constructor(
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk-multichain/src/domain/errors/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./rpc";
export * from "./types";
export * from './rpc';
export * from './types';
12 changes: 6 additions & 6 deletions packages/sdk-multichain/src/domain/errors/rpc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BaseErr } from "./base";
import type { RPCErrorCodes } from "./types";
import { BaseErr } from './base';
import type { RPCErrorCodes } from './types';

export class RPCHttpErr extends BaseErr<"RPC", RPCErrorCodes> {
export class RPCHttpErr extends BaseErr<'RPC', RPCErrorCodes> {
static readonly code = 50;
constructor(
readonly rpcEndpoint: string,
Expand All @@ -12,21 +12,21 @@ export class RPCHttpErr extends BaseErr<"RPC", RPCErrorCodes> {
}
}

export class RPCReadonlyResponseErr extends BaseErr<"RPC", RPCErrorCodes> {
export class RPCReadonlyResponseErr extends BaseErr<'RPC', RPCErrorCodes> {
static readonly code = 51;
constructor(public readonly reason: string) {
super(`RPCErr${RPCReadonlyResponseErr.code}: RPC Client response reason ${reason}`, RPCReadonlyResponseErr.code);
}
}

export class RPCReadonlyRequestErr extends BaseErr<"RPC", RPCErrorCodes> {
export class RPCReadonlyRequestErr extends BaseErr<'RPC', RPCErrorCodes> {
static readonly code = 52;
constructor(public readonly reason: string) {
super(`RPCErr${RPCReadonlyRequestErr.code}: RPC Client fetch reason ${reason}`, RPCReadonlyRequestErr.code);
}
}

export class RPCInvokeMethodErr extends BaseErr<"RPC", RPCErrorCodes> {
export class RPCInvokeMethodErr extends BaseErr<'RPC', RPCErrorCodes> {
static readonly code = 53;
constructor(public readonly reason: string) {
super(`RPCErr${RPCInvokeMethodErr.code}: RPC Client invoke method reason ${reason}`, RPCInvokeMethodErr.code);
Expand Down
16 changes: 8 additions & 8 deletions packages/sdk-multichain/src/domain/errors/storage.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { BaseErr } from "./base";
import type { StorageErrorCodes } from "./types";
import { BaseErr } from './base';
import type { StorageErrorCodes } from './types';

export class StorageGetErr extends BaseErr<"Storage", StorageErrorCodes> {
export class StorageGetErr extends BaseErr<'Storage', StorageErrorCodes> {
static readonly code = 60;
constructor(
public readonly platform: "web" | "rn" | "node",
public readonly platform: 'web' | 'rn' | 'node',
public readonly key: string,
public readonly reason: string,
) {
super(`StorageErr${StorageGetErr.code}: ${platform} storage get error in key: ${key} - ${reason}`, StorageGetErr.code);
}
}

export class StorageSetErr extends BaseErr<"Storage", StorageErrorCodes> {
export class StorageSetErr extends BaseErr<'Storage', StorageErrorCodes> {
static readonly code = 61;
constructor(
public readonly platform: "web" | "rn" | "node",
public readonly platform: 'web' | 'rn' | 'node',
public readonly key: string,
public readonly reason: string,
) {
super(`StorageErr${StorageSetErr.code}: ${platform} storage set error in key: ${key} - ${reason}`, StorageSetErr.code);
}
}

export class StorageDeleteErr extends BaseErr<"Storage", StorageErrorCodes> {
export class StorageDeleteErr extends BaseErr<'Storage', StorageErrorCodes> {
static readonly code = 62;
constructor(
public readonly platform: "web" | "rn" | "node",
public readonly platform: 'web' | 'rn' | 'node',
public readonly key: string,
public readonly reason: string,
) {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-multichain/src/domain/errors/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type Enumerate<N extends number, Acc extends number[] = []> = Acc["length"] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc["length"]]>;
export type Enumerate<N extends number, Acc extends number[] = []> = Acc['length'] extends N ? Acc[number] : Enumerate<N, [...Acc, Acc['length']]>;

export type ErrorCodeRange<F extends number, T extends number> = Exclude<Enumerate<T>, Enumerate<F>>;

Expand Down
6 changes: 3 additions & 3 deletions packages/sdk-multichain/src/domain/events/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EventEmitter2 } from "eventemitter2";
import { EventEmitter2 } from 'eventemitter2';

import type { EventTypes } from "./types";
import type { EventTypes } from './types';

/**
* A type-safe event emitter that provides a strongly-typed wrapper around EventEmitter2.
Expand Down Expand Up @@ -61,4 +61,4 @@ export class EventEmitter<TEvents extends Record<string, unknown[]> = EventTypes
}
}

export type * from "./types";
export type * from './types';
4 changes: 2 additions & 2 deletions packages/sdk-multichain/src/domain/events/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ExtensionEvents } from "./extension";
import type { SDKEvents } from "./sdk";
import type { ExtensionEvents } from './extension';
import type { SDKEvents } from './sdk';

export type EventTypes = SDKEvents | ExtensionEvents;
export type { SDKEvents, ExtensionEvents };
Loading
Loading