@fileverse-dev/dsheet 2.1.5 → 3.0.1-yjs-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/{constants-yStXQJiK.js → constants-Cdz6oSCq.js} +5 -7
  2. package/dist/constants.js +1 -1
  3. package/dist/editor/components/api-key-modal/api-key-input.d.ts +5 -0
  4. package/dist/editor/components/api-key-modal/api-key-modal.d.ts +7 -0
  5. package/dist/editor/components/api-key-modal/rate-limit-info.d.ts +4 -0
  6. package/dist/editor/components/comments/comment-actions-dropdown.d.ts +19 -0
  7. package/dist/editor/components/comments/comment-cell-popup.d.ts +4 -0
  8. package/dist/editor/components/comments/comment-input.d.ts +4 -0
  9. package/dist/editor/components/comments/comment-item.d.ts +4 -0
  10. package/dist/editor/components/comments/comment-sidebar-empty.d.ts +4 -0
  11. package/dist/editor/components/comments/comment-sidebar.d.ts +4 -0
  12. package/dist/editor/components/comments/ens/ens-cache.d.ts +10 -0
  13. package/dist/editor/components/comments/ens/use-ens-status.d.ts +10 -0
  14. package/dist/editor/components/comments/use-comment-cell-popup.d.ts +12 -0
  15. package/dist/editor/components/comments/use-comment-permissions.d.ts +15 -0
  16. package/dist/editor/components/editor-workbook.d.ts +11 -17
  17. package/dist/editor/components/sidebar/editor-right-sidebar.d.ts +20 -0
  18. package/dist/editor/components/sidebar/right-sidebar.d.ts +14 -0
  19. package/dist/editor/components/sidebar/sidebar-context.d.ts +17 -0
  20. package/dist/editor/components/sidebar/sidebar-portal-registry.d.ts +20 -0
  21. package/dist/editor/components/sidebar/use-right-panels.d.ts +12 -0
  22. package/dist/editor/components/sidebars/conditional-format.d.ts +2 -0
  23. package/dist/editor/components/sidebars/data-verification.d.ts +2 -0
  24. package/dist/editor/components/sidebars/function/function-categories-logic.d.ts +11 -0
  25. package/dist/editor/components/sidebars/function/function-categories.d.ts +6 -0
  26. package/dist/editor/components/sidebars/function/function-metadata.d.ts +7 -0
  27. package/dist/editor/components/sidebars/function/functionList.d.ts +8 -0
  28. package/dist/editor/components/sidebars/function/types.d.ts +24 -0
  29. package/dist/editor/components/sidebars/function/use-functions.d.ts +20 -0
  30. package/dist/editor/components/sidebars/function-content.d.ts +8 -0
  31. package/dist/editor/components/sidebars/template-ui.d.ts +22 -0
  32. package/dist/editor/components/sidebars/templates.d.ts +9 -0
  33. package/dist/editor/components/smart-contract/error-toast.d.ts +11 -0
  34. package/dist/editor/components/smart-contract/modal/abi-input-section.d.ts +11 -0
  35. package/dist/editor/components/smart-contract/modal/contract-name-section.d.ts +13 -0
  36. package/dist/editor/components/smart-contract/modal/file-upload-section.d.ts +12 -0
  37. package/dist/editor/components/smart-contract/modal/import-section.d.ts +8 -0
  38. package/dist/editor/components/smart-contract/modal/modal-header.d.ts +17 -0
  39. package/dist/editor/components/smart-contract/smart-contract-list-item.d.ts +8 -0
  40. package/dist/editor/components/smart-contract/smart-contract-modal-ui.d.ts +33 -0
  41. package/dist/editor/components/smart-contract/smart-contract-modal.d.ts +12 -0
  42. package/dist/editor/components/smart-contract/smart-contract-reading-intro.d.ts +4 -0
  43. package/dist/editor/components/smart-contract/smart-contract-view-list.d.ts +6 -0
  44. package/dist/editor/components/smart-contract/use-address-validation.d.ts +5 -0
  45. package/dist/editor/components/smart-contract/use-modal-outside-click.d.ts +18 -0
  46. package/dist/editor/components/smart-contract/use-smart-contract-modal.d.ts +38 -0
  47. package/dist/editor/constants/shared-constants.d.ts +0 -2
  48. package/dist/editor/contexts/editor-context.d.ts +20 -5
  49. package/dist/editor/dsheet-editor.d.ts +1 -1
  50. package/dist/editor/hooks/live-query/use-live-query.d.ts +4 -2
  51. package/dist/editor/hooks/use-editor-data.d.ts +4 -2
  52. package/dist/editor/hooks/use-smart-contract.d.ts +26 -0
  53. package/dist/editor/hooks/use-xlsx-import-impl.d.ts +7 -1
  54. package/dist/editor/types/comments.d.ts +134 -0
  55. package/dist/editor/types/smart-contract.d.ts +88 -0
  56. package/dist/editor/types.d.ts +39 -32
  57. package/dist/editor/utils/after-update-cell.d.ts +13 -8
  58. package/dist/editor/utils/api-key-storage.d.ts +6 -0
  59. package/dist/editor/utils/api-keys-local-storage.d.ts +19 -0
  60. package/dist/editor/utils/cell-comment-marker.d.ts +30 -0
  61. package/dist/editor/utils/comment-key-utils.d.ts +7 -0
  62. package/dist/editor/utils/config-ydoc-update.d.ts +20 -0
  63. package/dist/editor/utils/csv-import.d.ts +3 -1
  64. package/dist/editor/utils/data-block-error-handler.d.ts +21 -0
  65. package/dist/editor/utils/datablock-error-utils.d.ts +1 -0
  66. package/dist/editor/utils/sheet-editor-safe.d.ts +26 -0
  67. package/dist/editor/utils/smart-contract/constants.d.ts +488 -0
  68. package/dist/editor/utils/smart-contract/error-helper.d.ts +20 -0
  69. package/dist/editor/utils/smart-contract/helpers.d.ts +4 -0
  70. package/dist/editor/utils/smart-contract/reading-utils.d.ts +34 -0
  71. package/dist/editor/utils/smart-contract/signature-utils.d.ts +9 -0
  72. package/dist/editor/utils/spreadsheet-import.d.ts +12 -0
  73. package/dist/executeStringFunction-B2qjYgmE.js +31914 -0
  74. package/dist/formula.js +1 -1
  75. package/dist/index-C7kCuqoG.js +54326 -0
  76. package/dist/index.d.ts +11 -1
  77. package/dist/index.es.js +54 -48
  78. package/dist/observability/publish-trace.d.ts +26 -0
  79. package/dist/sheet-engine/core/api/cell.d.ts +0 -20
  80. package/dist/sheet-engine/core/api/common.d.ts +2 -1
  81. package/dist/sheet-engine/core/api/index.d.ts +1 -0
  82. package/dist/sheet-engine/core/api/sheet-flowdata-lifecycle.d.ts +15 -0
  83. package/dist/sheet-engine/core/api/sheet.d.ts +5 -0
  84. package/dist/sheet-engine/core/context.d.ts +5 -0
  85. package/dist/sheet-engine/core/index.d.ts +1 -1
  86. package/dist/sheet-engine/core/modules/formula-async-eval.d.ts +53 -0
  87. package/dist/sheet-engine/core/modules/formula-eval.worker.d.ts +1 -0
  88. package/dist/sheet-engine/core/modules/formula-range-cache.d.ts +20 -0
  89. package/dist/sheet-engine/core/modules/formula-snapshot-eval.d.ts +40 -0
  90. package/dist/sheet-engine/core/modules/formula-transitive-deps.d.ts +7 -0
  91. package/dist/sheet-engine/core/modules/formula-worker-bridge.d.ts +17 -0
  92. package/dist/sheet-engine/core/modules/formula-worker-types.d.ts +24 -0
  93. package/dist/sheet-engine/core/modules/formula.d.ts +26 -1
  94. package/dist/sheet-engine/core/modules/index.d.ts +3 -1
  95. package/dist/sheet-engine/core/paste/paste-border-utils.d.ts +23 -0
  96. package/dist/sheet-engine/core/theme.d.ts +67 -0
  97. package/dist/sheet-engine/core/types.d.ts +3 -0
  98. package/dist/sheet-engine/core/utils/border-config-utils.d.ts +10 -0
  99. package/dist/sheet-engine/core/utils/cell-persist-utils.d.ts +8 -0
  100. package/dist/sheet-engine/core/utils/range-format.d.ts +43 -0
  101. package/dist/sheet-engine/react/components/SheetOverlay/Icon.d.ts +5 -4
  102. package/dist/sheet-engine/react/components/SheetOverlay/LucideIcon.d.ts +4 -4
  103. package/dist/sheet-engine/react/components/SidebarPanelPortals/index.d.ts +17 -0
  104. package/dist/sheet-engine/react/components/Workbook/api.d.ts +8 -1
  105. package/dist/sheet-engine/react/components/Workbook/index.d.ts +11 -1
  106. package/dist/sheet-engine/react/components/index.d.ts +1 -0
  107. package/dist/sheet-engine/react/utils/datepickerStyles.d.ts +1 -1
  108. package/dist/style.css +1 -1
  109. package/dist/use-xlsx-import-impl-BQsXcyKJ.js +1551 -0
  110. package/dist/{xlsx-export-impl-DP_eK3zS.js → xlsx-export-impl-BBux0CIG.js} +1106 -1106
  111. package/package.json +6 -4
  112. package/dist/executeStringFunction-BkmJj04p.js +0 -27295
  113. package/dist/index-Drl8OuI3.js +0 -52659
  114. package/dist/sheet-engine/react/components/Toolbar/conditionalFormatPortal.d.ts +0 -7
  115. package/dist/sheet-engine/react/components/Toolbar/dataVerificationPortal.d.ts +0 -6
  116. package/dist/use-xlsx-import-impl-DC_BfAcT.js +0 -1527
