From 539881ac8c331d2dcfd75d92836e7a6b624528bb Mon Sep 17 00:00:00 2001 From: Rahul Yadav Date: Fri, 21 Jun 2024 18:07:27 +0530 Subject: [PATCH] install prettier and format codebase --- next.config.js | 6 +- package-lock.json | 24 ++- package.json | 3 +- public/assets/ton/types/ton-core.d.ts | 156 +++++++++--------- public/assets/ton/types/ton-sandbox.d.ts | 78 ++++----- public/html/testcases.html | 2 +- public/html/tonweb.html | 6 +- .../project/NewProject/NewProject.tsx | 2 +- .../project/ProjectListing/ProjectListing.tsx | 4 +- src/components/shared/LogView/LogView.tsx | 4 +- src/components/workspace/ABIUi/ABIUi.tsx | 4 +- .../workspace/BuildProject/BuildProject.tsx | 40 ++--- .../workspace/BuildProject/CellBuilder.tsx | 2 +- .../ContractInteraction.tsx | 12 +- src/components/workspace/Editor/Editor.tsx | 4 +- .../workspace/Editor/EditorOnMount.ts | 8 +- src/components/workspace/Editor/lsp.ts | 8 +- .../workspace/ExecuteFile/ExecuteFile.tsx | 4 +- .../workspace/TestCases/TestCases.tsx | 10 +- .../workspace/WorkSpace/WorkSpace.tsx | 2 +- .../workspace/tree/FileTree/FileTree.tsx | 2 +- .../workspace/tree/FileTree/TreeNode.tsx | 2 +- src/hooks/ApiClient.hooks.ts | 2 +- src/hooks/contract.hooks.ts | 52 +++--- src/hooks/logActivity.hooks.ts | 2 +- src/hooks/project.hooks.ts | 22 +-- src/hooks/setting.hooks.ts | 2 +- src/hooks/workspace.hooks.ts | 38 ++--- src/pages/_app.tsx | 4 +- src/pages/api/hello.ts | 2 +- src/utility/getterParser.ts | 6 +- src/utility/gitRepoDownloader.ts | 4 +- src/utility/syntaxHighlighter.ts | 6 +- src/utility/tonProof.ts | 4 +- src/utility/typescriptHelper.ts | 2 +- src/utility/utils.ts | 8 +- 36 files changed, 280 insertions(+), 257 deletions(-) diff --git a/next.config.js b/next.config.js index a557b6d..59fd021 100644 --- a/next.config.js +++ b/next.config.js @@ -14,7 +14,7 @@ const nextConfig = withTM({ config.resolve.alias = { ...config.resolve.alias, vscode: require.resolve( - "@codingame/monaco-languageclient/lib/vscode-compatibility" + "@codingame/monaco-languageclient/lib/vscode-compatibility", ), }; @@ -23,7 +23,7 @@ const nextConfig = withTM({ config.plugins.push( new webpack.NormalModuleReplacementPlugin(/^node:/, (resource) => { resource.request = resource.request.replace(/^node:/, ""); - }) + }), ); if (!options.isServer) { @@ -31,7 +31,7 @@ const nextConfig = withTM({ new MonacoWebpackPlugin({ languages: ["typescript"], filename: "static/[name].worker.js", - }) + }), ); } return config; diff --git a/package-lock.json b/package-lock.json index ea361c2..a727ceb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -71,7 +71,8 @@ "@types/uuid": "^9.0.1", "eslint-config-prettier": "^9.1.0", "monaco-editor-webpack-plugin": "^7.0.1", - "next-transpile-modules": "^10.0.0" + "next-transpile-modules": "^10.0.0", + "prettier": "^3.3.2" } }, "node_modules/@ant-design/colors": { @@ -6053,6 +6054,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/prismjs": { "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", @@ -13026,6 +13042,12 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" }, + "prettier": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", + "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "dev": true + }, "prismjs": { "version": "1.29.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz", diff --git a/package.json b/package.json index f23c365..2b7a1b1 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "@types/uuid": "^9.0.1", "eslint-config-prettier": "^9.1.0", "monaco-editor-webpack-plugin": "^7.0.1", - "next-transpile-modules": "^10.0.0" + "next-transpile-modules": "^10.0.0", + "prettier": "^3.3.2" } } diff --git a/public/assets/ton/types/ton-core.d.ts b/public/assets/ton/types/ton-core.d.ts index 866290a..6fb0b8a 100644 --- a/public/assets/ton/types/ton-core.d.ts +++ b/public/assets/ton/types/ton-core.d.ts @@ -171,13 +171,13 @@ export {}; export declare function safeSign( cell: Cell, secretKey: Buffer, - seed?: string + seed?: string, ): Buffer; export declare function safeSignVerify( cell: Cell, signature: Buffer, publicKey: Buffer, - seed?: string + seed?: string, ): boolean; /** * Copyright (c) Whales Corp. @@ -189,7 +189,7 @@ export declare function safeSignVerify( export declare function contractAddress( workchain: number, - init: StateInit + init: StateInit, ): Address; /** * Copyright (c) Whales Corp. @@ -760,7 +760,7 @@ export declare class Builder { * @returns this builder */ storeMaybeWritable( - writer?: Maybe<((builder: Builder) => void) | Writable> + writer?: Maybe<((builder: Builder) => void) | Writable>, ): this; /** * Store object in this builder @@ -799,7 +799,7 @@ export declare class Builder { storeDict( dict?: Maybe>, key?: Maybe>, - value?: Maybe> + value?: Maybe>, ): this; /** * Store dictionary in this builder directly @@ -809,7 +809,7 @@ export declare class Builder { storeDictDirect( dict: Dictionary, key?: Maybe>, - value?: Maybe> + value?: Maybe>, ): this; /** * Complete cell @@ -1245,7 +1245,7 @@ export declare class Slice { */ loadDict( key: DictionaryKey, - value: DictionaryValue + value: DictionaryValue, ): Dictionary; /** * Loads dictionary directly from current slice @@ -1255,7 +1255,7 @@ export declare class Slice { */ loadDictDirect( key: DictionaryKey, - value: DictionaryValue + value: DictionaryValue, ): Dictionary; /** * Checks if slice is empty @@ -1308,7 +1308,7 @@ export declare class ComputeError extends Error { opts?: { debugLogs?: Maybe; logs?: Maybe; - } + }, ); } /** @@ -1451,14 +1451,14 @@ export interface ContractProvider { bounce?: Maybe; sendMode?: SendMode; body?: Maybe; - } + }, ): Promise; open(contract: T): OpenedContract; getTransactions( address: Address, lt: bigint, hash: Buffer, - limit?: number + limit?: number, ): Promise; } /** @@ -1645,7 +1645,7 @@ export declare class Dictionary { */ Dictionary: ( key: DictionaryKey, - value: DictionaryValue + value: DictionaryValue, ) => DictionaryValue>; }; /** @@ -1656,7 +1656,7 @@ export declare class Dictionary { */ static empty( key?: Maybe>, - value?: Maybe> + value?: Maybe>, ): Dictionary; /** * Load dictionary from slice @@ -1668,7 +1668,7 @@ export declare class Dictionary { static load( key: DictionaryKey, value: DictionaryValue, - sc: Slice | Cell + sc: Slice | Cell, ): Dictionary; /** * Low level method for rare dictionaries from system contracts. @@ -1682,7 +1682,7 @@ export declare class Dictionary { static loadDirect( key: DictionaryKey, value: DictionaryValue, - sc: Slice | Cell | null + sc: Slice | Cell | null, ): Dictionary; private readonly _key; private readonly _value; @@ -1700,12 +1700,12 @@ export declare class Dictionary { store( builder: Builder, key?: Maybe>, - value?: Maybe> + value?: Maybe>, ): void; storeDirect( builder: Builder, key?: Maybe>, - value?: Maybe> + value?: Maybe>, ): void; generateMerkleProof(key: K): Cell; generateMerkleUpdate(key: K, newValue: V): Cell; @@ -1714,14 +1714,14 @@ export declare class Dictionary { export declare function generateMerkleProof( dict: Dictionary, key: K, - keyObject: DictionaryKey + keyObject: DictionaryKey, ): Cell; export declare function generateMerkleUpdate( dict: Dictionary, key: K, keyObject: DictionaryKey, - newValue: V + newValue: V, ): Cell; /** * Copyright (c) Whales Corp. @@ -1734,7 +1734,7 @@ export declare function generateMerkleUpdate( export declare function parseDict( sc: Slice | null, keySize: number, - extractor: (src: Slice) => V + extractor: (src: Slice) => V, ): Map; /** * Copyright (c) Whales Corp. @@ -1768,29 +1768,29 @@ type Edge = { }; export declare function buildTree( src: Map, - keyLength: number + keyLength: number, ): Edge; export declare function writeLabelShort(src: string, to: Builder): Builder; export declare function writeLabelLong( src: string, keyLength: number, - to: Builder + to: Builder, ): Builder; export declare function writeLabelSame( value: number | boolean, length: number, keyLength: number, - to: Builder + to: Builder, ): void; export declare function detectLabelType( src: string, - keyLength: number + keyLength: number, ): 'short' | 'long' | 'same'; export declare function serializeDict( src: Map, keyLength: number, serializer: (src: T, cell: Builder) => void, - to: Builder + to: Builder, ): void; export {}; /** @@ -1821,7 +1821,7 @@ export declare function openContract( factory: (params: { address: Address; init: StateInit | null; - }) => ContractProvider + }) => ContractProvider, ): OpenedContract; /** * Copyright (c) Whales Corp. @@ -1878,7 +1878,7 @@ export type CommonMessageInfoExternalOut = { }; export declare function loadCommonMessageInfo(slice: Slice): CommonMessageInfo; export declare function storeCommonMessageInfo( - source: CommonMessageInfo + source: CommonMessageInfo, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -1890,10 +1890,10 @@ export declare function storeCommonMessageInfo( export type AccountStatusChange = 'unchanged' | 'frozen' | 'deleted'; export declare function loadAccountStatusChange( - slice: Slice + slice: Slice, ): AccountStatusChange; export declare function storeAccountStatusChange( - src: AccountStatusChange + src: AccountStatusChange, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -1918,7 +1918,7 @@ export type AccountStorage = { }; export declare function loadAccountStorage(slice: Slice): AccountStorage; export declare function storeAccountStorage( - src: AccountStorage + src: AccountStorage, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -1952,10 +1952,10 @@ export type CommonMessageInfoRelaxedExternalOut = { createdAt: number; }; export declare function loadCommonMessageInfoRelaxed( - slice: Slice + slice: Slice, ): CommonMessageInfoRelaxed; export declare function storeCommonMessageInfoRelaxed( - source: CommonMessageInfoRelaxed + source: CommonMessageInfoRelaxed, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -1970,10 +1970,10 @@ export interface CurrencyCollection { coins: bigint; } export declare function loadCurrencyCollection( - slice: Slice + slice: Slice, ): CurrencyCollection; export declare function storeCurrencyCollection( - collection: CurrencyCollection + collection: CurrencyCollection, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -1986,7 +1986,7 @@ export declare function storeCurrencyCollection( export type ComputeSkipReason = 'no-state' | 'bad-state' | 'no-gas'; export declare function loadComputeSkipReason(slice: Slice): ComputeSkipReason; export declare function storeComputeSkipReason( - src: ComputeSkipReason + src: ComputeSkipReason, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2002,7 +2002,7 @@ export type DepthBalanceInfo = { }; export declare function loadDepthBalanceInfo(slice: Slice): DepthBalanceInfo; export declare function storeDepthBalanceInfo( - src: DepthBalanceInfo + src: DepthBalanceInfo, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2030,7 +2030,7 @@ export declare function storeMessage( message: Message, opts?: { forceRef?: boolean; - } + }, ): (builder: Builder) => void; export declare const MessageValue: DictionaryValue; /** @@ -2056,7 +2056,7 @@ export type ShardAccount = { }; export declare function loadShardAccount(slice: Slice): ShardAccount; export declare function storeShardAccount( - src: ShardAccount + src: ShardAccount, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2076,7 +2076,7 @@ export declare function storeMessageRelaxed( message: MessageRelaxed, opts?: { forceRef?: boolean; - } + }, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2112,11 +2112,11 @@ export interface OutActionSetCode { } export type OutAction = OutActionSendMsg | OutActionSetCode; export declare function storeOutAction( - action: OutAction + action: OutAction, ): (builder: Builder) => void; export declare function loadOutAction(slice: Slice): OutAction; export declare function storeOutList( - actions: OutAction[] + actions: OutAction[], ): (builder: Builder) => void; export declare function loadOutList(slice: Slice): OutAction[]; /** @@ -2158,7 +2158,7 @@ export type ShardIdent = { }; export declare function loadShardIdent(slice: Slice): ShardIdent; export declare function storeShardIdent( - src: ShardIdent + src: ShardIdent, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2174,10 +2174,10 @@ export type ShardAccountRef = { }; export declare const ShardAccountRefValue: DictionaryValue; export declare function loadShardAccounts( - cs: Slice + cs: Slice, ): Dictionary; export declare function storeShardAccounts( - src: Dictionary + src: Dictionary, ): (Builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2216,7 +2216,7 @@ export type SplitMergeInfo = { }; export declare function loadSplitMergeInfo(slice: Slice): SplitMergeInfo; export declare function storeSplitMergeInfo( - src: SplitMergeInfo + src: SplitMergeInfo, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2249,7 +2249,7 @@ export type StorageInfo = { }; export declare function loadStorageInfo(slice: Slice): StorageInfo; export declare function storeStorageInfo( - src: StorageInfo + src: StorageInfo, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2276,7 +2276,7 @@ export type AccountStateFrozen = { }; export declare function loadAccountState(cs: Slice): AccountState; export declare function storeAccountState( - src: AccountState + src: AccountState, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2292,7 +2292,7 @@ export type StorageUsedShort = { }; export declare function loadStorageUsedShort(slice: Slice): StorageUsedShort; export declare function storeStorageUsedShort( - src: StorageUsedShort + src: StorageUsedShort, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2309,7 +2309,7 @@ export type StorageUsed = { }; export declare function loadStorageUsed(cs: Slice): StorageUsed; export declare function storeStorageUsed( - src: StorageUsed + src: StorageUsed, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2339,7 +2339,7 @@ export type Transaction = { }; export declare function loadTransaction(slice: Slice): Transaction; export declare function storeTransaction( - src: Transaction + src: Transaction, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2355,7 +2355,7 @@ export type TickTock = { }; export declare function loadTickTock(slice: Slice): TickTock; export declare function storeTickTock( - src: TickTock + src: TickTock, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2370,10 +2370,10 @@ export type TransactionCreditPhase = { credit: CurrencyCollection; }; export declare function loadTransactionCreditPhase( - slice: Slice + slice: Slice, ): TransactionCreditPhase; export declare function storeTransactionCreditPhase( - src: TransactionCreditPhase + src: TransactionCreditPhase, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2402,10 +2402,10 @@ export type TransactionBounceOk = { forwardFees: bigint; }; export declare function loadTransactionBouncePhase( - slice: Slice + slice: Slice, ): TransactionBouncePhase; export declare function storeTransactionBouncePhase( - src: TransactionBouncePhase + src: TransactionBouncePhase, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2432,10 +2432,10 @@ export type TransactionActionPhase = { totalMessageSize: StorageUsedShort; }; export declare function loadTransactionActionPhase( - slice: Slice + slice: Slice, ): TransactionActionPhase; export declare function storeTransactionActionPhase( - src: TransactionActionPhase + src: TransactionActionPhase, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2518,10 +2518,10 @@ export type TransactionDescriptionMergeInstall = { destroyed: boolean; }; export declare function loadTransactionDescription( - slice: Slice + slice: Slice, ): TransactionDescription; export declare function storeTransactionDescription( - src: TransactionDescription + src: TransactionDescription, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2561,7 +2561,7 @@ export interface StateInit { } export declare function loadStateInit(slice: Slice): StateInit; export declare function storeStateInit( - src: StateInit + src: StateInit, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2577,10 +2577,10 @@ export type TransactionStoragePhase = { statusChange: AccountStatusChange; }; export declare function loadTransactionStoragePhase( - slice: Slice + slice: Slice, ): TransactionStoragePhase; export declare function storeTransactionsStoragePhase( - src: TransactionStoragePhase + src: TransactionStoragePhase, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2607,7 +2607,7 @@ export declare function loadAccountStatus(slice: Slice): AccountStatus; * @param builder buidler */ export declare function storeAccountStatus( - src: AccountStatus + src: AccountStatus, ): (builder: Builder) => Builder; /** * Copyright (c) Whales Corp. @@ -2623,7 +2623,7 @@ export interface SimpleLibrary { } export declare function loadSimpleLibrary(slice: Slice): SimpleLibrary; export declare function storeSimpleLibrary( - src: SimpleLibrary + src: SimpleLibrary, ): (builder: Builder) => void; export declare const SimpleLibraryValue: DictionaryValue; /** @@ -2694,10 +2694,10 @@ export type TransactionComputeVm = { vmFinalStateHash: bigint; }; export declare function loadTransactionComputePhase( - slice: Slice + slice: Slice, ): TransactionComputePhase; export declare function storeTransactionComputePhase( - src: TransactionComputePhase + src: TransactionComputePhase, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -2934,7 +2934,7 @@ export declare function parseTuple(src: Cell): TupleItem[]; */ export declare function bitsForNumber( src: bigint | number, - mode: 'int' | 'uint' + mode: 'int' | 'uint', ): number; /** * Copyright (c) Whales Corp. @@ -2991,7 +2991,7 @@ export type MasterchainStateExtra = { globalBalance: CurrencyCollection; }; export declare function loadMasterchainStateExtra( - cs: Slice + cs: Slice, ): MasterchainStateExtra; /** * Copyright (c) Whales Corp. @@ -3024,7 +3024,7 @@ export type HashUpdate = { }; export declare function loadHashUpdate(slice: Slice): HashUpdate; export declare function storeHashUpdate( - src: HashUpdate + src: HashUpdate, ): (builder: Builder) => void; /** * Copyright (c) Whales Corp. @@ -3144,7 +3144,7 @@ export declare class LevelMask { export declare function getRefsDescriptor( refs: Cell[], levelMask: number, - type: CellType + type: CellType, ): number; export declare function getBitsDescriptor(bits: BitString): number; export declare function getRepr( @@ -3153,7 +3153,7 @@ export declare function getRepr( refs: Cell[], level: number, levelMask: number, - type: CellType + type: CellType, ): Buffer; /** * Copyright (c) Whales Corp. @@ -3175,7 +3175,7 @@ export declare function exoticLibrary(bits: BitString, refs: Cell[]): {}; export declare function exoticMerkleProof( bits: BitString, - refs: Cell[] + refs: Cell[], ): { proofDepth: number; proofHash: Buffer; @@ -3191,7 +3191,7 @@ export declare function exoticMerkleProof( export declare function resolveExotic( bits: BitString, - refs: Cell[] + refs: Cell[], ): { type: CellType; depths: number[]; @@ -3224,7 +3224,7 @@ export declare function serializeBoc( opts: { idx: boolean; crc32: boolean; - } + }, ): Buffer; /** * Copyright (c) Whales Corp. @@ -3237,7 +3237,7 @@ export declare function serializeBoc( export declare function exoticMerkleUpdate( bits: BitString, - refs: Cell[] + refs: Cell[], ): { proofDepth1: number; proofDepth2: number; @@ -3262,7 +3262,7 @@ export type ExoticPruned = { }; export declare function exoticPruned( bits: BitString, - refs: Cell[] + refs: Cell[], ): ExoticPruned; /** * Copyright (c) Whales Corp. @@ -3284,7 +3284,7 @@ export {}; export declare function wonderCalculator( type: CellType, bits: BitString, - refs: Cell[] + refs: Cell[], ): { mask: LevelMask; hashes: Buffer[]; @@ -3316,7 +3316,7 @@ export {}; */ export declare function findCommonPrefix( src: string[], - startPos?: number + startPos?: number, ): string; /** * Copyright (c) Whales Corp. diff --git a/public/assets/ton/types/ton-sandbox.d.ts b/public/assets/ton/types/ton-sandbox.d.ts index 7f29eff..9611f83 100644 --- a/public/assets/ton/types/ton-sandbox.d.ts +++ b/public/assets/ton/types/ton-sandbox.d.ts @@ -93,8 +93,8 @@ export type SendMessageResult = { type ExtendsContractProvider = T extends ContractProvider ? true : T extends SandboxContractProvider - ? true - : false; + ? true + : false; export declare const SANDBOX_CONTRACT_SYMBOL: unique symbol; export type SandboxContract = { [P in keyof F]: P extends `get${string}` @@ -104,19 +104,19 @@ export type SandboxContract = { : never : never : P extends `send${string}` - ? F[P] extends (x: infer CP, ...args: infer P) => infer R - ? ExtendsContractProvider extends true - ? (...args: P) => Promise< - SendMessageResult & { - result: R extends Promise ? PR : R; - } - > + ? F[P] extends (x: infer CP, ...args: infer P) => infer R + ? ExtendsContractProvider extends true + ? (...args: P) => Promise< + SendMessageResult & { + result: R extends Promise ? PR : R; + } + > + : never : never - : never - : F[P]; + : F[P]; }; export declare function toSandboxContract( - contract: OpenedContract + contract: OpenedContract, ): SandboxContract; export type PendingMessage = ( | ({ @@ -172,53 +172,53 @@ export declare class Blockchain { get configBase64(): string; sendMessage( message: Message | Cell, - params?: MessageParams + params?: MessageParams, ): Promise; sendMessageIter( message: Message | Cell, - params?: MessageParams + params?: MessageParams, ): Promise< AsyncIterator & AsyncIterable >; runTickTock( on: Address | Address[], which: TickOrTock, - params?: MessageParams + params?: MessageParams, ): Promise; runGetMethod( address: Address, method: number | string, stack?: TupleItem[], - params?: GetMethodParams + params?: GetMethodParams, ): Promise; protected pushMessage(message: Message | Cell): Promise; protected pushTickTock(on: Address, which: TickOrTock): Promise; protected runQueue(params?: MessageParams): Promise; protected txIter( needsLocking: boolean, - params?: MessageParams + params?: MessageParams, ): AsyncIterator & AsyncIterable; protected processInternal( - params?: MessageParams + params?: MessageParams, ): Promise>; protected processTx( needsLocking: boolean, - params?: MessageParams + params?: MessageParams, ): Promise>; protected processQueue( - params?: MessageParams + params?: MessageParams, ): Promise; provider(address: Address, init?: StateInit | null): ContractProvider; sender(address: Address): Sender; protected treasuryParamsToMapKey(workchain: number, seed: string): string; treasury( seed: string, - params?: TreasuryParams + params?: TreasuryParams, ): Promise>; createWallets( n: number, - params?: TreasuryParams + params?: TreasuryParams, ): Promise[]>; openContract(contract: T): SandboxContract; protected startFetchingContract(address: Address): Promise; @@ -227,7 +227,7 @@ export declare class Blockchain { set verbosity(value: LogsVerbosity); setVerbosityForAddress( address: Address, - verbosity: Partial | Verbosity | undefined + verbosity: Partial | Verbosity | undefined, ): Promise; setConfig(config: BlockchainConfig): void; setShardAccount(address: Address, account: ShardAccount): Promise; @@ -255,7 +255,7 @@ export interface RemoteBlockchainStorageClient { getLastBlockSeqno(): Promise; getAccount( seqno: number, - address: Address + address: Address, ): Promise<{ state: AccountState; balance: bigint; @@ -273,7 +273,7 @@ export declare function wrapTonClient4ForRemote(client: { }>; getAccount( seqno: number, - address: Address + address: Address, ): Promise<{ account: { state: @@ -418,7 +418,7 @@ export declare class BlockchainSender implements Sender { blockchain: { pushMessage(message: Message): Promise; }, - address: Address + address: Address, ); send(args: SenderArguments): Promise; } @@ -483,7 +483,7 @@ export declare class GetMethodError extends Error { gasUsed: bigint, blockchainLogs: string, vmLogs: string, - debugLogs: string + debugLogs: string, ); } export declare class TimeError extends Error { @@ -499,7 +499,7 @@ export declare class EmulationError extends Error { constructor( error: string, vmLogs?: string | undefined, - exitCode?: number | undefined + exitCode?: number | undefined, ); } export type SmartContractSnapshot = { @@ -529,25 +529,25 @@ export declare class SmartContract { code: Cell; data: Cell; balance: bigint; - } + }, ): SmartContract; static empty(blockchain: Blockchain, address: Address): SmartContract; protected createCommonArgs(params?: MessageParams): RunCommonArgs; receiveMessage( message: Message, - params?: MessageParams + params?: MessageParams, ): Promise; runTickTock( which: TickOrTock, - params?: MessageParams + params?: MessageParams, ): Promise; protected runCommon( - run: () => Promise + run: () => Promise, ): Promise; get( method: string | number, stack?: TupleItem[], - params?: GetMethodParams + params?: GetMethodParams, ): Promise; get verbosity(): LogsVerbosity; set verbosity(value: LogsVerbosity); @@ -603,13 +603,13 @@ export declare class BlockchainContractProvider runGetMethod( address: Address, method: string, - args: TupleItem[] + args: TupleItem[], ): Promise; pushTickTock(on: Address, which: TickOrTock): Promise; openContract(contract: T): OpenedContract; }, address: Address, - init?: StateInit | null | undefined + init?: StateInit | null | undefined, ); open(contract: T): OpenedContract; getState(): Promise; @@ -618,7 +618,7 @@ export declare class BlockchainContractProvider address: Address, lt: bigint, hash: Buffer, - limit?: number | undefined + limit?: number | undefined, ): Promise; external(message: Cell): Promise; internal( @@ -628,7 +628,7 @@ export declare class BlockchainContractProvider bounce?: boolean | null; sendMode?: SendMode; body?: string | Cell | null; - } + }, ): Promise; tickTock(which: TickOrTock): Promise; } @@ -646,7 +646,7 @@ export declare class TreasuryContract implements Contract { sendMessages( provider: ContractProvider, messages: MessageRelaxed[], - sendMode?: SendMode + sendMode?: SendMode, ): Promise; send(provider: ContractProvider, args: SenderArguments): Promise; getSender(provider: ContractProvider): Treasury; @@ -679,7 +679,7 @@ export declare function testSubwalletId(seed: string): bigint; export declare function formatCoinsPure( value: bigint, - precision?: number + precision?: number, ): string; export declare function printTransactionFees(transactions: Transaction[]): void; export declare function getSelectorForMethod(methodName: string): number; diff --git a/public/html/testcases.html b/public/html/testcases.html index 65b89c2..edcd8e4 100644 --- a/public/html/testcases.html +++ b/public/html/testcases.html @@ -1,4 +1,4 @@ - + diff --git a/public/html/tonweb.html b/public/html/tonweb.html index 334840d..aedbc6d 100644 --- a/public/html/tonweb.html +++ b/public/html/tonweb.html @@ -1,4 +1,4 @@ - + @@ -58,14 +58,14 @@ let errorStack = error.stack.split("\n"); errorStack = errorStack .filter( - (line) => line.trim() !== "" && !line.includes("tonweb.html") + (line) => line.trim() !== "" && !line.includes("tonweb.html"), ) .map((item) => { // TODO: test this as cdn is not being used if (item.includes("ton-core.js")) { return item.replace( "https://cdn.jsdelivr.net/gh/rahulyadav-57/ton-standalone-libraries@master/dist/", - "" + "", ); } return item; diff --git a/src/components/project/NewProject/NewProject.tsx b/src/components/project/NewProject/NewProject.tsx index 2ccf3e2..718d416 100644 --- a/src/components/project/NewProject/NewProject.tsx +++ b/src/components/project/NewProject/NewProject.tsx @@ -77,7 +77,7 @@ const NewProject: FC = ({ language, values.template || 'import', values?.file?.file, - files + files, ); form.resetFields(); diff --git a/src/components/project/ProjectListing/ProjectListing.tsx b/src/components/project/ProjectListing/ProjectListing.tsx index 316f1eb..9ffdc08 100644 --- a/src/components/project/ProjectListing/ProjectListing.tsx +++ b/src/components/project/ProjectListing/ProjectListing.tsx @@ -12,12 +12,12 @@ const ProjectListing: FC = () => { const { projects, deleteProject } = useWorkspaceActions(); const { user } = useAuthAction(); const [projectToDelete, setProjectToDelete] = useState( - null + null, ); const deleteSelectedProject = async ( e: React.MouseEvent, - id: Project['id'] + id: Project['id'], ) => { e.preventDefault(); e.stopPropagation(); diff --git a/src/components/shared/LogView/LogView.tsx b/src/components/shared/LogView/LogView.tsx index ceb927a..ae661b3 100644 --- a/src/components/shared/LogView/LogView.tsx +++ b/src/components/shared/LogView/LogView.tsx @@ -51,7 +51,7 @@ const LogView: FC = ({ filter }) => { terminal.current!!.writeln( `${(colorMap as any)[data.type]}${data.text}${ colorMap.reset - } ${timestamp}` + } ${timestamp}`, ); }; @@ -119,7 +119,7 @@ const LogView: FC = ({ filter }) => { _terminal!!.writeln( `${(colorMap as any)['info']}Welcome to ${AppConfig.name} IDE${ colorMap.reset - }` + }`, ); _searchAddon.activate(_terminal); _fitAddon.fit(); diff --git a/src/components/workspace/ABIUi/ABIUi.tsx b/src/components/workspace/ABIUi/ABIUi.tsx index dc02528..20a2c3e 100644 --- a/src/components/workspace/ABIUi/ABIUi.tsx +++ b/src/components/workspace/ABIUi/ABIUi.tsx @@ -66,7 +66,7 @@ const ABIUi: FC = ({ language, abi?.kind, stack as any, - network + network, ); if (response?.logs) { @@ -81,7 +81,7 @@ const ABIUi: FC = ({ if (error.message.includes('no healthy nodes for')) { createLog( 'No healthy nodes for this network. Redeploy your contract.', - 'error' + 'error', ); return; } diff --git a/src/components/workspace/BuildProject/BuildProject.tsx b/src/components/workspace/BuildProject/BuildProject.tsx index 5a2cfea..a3e1725 100644 --- a/src/components/workspace/BuildProject/BuildProject.tsx +++ b/src/components/workspace/BuildProject/BuildProject.tsx @@ -106,7 +106,7 @@ const BuildProject: FC = ({ initParams: InitParams[]; }>(blankABI); const [selectedContract, setSelectedContract] = useState( - undefined + undefined, ); const { isAutoBuildAndDeployEnabled } = useSettingAction(); @@ -118,7 +118,7 @@ const BuildProject: FC = ({ const { sandboxBlockchain } = globalWorkspace; const tactVersion = packageJson.dependencies['@tact-lang/compiler'].replace( '^', - '' + '', ); const { Option } = Select; @@ -260,7 +260,7 @@ const BuildProject: FC = ({ if (initParamsData) { parametrsType = initParamsData.reduce( (acc: any, curr: any) => ((acc[curr.name] = curr.type), acc), - {} + {}, ); } @@ -335,7 +335,7 @@ const BuildProject: FC = ({ createLog( `Sandbox account created. Address: ${wallet.address.toString()}`, 'info', - false + false, ); } const { @@ -347,7 +347,7 @@ const BuildProject: FC = ({ buildOutput?.dataCell as any, environment.toLowerCase() as Network, activeProject!!, - contractABI.initParams + contractABI.initParams, ); Analytics.track('Deploy project', { @@ -358,9 +358,9 @@ const BuildProject: FC = ({ createLog( `Contract deployed on ${environment}
Contract address: ${_contractAddress} ${getContractLINK( _contractAddress, - environment + environment, )}`, - 'success' + 'success', ); for (let i = 0; i < (logs || []).length; i++) { @@ -379,7 +379,7 @@ const BuildProject: FC = ({ { contractAddress: _contractAddress, }, - projectId + projectId, ); } catch (error: any) { console.log(error, 'error'); @@ -411,12 +411,12 @@ const BuildProject: FC = ({ { 'tact.ts': contractScript?.content, }, - 'tact.ts' + 'tact.ts', ); } else { let stateInitContent = await getFileByPath( 'stateInit.cell.ts', - projectId + projectId, ); let cellCode = ''; if (stateInitContent && !stateInitContent.content && !initParams) { @@ -428,7 +428,7 @@ const BuildProject: FC = ({ { cellABI: { deploy: initParams }, }, - projectId + projectId, ); } else { cellCode = stateInitContent?.content || ''; @@ -439,7 +439,7 @@ const BuildProject: FC = ({ 'stateInit.cell.ts': cellCode, 'cell.ts': 'import cell from "./stateInit.cell.ts"; cell;', }, - 'cell.ts' + 'cell.ts', ); } @@ -468,7 +468,7 @@ const BuildProject: FC = ({ contractName: activeProject?.contractName, initParams, }, - '*' + '*', ); } catch (error: any) { setIsLoading(''); @@ -539,7 +539,7 @@ const BuildProject: FC = ({ return; } const singleItem = contractABI.types.find( - (type: any) => type.name === item.message.type + (type: any) => type.name === item.message.type, ); const singleField = { name: singleItem.name, @@ -591,7 +591,7 @@ const BuildProject: FC = ({ { network, }, - projectId + projectId, ); setEnvironment(network); }; @@ -603,7 +603,7 @@ const BuildProject: FC = ({ { selectedContract: contract, }, - projectId + projectId, ); }; @@ -625,7 +625,7 @@ const BuildProject: FC = ({ const getSelectedContractJsBuild = async ( currentContractName: String, language: 'tact' | 'func', - supressErrors = false + supressErrors = false, ) => { const contractScriptPath = currentContractName?.replace('.abi', '.ts'); const contractScript = await getFileByPath(contractScriptPath, projectId); @@ -640,7 +640,7 @@ const BuildProject: FC = ({ { 'tact.ts': contractScript?.content, }, - 'tact.ts' + 'tact.ts', ); const finalJsoutput = fromJSModule(jsOutout[0].code); @@ -665,7 +665,7 @@ const BuildProject: FC = ({ const output = await getSelectedContractJsBuild( selectedContract, 'tact', - true + true, ); if (!output) return; @@ -714,7 +714,7 @@ const BuildProject: FC = ({ type: string; data: any; error: string; - }> + }>, ) => { if ( !event.data || diff --git a/src/components/workspace/BuildProject/CellBuilder.tsx b/src/components/workspace/BuildProject/CellBuilder.tsx index d1b680d..936d737 100644 --- a/src/components/workspace/BuildProject/CellBuilder.tsx +++ b/src/components/workspace/BuildProject/CellBuilder.tsx @@ -132,7 +132,7 @@ const CellBuilder: FC = ({ info, projectId, type, form }) => { - ) + ), )} diff --git a/src/components/workspace/ContractInteraction/ContractInteraction.tsx b/src/components/workspace/ContractInteraction/ContractInteraction.tsx index b51ceda..8ba3951 100644 --- a/src/components/workspace/ContractInteraction/ContractInteraction.tsx +++ b/src/components/workspace/ContractInteraction/ContractInteraction.tsx @@ -49,7 +49,7 @@ const ContractInteraction: FC = ({ const contractCellContent = await getFileByPath( 'message.cell.ts', - projectId + projectId, ); if (contractCellContent && !contractCellContent.content && !cell) { throw 'Cell data is missing in file message.cell.ts'; @@ -60,7 +60,7 @@ const ContractInteraction: FC = ({ { cellABI: { setter: cell }, }, - projectId + projectId, ); } else { cellCode = contractCellContent?.content || ''; @@ -71,7 +71,7 @@ const ContractInteraction: FC = ({ 'message.cell.ts': cellCode, 'cell.ts': 'import cell from "./message.cell.ts"; cell;', }, - 'cell.ts' + 'cell.ts', ); const finalJsoutput = jsOutout[0].code .replace(/^import\s+{/, 'const {') @@ -83,7 +83,7 @@ const ContractInteraction: FC = ({ type: 'abi-data', code: finalJsoutput, }, - '*' + '*', ); } catch (error: any) { setIsLoading(''); @@ -92,7 +92,7 @@ const ContractInteraction: FC = ({ } createLog( 'Something went wrong. Check browser console for details.', - 'error' + 'error', ); throw error; } @@ -136,7 +136,7 @@ const ContractInteraction: FC = ({ useEffect(() => { const handler = async ( - event: MessageEvent<{ name: string; type: string; data: any }> + event: MessageEvent<{ name: string; type: string; data: any }>, ) => { if ( !event.data || diff --git a/src/components/workspace/Editor/Editor.tsx b/src/components/workspace/Editor/Editor.tsx index 7d121b7..2ab8ad9 100644 --- a/src/components/workspace/Editor/Editor.tsx +++ b/src/components/workspace/Editor/Editor.tsx @@ -71,7 +71,7 @@ const Editor: FC = ({ file, projectId, className = '' }) => { (window as any).MonacoEnvironment.getWorkerUrl = ( _: string, - label: string + label: string, ) => { if (label === 'typescript') { return '/_next/static/ts.worker.js'; @@ -82,7 +82,7 @@ const Editor: FC = ({ file, projectId, className = '' }) => { // await loader.init(); await highlightCodeSnippets( loader, - fileTypeFromFileName(file.name) as ContractLanguage + fileTypeFromFileName(file.name) as ContractLanguage, ); } diff --git a/src/components/workspace/Editor/EditorOnMount.ts b/src/components/workspace/Editor/EditorOnMount.ts index 2b012de..da67f2c 100644 --- a/src/components/workspace/Editor/EditorOnMount.ts +++ b/src/components/workspace/Editor/EditorOnMount.ts @@ -6,7 +6,7 @@ type Monaco = typeof monaco; export const editorOnMount = async ( editor: editor.IStandaloneCodeEditor, - monaco: Monaco + monaco: Monaco, ) => { // monaco.languages.typescript.typescriptDefaults.setCompilerOptions({ // // experimentalDecorators: false, @@ -48,7 +48,7 @@ export const editorOnMount = async ( }; // Filter snippets based on the word starts with the snippet label const filteredSnippets = tactSnippets.filter((snippet) => - snippet.label.startsWith(word.word) + snippet.label.startsWith(word.word), ); return { suggestions: filteredSnippets.map((snippet) => { @@ -116,10 +116,10 @@ export const editorOnMount = async ( monaco.languages.typescript.typescriptDefaults.addExtraLib( tonCoreText, - 'file:///node_modules/@types/ton__core/index.d.ts' + 'file:///node_modules/@types/ton__core/index.d.ts', ); monaco.languages.typescript.typescriptDefaults.addExtraLib( tonSanboxText, - 'file:///node_modules/@types/ton-community__sandbox/index.d.ts' + 'file:///node_modules/@types/ton-community__sandbox/index.d.ts', ); }; diff --git a/src/components/workspace/Editor/lsp.ts b/src/components/workspace/Editor/lsp.ts index 1a5f3b6..060a647 100644 --- a/src/components/workspace/Editor/lsp.ts +++ b/src/components/workspace/Editor/lsp.ts @@ -15,7 +15,7 @@ import ReconnectingWebSocket from 'reconnecting-websocket'; type Monaco = typeof monaco; export const createLanguageClient = ( - connection: MessageConnection + connection: MessageConnection, ): MonacoLanguageClient => { return new MonacoLanguageClient({ name: 'FunC Language Client', @@ -32,7 +32,7 @@ export const createLanguageClient = ( connectionProvider: { get: (errorHandler, closeHandler) => { return Promise.resolve( - createConnection(connection, errorHandler, closeHandler) + createConnection(connection, errorHandler, closeHandler), ); }, }, @@ -42,7 +42,7 @@ export const createLanguageClient = ( export const startLSP = async ( editor: editor.IStandaloneCodeEditor, monaco: Monaco, - lspWebSocket: WebSocket + lspWebSocket: WebSocket, ) => { console.log('AppConfig.lspServer', AppConfig.lspServer); if (!AppConfig.lspServer) { @@ -65,7 +65,7 @@ export const startLSP = async ( async (_, ...args: any[]) => { await navigator.clipboard.writeText(args.join('')); message.info(`Copied ${args.join(',')} to clipboard`); - } + }, ); }; diff --git a/src/components/workspace/ExecuteFile/ExecuteFile.tsx b/src/components/workspace/ExecuteFile/ExecuteFile.tsx index 924c200..6071994 100644 --- a/src/components/workspace/ExecuteFile/ExecuteFile.tsx +++ b/src/components/workspace/ExecuteFile/ExecuteFile.tsx @@ -80,7 +80,7 @@ const ExecuteFile: FC = ({ try { const buildResponse = (await compileTactProgram( selectedFile, - projectId + projectId, )) as Map; if (onCompile) { @@ -101,7 +101,7 @@ const ExecuteFile: FC = ({ return; } message.error( - 'Something went wrong. Check browser console for more details' + 'Something went wrong. Check browser console for more details', ); console.log('error', error); } diff --git a/src/components/workspace/TestCases/TestCases.tsx b/src/components/workspace/TestCases/TestCases.tsx index 0fe2408..38ce3cf 100644 --- a/src/components/workspace/TestCases/TestCases.tsx +++ b/src/components/workspace/TestCases/TestCases.tsx @@ -63,7 +63,7 @@ const TestCases: FC = ({ projectId }) => { if (contractPath && !contractFile) { createLog( `Contract file not found - ${contractPath}. Define correct absolute path. Ex. contracts/main.fc`, - 'error' + 'error', ); return; } @@ -74,12 +74,12 @@ const TestCases: FC = ({ projectId }) => { try { const contract = await compileFuncProgram( { path: contractPath }, - projectId + projectId, ); contractBOC = contract?.contractBOC; testCaseCode = testCaseCode.replace( contractCompileBlock?.[0], - `bocToCell("${contractBOC}")` + `bocToCell("${contractBOC}")`, ); testCaseCode = ` const { @@ -106,7 +106,7 @@ const TestCases: FC = ({ projectId }) => { .replace(/import\s*{/g, 'const {') .replace( /}\s*from\s*'@ton-community\/sandbox';/, - '} = require("@ton/sandbox");' + '} = require("@ton/sandbox");', ) .replace(/}\s*from\s*'@ton\/sandbox';/, '} = require("@ton/sandbox");') .replace(/}\s*from\s*'@ton\/core';/, '} = require("@ton/core");') @@ -143,7 +143,7 @@ const TestCases: FC = ({ projectId }) => { if (!data) return; createLog(data, 'info', true, true); }, - }) + }), ); Analytics.track('Execute Test Case', { platform: 'IDE', type: 'TON-func' }); }; diff --git a/src/components/workspace/WorkSpace/WorkSpace.tsx b/src/components/workspace/WorkSpace/WorkSpace.tsx index 531f30a..547587e 100644 --- a/src/components/workspace/WorkSpace/WorkSpace.tsx +++ b/src/components/workspace/WorkSpace/WorkSpace.tsx @@ -84,7 +84,7 @@ const WorkSpace: FC = () => { if (activeFile) return; const projectFiles = workspaceAction.projectFiles(activeProject.id); const mainFile = projectFiles.find((file) => - ['main.tact', 'main.fc'].includes(file.name) + ['main.tact', 'main.fc'].includes(file.name), ); if (!mainFile) return; workspaceAction.openFile(mainFile?.id, activeProject.id); diff --git a/src/components/workspace/tree/FileTree/FileTree.tsx b/src/components/workspace/tree/FileTree/FileTree.tsx index 0eafaac..2064a18 100644 --- a/src/components/workspace/tree/FileTree/FileTree.tsx +++ b/src/components/workspace/tree/FileTree/FileTree.tsx @@ -32,7 +32,7 @@ const FileTree: FC = ({ projectId }) => { workspaceAction.moveFile( options.dragSourceId as string, options.dropTargetId as string, - projectId + projectId, ); }; diff --git a/src/components/workspace/tree/FileTree/TreeNode.tsx b/src/components/workspace/tree/FileTree/TreeNode.tsx index 49c0640..4256a02 100644 --- a/src/components/workspace/tree/FileTree/TreeNode.tsx +++ b/src/components/workspace/tree/FileTree/TreeNode.tsx @@ -89,7 +89,7 @@ const TreeNode: FC = ({ node, depth, isOpen, onToggle }) => { const isAllowed = () => { const isEditingItem = document.body.classList.contains( - 'editing-file-folder' + 'editing-file-folder', ); if (!isEditingItem) { document.body.classList.add('editing-file-folder'); diff --git a/src/hooks/ApiClient.hooks.ts b/src/hooks/ApiClient.hooks.ts index a2500ff..6457f62 100644 --- a/src/hooks/ApiClient.hooks.ts +++ b/src/hooks/ApiClient.hooks.ts @@ -79,7 +79,7 @@ function useApiClient() { } return Promise.reject(error); - } + }, ); } } diff --git a/src/hooks/contract.hooks.ts b/src/hooks/contract.hooks.ts index 4fb52eb..83dd893 100644 --- a/src/hooks/contract.hooks.ts +++ b/src/hooks/contract.hooks.ts @@ -55,7 +55,7 @@ export function useContractAction() { dataCell: string, network: Network | Partial, project: Project, - initParams: InitParams[] + initParams: InitParams[], ): Promise<{ address: string; contract?: SandboxContract; @@ -86,7 +86,7 @@ export function useContractAction() { if (initParams && initParams?.length > 0) { const hasQueryId = initParams?.findIndex( - (item) => item.name == 'queryId' + (item) => item.name == 'queryId', ); const queryId = BigInt(0); if (hasQueryId > -1) { @@ -125,13 +125,13 @@ export function useContractAction() { { value: tonAmountForInteraction, }, - messageParams + messageParams, ); let logMessages: string[] = []; if (response) { logMessages = terminalLogMessages( [response], - [_userContract as Contract] + [_userContract as Contract], ); } @@ -157,13 +157,13 @@ export function useContractAction() { if (network.toUpperCase() === 'SANDBOX' && sandboxBlockchain) { const _userContract = UserContract.createForDeploy( stateInit.code as Cell, - stateInit.data as Cell + stateInit.data as Cell, ); const userContract = sandboxBlockchain.openContract(_userContract); const response = await userContract.sendData( sandboxWallet!!.getSender(), Cell.EMPTY, - tonAmountForInteraction + tonAmountForInteraction, ); if (network.toUpperCase() !== 'SANDBOX') { message.success('Contract Deployed'); @@ -183,7 +183,7 @@ export function useContractAction() { if (await client.isContractDeployed(_contractAddress)) { message.error( - 'Contract is already deployed for same codebase and initial state. Update code or initial state.' + 'Contract is already deployed for same codebase and initial state. Update code or initial state.', ); return { address: _contractAddress.toString() }; } @@ -218,7 +218,7 @@ export function useContractAction() { contractAddress: string, contract: SandboxContract | null = null, network: Network | Partial, - wallet: SandboxContract + wallet: SandboxContract, ) { const _dataCell = Cell.fromBoc(Buffer.from(dataCell as any, 'base64'))[0]; if (network.toUpperCase() === 'SANDBOX') { @@ -229,7 +229,7 @@ export function useContractAction() { const call = await contract.sendData( wallet.getSender(), _dataCell, - tonAmountForInteraction + tonAmountForInteraction, ); return; } @@ -260,7 +260,7 @@ export function useContractAction() { language: ContractLanguage, kind?: string, stack?: TupleItem[], - network?: Network | Partial + network?: Network | Partial, ): Promise<{ message: string; logs?: string[] } | undefined> { if (language === 'tact' && contract) { let sender: Sender | null = null; @@ -303,7 +303,7 @@ export function useContractAction() { const response = await (contract as any).send( sender, { value: tonAmountForInteraction }, - messageParams + messageParams, ); return { message: 'Message sent successfully', @@ -326,7 +326,7 @@ export function useContractAction() { language: ContractLanguage, kind?: string, stack?: TupleItem[] | any, - network?: Network | Partial + network?: Network | Partial, ): Promise<{ message: string; logs?: string[] } | undefined | any> { const parsedStack = stack?.map((item: any) => { switch (item.type as ParameterType) { @@ -351,7 +351,7 @@ export function useContractAction() { return { type: item.type, value: Cell.fromBoc( - Buffer.from((item as any).value.toString(), 'base64') + Buffer.from((item as any).value.toString(), 'base64'), )[0], }; } @@ -396,7 +396,7 @@ export function useContractAction() { const call = await client.runMethod( Address.parse(contractAddress), methodName, - stack + stack, ); const responseValues = []; @@ -410,7 +410,7 @@ export function useContractAction() { export class UserContract implements Contract { constructor( readonly address: Address, - readonly init?: { code: Cell; data: Cell } + readonly init?: { code: Cell; data: Cell }, ) {} static createForDeploy(code: Cell, data: Cell) { @@ -423,7 +423,7 @@ export class UserContract implements Contract { provider: ContractProvider, via: Sender, body: Cell = Cell.EMPTY, - amount: bigint + amount: bigint, ) { await provider.internal(via, { value: amount, @@ -435,7 +435,7 @@ export class UserContract implements Contract { async getData( provider: ContractProvider, methodName: string, - stackInput: TupleItem[] = [] + stackInput: TupleItem[] = [], ) { return provider.get(methodName, stackInput); } @@ -487,7 +487,7 @@ class TonConnectSender implements Sender { ) ) { throw new Error( - 'Deployer sender does not support `sendMode` other than `PAY_GAS_SEPARATELY`' + 'Deployer sender does not support `sendMode` other than `PAY_GAS_SEPARATELY`', ); } @@ -514,7 +514,7 @@ class TonConnectSender implements Sender { // Credit for below log message parsing: https://github.com/tact-lang/tact-by-example/blob/main/src/routes/(examples)/%2Blayout.svelte function terminalLogMessages( results: SendMessageResult[] = [], - contractInstances: Contract[] + contractInstances: Contract[], ) { const messages = []; for (const result of results) { @@ -541,14 +541,14 @@ function terminalLogMessages( }, ` + `Exit Code: ${compute.exitCode}, Gas: ${shorten( compute.gasFees, - 'coins' - )}` + 'coins', + )}`, ); let foundError = false; for (const contractInstance of contractInstances) { if ( transaction.inMessage?.info.dest.equals( - contractInstance.address + contractInstance.address, ) ) { if (compute.exitCode == -14) compute.exitCode = 13; @@ -605,7 +605,7 @@ function terminalLogMessages( if (outMessage.info.dest == null) { const name = messageName(outMessage.body, contractInstances); messages.push( - `Log emitted: ${name}, from ${shorten(outMessage.info.src)}` + `Log emitted: ${name}, from ${shorten(outMessage.info.src)}`, ); } } @@ -615,11 +615,11 @@ function terminalLogMessages( const name = messageName(event.body, contractInstances); messages.push( `Message sent: ${name}, from ${shorten(event.from)}, to ${shorten( - event.to + event.to, )}, ` + `value ${shorten(event.value, 'coins')}, ${ event.bounced ? '' : 'not ' - }bounced` + }bounced`, ); } } @@ -652,7 +652,7 @@ function messageName(body: Cell, contractInstances: Contract[]): string { function shorten( long: Address | bigint, - format: 'default' | 'coins' = 'default' + format: 'default' | 'coins' = 'default', ) { if (long instanceof Address) { return `${long.toString().slice(0, 4)}..${long.toString().slice(-4)}`; diff --git a/src/hooks/logActivity.hooks.ts b/src/hooks/logActivity.hooks.ts index e86bb25..6393f0b 100644 --- a/src/hooks/logActivity.hooks.ts +++ b/src/hooks/logActivity.hooks.ts @@ -33,7 +33,7 @@ export function useLogActivity() { text: string, type: LogType = 'info', allowDuplicate = true, - disableTimestamp = false + disableTimestamp = false, ): void { if ( !allowDuplicate && diff --git a/src/hooks/project.hooks.ts b/src/hooks/project.hooks.ts index bcf121a..49a32a4 100644 --- a/src/hooks/project.hooks.ts +++ b/src/hooks/project.hooks.ts @@ -56,7 +56,7 @@ export function useProjectActions() { language: ContractLanguage, template: ProjectTemplate, file: RcFile | null, - defaultFiles?: Tree[] + defaultFiles?: Tree[], ) { let { files, filesWithId } = template === 'import' && defaultFiles?.length == 0 @@ -76,7 +76,7 @@ export function useProjectActions() { const commonFiles = createTemplateBasedProject( 'import', language, - commonProjectFiles + commonProjectFiles, ); files = [...files, ...commonFiles.files]; filesWithId = [...filesWithId, ...commonFiles.filesWithId]; @@ -97,7 +97,7 @@ export function useProjectActions() { async function compileFuncProgram( file: Pick, - projectId: Project['id'] + projectId: Project['id'], ) { const fileList: any = {}; @@ -170,14 +170,14 @@ export function useProjectActions() { }, ], 'dist', - projectId + projectId, ); return { contractBOC: (buildResult as SuccessResult).codeBoc }; } async function compileTactProgram( file: Pick, - projectId: Project['id'] + projectId: Project['id'], ) { const fileList: { [key: string]: string } = {}; @@ -286,7 +286,7 @@ export function useProjectActions() { const unresolvedPromises = Object.values(fileList).map( async (file: any) => { return await parseGetters(file.content); - } + }, ); const results = await Promise.all(unresolvedPromises); return results[0]; @@ -296,7 +296,7 @@ export function useProjectActions() { const createTemplateBasedProject = ( template: 'tonBlank' | 'tonCounter' | 'import', language: ContractLanguage = 'tact', - files: Tree[] = [] + files: Tree[] = [], ) => { let _files: Tree[] = cloneDeep(files); if (files.length === 0 && template !== 'import') { @@ -321,7 +321,7 @@ const createTemplateBasedProject = ( const importUserFile = async ( file: RcFile, - language: ContractLanguage = 'tact' + language: ContractLanguage = 'tact', ) => { const sysrootArchiveReader = new ZipReader(new BlobReader(file)); const sysrootArchiveEntries = await sysrootArchiveReader.getEntries(); @@ -387,7 +387,7 @@ const importUserFile = async ( commonFiles = createTemplateBasedProject( 'import', language, - commonProjectFiles + commonProjectFiles, ); } @@ -400,7 +400,7 @@ const importUserFile = async ( const getInitParams = ( ctx: CompilerContext, contractName: string, - abi: any + abi: any, ) => { const contactType = getType(ctx, contractName); let initParams: { name: string; type: string; optional: boolean }[] = []; @@ -415,7 +415,7 @@ const getInitParams = ( }) ?? []; const deployFields = abi.types.find( - (item: any) => item.name === 'Deploy' + (item: any) => item.name === 'Deploy', )?.fields; if (deployFields && deployFields.length > 0) { diff --git a/src/hooks/setting.hooks.ts b/src/hooks/setting.hooks.ts index f443b2e..3c47b0e 100644 --- a/src/hooks/setting.hooks.ts +++ b/src/hooks/setting.hooks.ts @@ -67,7 +67,7 @@ export function useSettingAction() { } function toggleAutoBuildAndDeploy( - active: boolean = !setting.autoBuildAndDeploy + active: boolean = !setting.autoBuildAndDeploy, ) { return updateStateByKey({ autoBuildAndDeploy: active, diff --git a/src/hooks/workspace.hooks.ts b/src/hooks/workspace.hooks.ts index e8b1f47..4b13c74 100644 --- a/src/hooks/workspace.hooks.ts +++ b/src/hooks/workspace.hooks.ts @@ -90,7 +90,7 @@ function useWorkspaceActions() { function updateProjectList( projectId: string, - projectListItem: Project | any + projectListItem: Project | any, ) { const projectIndex = projects().findIndex((item) => item.id === projectId); if (projectIndex < 0) { @@ -173,7 +173,7 @@ function useWorkspaceActions() { function updateOpenFile( id: Tree['id'], data: Partial, - projectId: Project['id'] + projectId: Project['id'], ) { const openFiles = openedFiles(projectId).map((item) => { if (item.id === id) { @@ -192,7 +192,7 @@ function useWorkspaceActions() { function onFileRename( fileId: Tree['id'], name: string, - projectId: Project['id'] + projectId: Project['id'], ) { let files = cloneDeep(openedFiles(projectId)); if (!files) return; @@ -218,7 +218,7 @@ function useWorkspaceActions() { async function getFileById( id: Tree['id'], - projectId: string + projectId: string, ): Promise { const file = projectFiles(projectId).find((file) => file.id === id); const fileContent = await getFileContent(id); @@ -233,7 +233,7 @@ function useWorkspaceActions() { async function getFileByPath( path: Tree['path'], - projectId: string + projectId: string, ): Promise { const file = projectFiles(projectId).find((file) => file.path === path); if (!file) { @@ -246,7 +246,7 @@ function useWorkspaceActions() { async function updateFileContent( id: Tree['id'], content: string, - projectId: Project['id'] + projectId: Project['id'], ) { await fileSystem.files.update(id, { content }); updateOpenFile(id, { isDirty: false }, projectId); @@ -307,7 +307,7 @@ function useWorkspaceActions() { } item.project = item.project.filter( - (file: any) => file.id !== id && file.parent !== id + (file: any) => file.id !== id && file.parent !== id, ); closeFile(id, projectId); @@ -317,7 +317,7 @@ function useWorkspaceActions() { async function moveFile( sourceId: Tree['id'], destinationId: Tree['id'], - projectId: Project['id'] + projectId: Project['id'], ) { let parent = destinationId ? destinationId : null; @@ -347,7 +347,7 @@ function useWorkspaceActions() { name: string, type: string, projectId: string, - content: string = '' + content: string = '', ) { let parentId = id; let itemName = name; @@ -377,7 +377,7 @@ function useWorkspaceActions() { type, itemName, parentId as string, - filePath || '' + filePath || '', ); if (type === 'file') { await fileSystem.files.add({ id: newItem.id, content: content }); @@ -391,7 +391,7 @@ function useWorkspaceActions() { async function createFiles( files: Pick[], directoryPath: string, - projectId: string + projectId: string, ) { let _projectFiles = cloneDeep(projectFiles(projectId)); // check if file name contains directory. Then create a directory first and then create a file @@ -411,7 +411,7 @@ function useWorkspaceActions() { 'file', fileName!!, directoryItem?.id || '', - directoryPath || '' + directoryPath || '', ); isNewFile = true; } @@ -428,7 +428,7 @@ function useWorkspaceActions() { if (isNewFile) { _projectFiles.push(currentFile); } - }) + }), ); updateProjectFiles(_projectFiles, projectId); } @@ -436,19 +436,19 @@ function useWorkspaceActions() { function isFileExists( name: string, projectId: string, - parentId: string = '' + parentId: string = '', ): boolean { let exists = false; if (!parentId) { exists = !!( projectFiles(projectId).findIndex( - (file) => file.parent == null && file.name === name + (file) => file.parent == null && file.name === name, ) >= 0 ); } else { exists = projectFiles(projectId).findIndex( - (file) => file.parent === parentId && file.name === name + (file) => file.parent === parentId && file.name === name, ) >= 0; } if (exists) { @@ -464,7 +464,7 @@ function useWorkspaceActions() { function searchNode( id: string, projectId: string, - key: 'id' | 'parent' = 'id' + key: 'id' | 'parent' = 'id', ): { node: Tree | null; project: Tree[] } { let projectTemp = cloneDeep(projectFiles(projectId)); const node = projectTemp.find((file) => file[key] === id); @@ -476,7 +476,7 @@ function useWorkspaceActions() { type: string, name: string, parent: string, - parentPath: string + parentPath: string, ) { return { id: v4(), @@ -494,7 +494,7 @@ function useWorkspaceActions() { } const tsFiles = projectFiles(projectId).filter((f) => - f.name.endsWith('.ts') + f.name.endsWith('.ts'), ); const filesWithContent: any = {}; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 165b961..61fe267 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -49,14 +49,14 @@ export default function App({ }); const installProcess = await (window as any).webcontainerInstance.spawn( 'npm', - ['install'] + ['install'], ); installProcess.output.pipeTo( new WritableStream({ write(data) { console.log('data', data); }, - }) + }), ); // Wait for install command to exit return installProcess.exit; diff --git a/src/pages/api/hello.ts b/src/pages/api/hello.ts index 89e4d6b..46714b3 100644 --- a/src/pages/api/hello.ts +++ b/src/pages/api/hello.ts @@ -7,7 +7,7 @@ type Data = { export default function handler( req: NextApiRequest, - res: NextApiResponse + res: NextApiResponse, ) { res.status(200).json({ name: 'John Doe' }); } diff --git a/src/utility/getterParser.ts b/src/utility/getterParser.ts index a7813b4..16523db 100644 --- a/src/utility/getterParser.ts +++ b/src/utility/getterParser.ts @@ -42,7 +42,7 @@ export async function parseGetters(code: string): Promise { await initParser( '/assets/ton/tree-sitter.wasm', - '/assets/ton//tree-sitter-func.wasm' + '/assets/ton//tree-sitter-func.wasm', ); const p = createParser(); const parsed = p.parse(code); @@ -52,7 +52,7 @@ export async function parseGetters(code: string): Promise { c.type === 'function_definition' && c.children .find((n) => n.type === 'specifiers_list') - ?.text.includes('method_id') + ?.text.includes('method_id'), ); const gettersParsed = getters.map((f) => { @@ -87,7 +87,7 @@ export async function extractCompilerDiretive(code: string): Promise { await initParser( '/assets/ton/tree-sitter.wasm', - '/assets/ton//tree-sitter-func.wasm' + '/assets/ton//tree-sitter-func.wasm', ); const p = createParser(); const parsed = p.parse(code); diff --git a/src/utility/gitRepoDownloader.ts b/src/utility/gitRepoDownloader.ts index 7162143..a9acf25 100644 --- a/src/utility/gitRepoDownloader.ts +++ b/src/utility/gitRepoDownloader.ts @@ -28,7 +28,7 @@ function validateAndTransformPath(repoURL: string): string { async function convertToCustomFormat( data: any[], parent = null, - parentPath = '' + parentPath = '', ) { const result = []; @@ -61,7 +61,7 @@ async function convertToCustomFormat( const subDirItems: any[] = await convertToCustomFormat( subDirContents, item.sha, - dirName + dirName, ); result.push(...subDirItems); } diff --git a/src/utility/syntaxHighlighter.ts b/src/utility/syntaxHighlighter.ts index a03a2c8..16fcefe 100644 --- a/src/utility/syntaxHighlighter.ts +++ b/src/utility/syntaxHighlighter.ts @@ -12,7 +12,7 @@ let onigasmLoaded = false; export async function highlightCodeSnippets( loader: any, - _language: ContractLanguage + _language: ContractLanguage, ): Promise { let ftmLanguage = { func: funcTMLanguage, @@ -23,7 +23,7 @@ export async function highlightCodeSnippets( if (!onigasmLoaded) { try { await loadWASM( - 'https://cdn.jsdelivr.net/npm/onigasm@2.2.5/lib/onigasm.wasm' + 'https://cdn.jsdelivr.net/npm/onigasm@2.2.5/lib/onigasm.wasm', ); onigasmLoaded = true; } catch {} @@ -91,7 +91,7 @@ export async function highlightCodeSnippets( monaco.languages.setLanguageConfiguration( language, - languageConfiguration + languageConfiguration, ); wireTmGrammars(monaco, registry, grammars); } diff --git a/src/utility/tonProof.ts b/src/utility/tonProof.ts index 299548d..52d3818 100644 --- a/src/utility/tonProof.ts +++ b/src/utility/tonProof.ts @@ -22,7 +22,7 @@ interface ParsedMessage { export function SignatureVerify( pubkey: Buffer, message: Buffer, - signature: Buffer + signature: Buffer, ): boolean { return nacl.sign.detached.verify(message, signature, pubkey); } @@ -63,7 +63,7 @@ export async function CreateMessage(message: ParsedMessage): Promise { export function ConvertTonProofMessage( walletInfo: Wallet, - tp: TonProofItemReplySuccess + tp: TonProofItemReplySuccess, ): ParsedMessage { const address = Address.parse(walletInfo.account.address); diff --git a/src/utility/typescriptHelper.ts b/src/utility/typescriptHelper.ts index b4cdef0..1862d29 100644 --- a/src/utility/typescriptHelper.ts +++ b/src/utility/typescriptHelper.ts @@ -11,7 +11,7 @@ async function buildTs(file: any, rootFile: Tree['path']) { { format: 'es', name: 'bundle', - } + }, ); return result; diff --git a/src/utility/utils.ts b/src/utility/utils.ts index 43cc474..dd7809e 100644 --- a/src/utility/utils.ts +++ b/src/utility/utils.ts @@ -19,7 +19,7 @@ export const isWebAssemblySupported = () => { typeof WebAssembly.instantiate === 'function' ) { const assemblyModule = new WebAssembly.Module( - Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00) + Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00), ); if (assemblyModule instanceof WebAssembly.Module) return ( @@ -65,7 +65,7 @@ export const debounce = (callback: T, delay: number) => { export const getContractLINK = ( contractAddress: string, - chainNetwork: NetworkEnvironment + chainNetwork: NetworkEnvironment, ) => { // if (chainNetwork === 'SANDBOX') { // return ''; @@ -82,7 +82,7 @@ export const getContractLINK = ( export const getContractURL = ( contractAddress: string, - chainNetwork: NetworkEnvironment + chainNetwork: NetworkEnvironment, ) => { if (chainNetwork === 'SANDBOX') { return contractAddress; @@ -109,7 +109,7 @@ export const htmlToAnsi = (html: string) => { reset: '\x1b[0m', }; return `${colorMap[color]}${content}${colorMap.reset}`; - } + }, ); // Remove other HTML tags