@@ -0,0 +1,20 @@
1
+ import { WorkbookInstance } from '../../sheet-engine/react';
2
+ import { SheetChangePath } from './update-ydoc';
3
+
4
+ import * as Y from 'yjs';
5
+ /** Diff top-level config sub-keys and emit granular Yjs updates. */
6
+ export declare function buildConfigSubKeyChanges({ sheetId, oldConfig, newConfig, }: {
7
+ sheetId: string;
8
+ oldConfig: Record<string, any>;
9
+ newConfig: Record<string, any>;
10
+ }): SheetChangePath[];
11
+ /**
12
+ * Sync active sheet config sub-keys to Yjs (borderInfo, merge, rowlen, …).
13
+ * Replaces whole-config writes so only changed sub-keys are broadcast.
14
+ */
15
+ export declare const configYdocUpdate: ({ sheetEditorRef, ydocRef, dsheetId, handleContentPortal, }: {
16
+ sheetEditorRef: React.RefObject<WorkbookInstance | null>;
17
+ ydocRef: React.RefObject<Y.Doc | null>;
18
+ dsheetId: string;
19
+ handleContentPortal?: any;
20
+ }) => void;
@@ -2,4 +2,6 @@ import { default as React } from 'react';
2
2
  import { WorkbookInstance } from '../../sheet-engine/react';
3
3
 
4
4
  import * as Y from 'yjs';
5
- export declare const handleCSVUpload: (event: React.ChangeEventHandler<HTMLInputElement> | undefined, ydoc: Y.Doc | null, setForceSheetRender: React.Dispatch<React.SetStateAction<number>>, dsheetId: string, currentDataRef: React.MutableRefObject<object | null>, sheetEditorRef: React.RefObject<WorkbookInstance | null>, updateDocumentTitle?: (title: string) => void, fileArg?: File, importType?: string, handleContentPortal?: any, separatorType?: string) => Promise<void>;
5
+ export declare const handleCSVUpload: (event: React.ChangeEventHandler<HTMLInputElement> | undefined, ydoc: Y.Doc | null, setForceSheetRender: React.Dispatch<React.SetStateAction<number>>, dsheetId: string, currentDataRef: React.MutableRefObject<object | null>, sheetEditorRef: React.RefObject<WorkbookInstance | null>, updateDocumentTitle?: (title: string) => void, fileArg?: File, importType?: string, handleContentPortal?: any, separatorType?: string, options?: {
6
+ suppressUiWarnings?: boolean;
7
+ }) => Promise<void>;
@@ -0,0 +1,21 @@
1
+ import { Cell, WorkbookInstance } from '../../sheet-engine/react';
2
+ import { DataBlockEvent, ErrorMessageHandlerReturnType } from '../types';
3
+ import { ApiKeyStorage } from './api-key-storage';
4
+ import { SmartContractQueryHandler } from './after-update-cell';
5
+
6
+ export type OpenApiKeyModalFn = (apiKeyName: string, callbacks: {
7
+ onSave: (key: string) => void;
8
+ onClose: () => void;
9
+ }) => void;
10
+ export interface DataBlockErrorHandlerParams {
11
+ data: ErrorMessageHandlerReturnType;
12
+ sheetEditorRef: React.RefObject<WorkbookInstance | null>;
13
+ row: number;
14
+ column: number;
15
+ newValue: Cell;
16
+ apiKeyStorage: ApiKeyStorage;
17
+ openApiKeyModal: OpenApiKeyModalFn;
18
+ onDataBlockEvent?: (event: DataBlockEvent) => void;
19
+ handleSmartContractQuery?: SmartContractQueryHandler;
20
+ }
21
+ export declare const handleDataBlockError: ({ data, sheetEditorRef, row, column, newValue, apiKeyStorage, openApiKeyModal, onDataBlockEvent, handleSmartContractQuery, }: DataBlockErrorHandlerParams) => Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const isDatablockError: (value: unknown) => boolean;
@@ -0,0 +1,26 @@
1
+ import { RefObject } from 'react';
2
+ import { SheetEditorRef } from '../types/comments';
3
+
4
+ type SheetEditorRefLike = RefObject<SheetEditorRef | null> | null | undefined;
5
+ type WorkbookSheetLike = {
6
+ id?: string;
7
+ order?: number;
8
+ name?: string;
9
+ };
10
+ export declare function isWorkbookReady(ref: SheetEditorRefLike): boolean;
11
+ export declare function getCurrentSheetSafe(ref: SheetEditorRefLike): WorkbookSheetLike | null;
12
+ export declare function getCurrentSheetOrderSafe(ref: SheetEditorRefLike): number;
13
+ export declare function getCurrentSheetIdSafe(ref: SheetEditorRefLike): string;
14
+ export declare function getAllSheetsSafe(ref: SheetEditorRefLike): WorkbookSheetLike[];
15
+ export declare function buildSheetOrderNameMap(ref: SheetEditorRefLike): Map<number, string>;
16
+ /**
17
+ * Returns a map keyed by BOTH the sheet's immutable id AND its numeric
18
+ * order-as-string so that both new (UUID) and legacy (order) comment keys
19
+ * resolve to the correct display name in a single lookup.
20
+ */
21
+ export declare function buildSheetIdNameMap(ref: SheetEditorRefLike): Map<string, string>;
22
+ export declare function findSheetById(ref: SheetEditorRefLike, id: string): WorkbookSheetLike | null;
23
+ export declare function activateSheetById(ref: SheetEditorRefLike, id: string): boolean;
24
+ export declare function findSheetByOrder(ref: SheetEditorRefLike, order: number): WorkbookSheetLike | null;
25
+ export declare function activateSheetByOrder(ref: SheetEditorRefLike, order: number): boolean;
26
+ export {};
@@ -0,0 +1,488 @@
1
+ import { ContractConfig, SupportedChain } from '../../types/smart-contract';
2
+
3
+ export declare const DEFAULT_RPC_URL_MAP: Record<SupportedChain, string[]>;
4
+ export declare const SUPPORTED_VIEM_CHAIN_MAP: {
5
+ Sepolia: {
6
+ blockExplorers: {
7
+ readonly default: {
8
+ readonly name: "Etherscan";
9
+ readonly url: "https://sepolia.etherscan.io";
10
+ readonly apiUrl: "https://api-sepolia.etherscan.io/api";
11
+ };
12
+ };
13
+ blockTime?: number | undefined | undefined;
14
+ contracts: {
15
+ readonly multicall3: {
16
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
17
+ readonly blockCreated: 751532;
18
+ };
19
+ readonly ensUniversalResolver: {
20
+ readonly address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee";
21
+ readonly blockCreated: 8928790;
22
+ };
23
+ };
24
+ ensTlds?: readonly string[] | undefined;
25
+ id: 11155111;
26
+ name: "Sepolia";
27
+ nativeCurrency: {
28
+ readonly name: "Sepolia Ether";
29
+ readonly symbol: "ETH";
30
+ readonly decimals: 18;
31
+ };
32
+ experimental_preconfirmationTime?: number | undefined | undefined;
33
+ rpcUrls: {
34
+ readonly default: {
35
+ readonly http: readonly ["https://11155111.rpc.thirdweb.com"];
36
+ };
37
+ };
38
+ sourceId?: number | undefined | undefined;
39
+ testnet: true;
40
+ custom?: Record<string, unknown> | undefined;
41
+ extendSchema?: Record<string, unknown> | undefined;
42
+ fees?: import('viem').ChainFees<undefined> | undefined;
43
+ formatters?: undefined;
44
+ prepareTransactionRequest?: ((args: import('viem').PrepareTransactionRequestParameters, options: {
45
+ client: import('viem').Client;
46
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
47
+ }) => Promise<import('viem').PrepareTransactionRequestParameters>) | [fn: ((args: import('viem').PrepareTransactionRequestParameters, options: {
48
+ client: import('viem').Client;
49
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
50
+ }) => Promise<import('viem').PrepareTransactionRequestParameters>) | undefined, options: {
51
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
52
+ }] | undefined;
53
+ serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
54
+ verifyHash?: ((client: import('viem').Client, parameters: import('viem').VerifyHashActionParameters) => Promise<import('viem').VerifyHashActionReturnType>) | undefined;
55
+ };
56
+ Gnosis: {
57
+ blockExplorers: {
58
+ readonly default: {
59
+ readonly name: "Gnosisscan";
60
+ readonly url: "https://gnosisscan.io";
61
+ readonly apiUrl: "https://api.gnosisscan.io/api";
62
+ };
63
+ };
64
+ blockTime: 5000;
65
+ contracts: {
66
+ readonly multicall3: {
67
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
68
+ readonly blockCreated: 21022491;
69
+ };
70
+ };
71
+ ensTlds?: readonly string[] | undefined;
72
+ id: 100;
73
+ name: "Gnosis";
74
+ nativeCurrency: {
75
+ readonly decimals: 18;
76
+ readonly name: "xDAI";
77
+ readonly symbol: "XDAI";
78
+ };
79
+ experimental_preconfirmationTime?: number | undefined | undefined;
80
+ rpcUrls: {
81
+ readonly default: {
82
+ readonly http: readonly ["https://rpc.gnosischain.com"];
83
+ readonly webSocket: readonly ["wss://rpc.gnosischain.com/wss"];
84
+ };
85
+ };
86
+ sourceId?: number | undefined | undefined;
87
+ testnet?: boolean | undefined | undefined;
88
+ custom?: Record<string, unknown> | undefined;
89
+ extendSchema?: Record<string, unknown> | undefined;
90
+ fees?: import('viem').ChainFees<undefined> | undefined;
91
+ formatters?: undefined;
92
+ prepareTransactionRequest?: ((args: import('viem').PrepareTransactionRequestParameters, options: {
93
+ client: import('viem').Client;
94
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
95
+ }) => Promise<import('viem').PrepareTransactionRequestParameters>) | [fn: ((args: import('viem').PrepareTransactionRequestParameters, options: {
96
+ client: import('viem').Client;
97
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
98
+ }) => Promise<import('viem').PrepareTransactionRequestParameters>) | undefined, options: {
99
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
100
+ }] | undefined;
101
+ serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
102
+ verifyHash?: ((client: import('viem').Client, parameters: import('viem').VerifyHashActionParameters) => Promise<import('viem').VerifyHashActionReturnType>) | undefined;
103
+ };
104
+ Base: {
105
+ blockExplorers: {
106
+ readonly default: {
107
+ readonly name: "Basescan";
108
+ readonly url: "https://basescan.org";
109
+ readonly apiUrl: "https://api.basescan.org/api";
110
+ };
111
+ };
112
+ blockTime: 2000;
113
+ contracts: {
114
+ readonly disputeGameFactory: {
115
+ readonly 1: {
116
+ readonly address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e";
117
+ };
118
+ };
119
+ readonly l2OutputOracle: {
120
+ readonly 1: {
121
+ readonly address: "0x56315b90c40730925ec5485cf004d835058518A0";
122
+ };
123
+ };
124
+ readonly multicall3: {
125
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
126
+ readonly blockCreated: 5022;
127
+ };
128
+ readonly portal: {
129
+ readonly 1: {
130
+ readonly address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e";
131
+ readonly blockCreated: 17482143;
132
+ };
133
+ };
134
+ readonly l1StandardBridge: {
135
+ readonly 1: {
136
+ readonly address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35";
137
+ readonly blockCreated: 17482143;
138
+ };
139
+ };
140
+ readonly gasPriceOracle: {
141
+ readonly address: "0x420000000000000000000000000000000000000F";
142
+ };
143
+ readonly l1Block: {
144
+ readonly address: "0x4200000000000000000000000000000000000015";
145
+ };
146
+ readonly l2CrossDomainMessenger: {
147
+ readonly address: "0x4200000000000000000000000000000000000007";
148
+ };
149
+ readonly l2Erc721Bridge: {
150
+ readonly address: "0x4200000000000000000000000000000000000014";
151
+ };
152
+ readonly l2StandardBridge: {
153
+ readonly address: "0x4200000000000000000000000000000000000010";
154
+ };
155
+ readonly l2ToL1MessagePasser: {
156
+ readonly address: "0x4200000000000000000000000000000000000016";
157
+ };
158
+ };
159
+ ensTlds?: readonly string[] | undefined;
160
+ id: 8453;
161
+ name: "Base";
162
+ nativeCurrency: {
163
+ readonly name: "Ether";
164
+ readonly symbol: "ETH";
165
+ readonly decimals: 18;
166
+ };
167
+ experimental_preconfirmationTime?: number | undefined | undefined;
168
+ rpcUrls: {
169
+ readonly default: {
170
+ readonly http: readonly ["https://mainnet.base.org"];
171
+ };
172
+ };
173
+ sourceId: 1;
174
+ testnet?: boolean | undefined | undefined;
175
+ custom?: Record<string, unknown> | undefined;
176
+ extendSchema?: Record<string, unknown> | undefined;
177
+ fees?: import('viem').ChainFees<undefined> | undefined;
178
+ formatters: {
179
+ readonly block: {
180
+ exclude: [] | undefined;
181
+ format: (args: import('viem/chains').OpStackRpcBlock, action?: string | undefined) => {
182
+ baseFeePerGas: bigint | null;
183
+ blobGasUsed: bigint;
184
+ difficulty: bigint;
185
+ excessBlobGas: bigint;
186
+ extraData: import('viem').Hex;
187
+ gasLimit: bigint;
188
+ gasUsed: bigint;
189
+ hash: `0x${string}` | null;
190
+ logsBloom: `0x${string}` | null;
191
+ miner: import('abitype').Address;
192
+ mixHash: import('viem').Hash;
193
+ nonce: `0x${string}` | null;
194
+ number: bigint | null;
195
+ parentBeaconBlockRoot?: `0x${string}` | undefined;
196
+ parentHash: import('viem').Hash;
197
+ receiptsRoot: import('viem').Hex;
198
+ sealFields: import('viem').Hex[];
199
+ sha3Uncles: import('viem').Hash;
200
+ size: bigint;
201
+ stateRoot: import('viem').Hash;
202
+ timestamp: bigint;
203
+ totalDifficulty: bigint | null;
204
+ transactions: `0x${string}`[] | import('viem/chains').OpStackTransaction<boolean>[];
205
+ transactionsRoot: import('viem').Hash;
206
+ uncles: import('viem').Hash[];
207
+ withdrawals?: import('viem').Withdrawal[] | undefined | undefined;
208
+ withdrawalsRoot?: `0x${string}` | undefined;
209
+ } & {};
210
+ type: "block";
211
+ };
212
+ readonly transaction: {
213
+ exclude: [] | undefined;
214
+ format: (args: import('viem/chains').OpStackRpcTransaction, action?: string | undefined) => ({
215
+ blockHash: `0x${string}` | null;
216
+ blockNumber: bigint | null;
217
+ blockTimestamp?: bigint | undefined;
218
+ from: import('abitype').Address;
219
+ gas: bigint;
220
+ hash: import('viem').Hash;
221
+ input: import('viem').Hex;
222
+ nonce: number;
223
+ r: import('viem').Hex;
224
+ s: import('viem').Hex;
225
+ to: import('abitype').Address | null;
226
+ transactionIndex: number | null;
227
+ typeHex: import('viem').Hex | null;
228
+ v: bigint;
229
+ value: bigint;
230
+ yParity: number;
231
+ gasPrice?: undefined | undefined;
232
+ maxFeePerBlobGas?: undefined | undefined;
233
+ maxFeePerGas: bigint;
234
+ maxPriorityFeePerGas: bigint;
235
+ isSystemTx?: boolean;
236
+ mint?: bigint | undefined | undefined;
237
+ sourceHash: import('viem').Hex;
238
+ type: "deposit";
239
+ } | {
240
+ r: import('viem').Hex;
241
+ s: import('viem').Hex;
242
+ v: bigint;
243
+ to: import('abitype').Address | null;
244
+ from: import('abitype').Address;
245
+ gas: bigint;
246
+ nonce: number;
247
+ value: bigint;
248
+ blockHash: `0x${string}` | null;
249
+ blockNumber: bigint | null;
250
+ blockTimestamp?: bigint | undefined;
251
+ hash: import('viem').Hash;
252
+ input: import('viem').Hex;
253
+ transactionIndex: number | null;
254
+ typeHex: import('viem').Hex | null;
255
+ accessList?: undefined | undefined;
256
+ authorizationList?: undefined | undefined;
257
+ blobVersionedHashes?: undefined | undefined;
258
+ chainId?: number | undefined;
259
+ yParity?: undefined | undefined;
260
+ type: "legacy";
261
+ gasPrice: bigint;
262
+ maxFeePerBlobGas?: undefined | undefined;
263
+ maxFeePerGas?: undefined | undefined;
264
+ maxPriorityFeePerGas?: undefined | undefined;
265
+ isSystemTx?: undefined | undefined;
266
+ mint?: undefined | undefined;
267
+ sourceHash?: undefined | undefined;
268
+ } | {
269
+ blockHash: `0x${string}` | null;
270
+ blockNumber: bigint | null;
271
+ blockTimestamp?: bigint | undefined;
272
+ from: import('abitype').Address;
273
+ gas: bigint;
274
+ hash: import('viem').Hash;
275
+ input: import('viem').Hex;
276
+ nonce: number;
277
+ r: import('viem').Hex;
278
+ s: import('viem').Hex;
279
+ to: import('abitype').Address | null;
280
+ transactionIndex: number | null;
281
+ typeHex: import('viem').Hex | null;
282
+ v: bigint;
283
+ value: bigint;
284
+ yParity: number;
285
+ accessList: import('viem').AccessList;
286
+ authorizationList?: undefined | undefined;
287
+ blobVersionedHashes?: undefined | undefined;
288
+ chainId: number;
289
+ type: "eip2930";
290
+ gasPrice: bigint;
291
+ maxFeePerBlobGas?: undefined | undefined;
292
+ maxFeePerGas?: undefined | undefined;
293
+ maxPriorityFeePerGas?: undefined | undefined;
294
+ isSystemTx?: undefined | undefined;
295
+ mint?: undefined | undefined;
296
+ sourceHash?: undefined | undefined;
297
+ } | {
298
+ blockHash: `0x${string}` | null;
299
+ blockNumber: bigint | null;
300
+ blockTimestamp?: bigint | undefined;
301
+ from: import('abitype').Address;
302
+ gas: bigint;
303
+ hash: import('viem').Hash;
304
+ input: import('viem').Hex;
305
+ nonce: number;
306
+ r: import('viem').Hex;
307
+ s: import('viem').Hex;
308
+ to: import('abitype').Address | null;
309
+ transactionIndex: number | null;
310
+ typeHex: import('viem').Hex | null;
311
+ v: bigint;
312
+ value: bigint;
313
+ yParity: number;
314
+ accessList: import('viem').AccessList;
315
+ authorizationList?: undefined | undefined;
316
+ blobVersionedHashes?: undefined | undefined;
317
+ chainId: number;
318
+ type: "eip1559";
319
+ gasPrice?: undefined | undefined;
320
+ maxFeePerBlobGas?: undefined | undefined;
321
+ maxFeePerGas: bigint;
322
+ maxPriorityFeePerGas: bigint;
323
+ isSystemTx?: undefined | undefined;
324
+ mint?: undefined | undefined;
325
+ sourceHash?: undefined | undefined;
326
+ } | {
327
+ blockHash: `0x${string}` | null;
328
+ blockNumber: bigint | null;
329
+ blockTimestamp?: bigint | undefined;
330
+ from: import('abitype').Address;
331
+ gas: bigint;
332
+ hash: import('viem').Hash;
333
+ input: import('viem').Hex;
334
+ nonce: number;
335
+ r: import('viem').Hex;
336
+ s: import('viem').Hex;
337
+ to: import('abitype').Address | null;
338
+ transactionIndex: number | null;
339
+ typeHex: import('viem').Hex | null;
340
+ v: bigint;
341
+ value: bigint;
342
+ yParity: number;
343
+ accessList: import('viem').AccessList;
344
+ authorizationList?: undefined | undefined;
345
+ blobVersionedHashes: readonly import('viem').Hex[];
346
+ chainId: number;
347
+ type: "eip4844";
348
+ gasPrice?: undefined | undefined;
349
+ maxFeePerBlobGas: bigint;
350
+ maxFeePerGas: bigint;
351
+ maxPriorityFeePerGas: bigint;
352
+ isSystemTx?: undefined | undefined;
353
+ mint?: undefined | undefined;
354
+ sourceHash?: undefined | undefined;
355
+ } | {
356
+ blockHash: `0x${string}` | null;
357
+ blockNumber: bigint | null;
358
+ blockTimestamp?: bigint | undefined;
359
+ from: import('abitype').Address;
360
+ gas: bigint;
361
+ hash: import('viem').Hash;
362
+ input: import('viem').Hex;
363
+ nonce: number;
364
+ r: import('viem').Hex;
365
+ s: import('viem').Hex;
366
+ to: import('abitype').Address | null;
367
+ transactionIndex: number | null;
368
+ typeHex: import('viem').Hex | null;
369
+ v: bigint;
370
+ value: bigint;
371
+ yParity: number;
372
+ accessList: import('viem').AccessList;
373
+ authorizationList: import('viem').SignedAuthorizationList;
374
+ blobVersionedHashes?: undefined | undefined;
375
+ chainId: number;
376
+ type: "eip7702";
377
+ gasPrice?: undefined | undefined;
378
+ maxFeePerBlobGas?: undefined | undefined;
379
+ maxFeePerGas: bigint;
380
+ maxPriorityFeePerGas: bigint;
381
+ isSystemTx?: undefined | undefined;
382
+ mint?: undefined | undefined;
383
+ sourceHash?: undefined | undefined;
384
+ }) & {};
385
+ type: "transaction";
386
+ };
387
+ readonly transactionReceipt: {
388
+ exclude: [] | undefined;
389
+ format: (args: import('viem/chains').OpStackRpcTransactionReceipt, action?: string | undefined) => {
390
+ blobGasPrice?: bigint | undefined;
391
+ blobGasUsed?: bigint | undefined;
392
+ blockHash: import('viem').Hash;
393
+ blockNumber: bigint;
394
+ blockTimestamp?: bigint | undefined;
395
+ contractAddress: import('abitype').Address | null | undefined;
396
+ cumulativeGasUsed: bigint;
397
+ effectiveGasPrice: bigint;
398
+ from: import('abitype').Address;
399
+ gasUsed: bigint;
400
+ logs: import('viem').Log<bigint, number, false>[];
401
+ logsBloom: import('viem').Hex;
402
+ root?: `0x${string}` | undefined;
403
+ status: "success" | "reverted";
404
+ to: import('abitype').Address | null;
405
+ transactionHash: import('viem').Hash;
406
+ transactionIndex: number;
407
+ type: import('viem').TransactionType;
408
+ l1GasPrice: bigint | null;
409
+ l1GasUsed: bigint | null;
410
+ l1Fee: bigint | null;
411
+ l1FeeScalar: number | null;
412
+ } & {};
413
+ type: "transactionReceipt";
414
+ };
415
+ };
416
+ prepareTransactionRequest?: ((args: import('viem').PrepareTransactionRequestParameters, options: {
417
+ client: import('viem').Client;
418
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
419
+ }) => Promise<import('viem').PrepareTransactionRequestParameters>) | [fn: ((args: import('viem').PrepareTransactionRequestParameters, options: {
420
+ client: import('viem').Client;
421
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
422
+ }) => Promise<import('viem').PrepareTransactionRequestParameters>) | undefined, options: {
423
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
424
+ }] | undefined;
425
+ serializers: {
426
+ readonly transaction: typeof import('viem/chains').serializeTransactionOpStack;
427
+ };
428
+ verifyHash?: ((client: import('viem').Client, parameters: import('viem').VerifyHashActionParameters) => Promise<import('viem').VerifyHashActionReturnType>) | undefined;
429
+ };
430
+ Ethereum: {
431
+ blockExplorers: {
432
+ readonly default: {
433
+ readonly name: "Etherscan";
434
+ readonly url: "https://etherscan.io";
435
+ readonly apiUrl: "https://api.etherscan.io/api";
436
+ };
437
+ };
438
+ blockTime: 12000;
439
+ contracts: {
440
+ readonly ensUniversalResolver: {
441
+ readonly address: "0xeeeeeeee14d718c2b47d9923deab1335e144eeee";
442
+ readonly blockCreated: 23085558;
443
+ };
444
+ readonly multicall3: {
445
+ readonly address: "0xca11bde05977b3631167028862be2a173976ca11";
446
+ readonly blockCreated: 14353601;
447
+ };
448
+ };
449
+ ensTlds?: readonly string[] | undefined;
450
+ id: 1;
451
+ name: "Ethereum";
452
+ nativeCurrency: {
453
+ readonly name: "Ether";
454
+ readonly symbol: "ETH";
455
+ readonly decimals: 18;
456
+ };
457
+ experimental_preconfirmationTime?: number | undefined | undefined;
458
+ rpcUrls: {
459
+ readonly default: {
460
+ readonly http: readonly ["https://eth.merkle.io"];
461
+ };
462
+ };
463
+ sourceId?: number | undefined | undefined;
464
+ testnet?: boolean | undefined | undefined;
465
+ custom?: Record<string, unknown> | undefined;
466
+ extendSchema?: Record<string, unknown> | undefined;
467
+ fees?: import('viem').ChainFees<undefined> | undefined;
468
+ formatters?: undefined;
469
+ prepareTransactionRequest?: ((args: import('viem').PrepareTransactionRequestParameters, options: {
470
+ client: import('viem').Client;
471
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
472
+ }) => Promise<import('viem').PrepareTransactionRequestParameters>) | [fn: ((args: import('viem').PrepareTransactionRequestParameters, options: {
473
+ client: import('viem').Client;
474
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
475
+ }) => Promise<import('viem').PrepareTransactionRequestParameters>) | undefined, options: {
476
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
477
+ }] | undefined;
478
+ serializers?: import('viem').ChainSerializers<undefined, import('viem').TransactionSerializable> | undefined;
479
+ verifyHash?: ((client: import('viem').Client, parameters: import('viem').VerifyHashActionParameters) => Promise<import('viem').VerifyHashActionReturnType>) | undefined;
480
+ };
481
+ };
482
+ export declare const SUPPORTED_CHAIN_ID_MAP: Record<number, SupportedChain>;
483
+ export declare const CHAIN_NAME_MAP: Record<string, SupportedChain>;
484
+ export declare const POPULAR_CONTRACTS_MAP: Record<string, ContractConfig>;
485
+ export declare const UNIVERSAL_ENS_RESOLVER_ADDRESS = "0xce01f8eee7E479C928F8919abD53E553a36CeF67";
486
+ export declare const RESOLVER_FUNCTION_NAME = "findResolver";
487
+ export declare const SMART_CONTRACT_PANEL_ID = "smart-contract-list-view";
488
+ export declare const POPULAR_CONTRACT_NAMES: Set<string>;
@@ -0,0 +1,20 @@
1
+ import { Hex } from 'viem';
2
+
3
+ export declare class ContractNotFound extends Error {
4
+ constructor(contractName: string);
5
+ }
6
+ export declare class InvalidFunctionName extends Error {
7
+ constructor(functionName: string);
8
+ }
9
+ export declare class ReadOnlyError extends Error {
10
+ constructor(functionName: string);
11
+ }
12
+ export declare class InvalidParams extends Error {
13
+ constructor(message: string);
14
+ }
15
+ export declare class UnsupportedChainError extends Error {
16
+ constructor(chainId: number | Hex | string);
17
+ }
18
+ export declare class ContractAbiFetchError extends Error {
19
+ constructor(contractAddress: string, chainId: number | Hex);
20
+ }
@@ -0,0 +1,4 @@
1
+ export declare function sanitizeValue(value: unknown): unknown;
2
+ export declare function flattenArray(arr: unknown[]): unknown[];
3
+ export declare function flattenObject(obj: Record<string, unknown>): Record<string, unknown>;
4
+ export declare function isPlainObject(val: unknown): val is Record<string, unknown>;
@@ -0,0 +1,34 @@
1
+ import { Abi, AbiParameter, Chain, Hex } from 'viem';
2
+ import { CallerParams, ContractConfig, ContractRegistry, FetchAbiParams, ParsedFunction, SupportedChain } from '../../types/smart-contract';
3
+
4
+ export type SmartContractRuntimeDeps = {
5
+ resolveAbi?: (abiHash: string) => Promise<Abi>;
6
+ rpcConfig?: Partial<Record<SupportedChain, string>>;
7
+ abiCache: Record<string, Abi>;
8
+ };
9
+ export declare const getContractConfig: (contractName: string, contractRegistry: ContractRegistry) => ContractConfig;
10
+ export declare const fetchAbi: (params: FetchAbiParams, deps: SmartContractRuntimeDeps) => Promise<Abi>;
11
+ export declare const validateParams: (functionInput: readonly AbiParameter[], args: unknown[]) => boolean;
12
+ export declare const getChainFromChainId: (chainId: number | Hex | string) => Chain;
13
+ export declare const fetchVerifiedAbi: (contractAddress: Hex, chain: Chain, exactFields?: string[]) => Promise<Abi>;
14
+ export declare function parseAbiViewFunctions(abi: Abi): ParsedFunction[];
15
+ export declare const getCallerParamsByAddress: (callSignature: unknown[], deps: SmartContractRuntimeDeps) => Promise<CallerParams>;
16
+ export declare const getCallerParamsByName: (callSignature: unknown[], registry: ContractRegistry, deps: SmartContractRuntimeDeps) => Promise<CallerParams>;
17
+ export declare const parseCallSignature: (callSignature: unknown[], registry: ContractRegistry, deps: SmartContractRuntimeDeps) => Promise<CallerParams>;
18
+ export declare const executeSmartContractCall: (params: CallerParams, deps: SmartContractRuntimeDeps) => Promise<{
19
+ response: {
20
+ 'Function name': string;
21
+ Argument: string;
22
+ stateMutability: import('abitype').AbiStateMutability;
23
+ }[];
24
+ staticInstructions: string[];
25
+ outputType?: undefined;
26
+ } | {
27
+ response: unknown;
28
+ outputType: readonly AbiParameter[];
29
+ staticInstructions?: undefined;
30
+ }>;
31
+ export declare const validateAbi: (abi: unknown) => void;
32
+ export declare const normalizeGridArray: (input: unknown[], functionName: string, abi: Abi) => any[];
33
+ export declare const fetchContractAbi: (contract: ContractConfig, deps: SmartContractRuntimeDeps) => Promise<Abi>;
34
+ export declare const isPopularContract: (name: string, popularNames: Set<string>) => boolean;
@@ -0,0 +1,9 @@
1
+ export declare function parseFunctionSignature(signature: string): {
2
+ name: string;
3
+ args: string;
4
+ } | null;
5
+ export declare function getFunctionWithArguments(functions: {
6
+ functionName: string;
7
+ }[]): {
8
+ functionName: string;
9
+ } | null;
@@ -0,0 +1,12 @@
1
+ export type SpreadsheetImportFileType = 'xlsx' | 'csv';
2
+ export type ImportSpreadsheetFileOptions = {
3
+ type: SpreadsheetImportFileType;
4
+ separator?: 'auto' | 'tab' | 'comma' | string;
5
+ dsheetId: string;
6
+ };
7
+ export type ImportSpreadsheetFileResult = {
8
+ encodedContent: string;
9
+ title?: string;
10
+ warnings?: string[];
11
+ };
12
+ export declare function importSpreadsheetFile(file: File, options: ImportSpreadsheetFileOptions): Promise<ImportSpreadsheetFileResult>;