|
2 | 2 |
|
3 | 3 | import * as torii from "@dojoengine/torii-client";
|
4 | 4 | import { Account, StarknetDomain, TypedData } from "starknet";
|
5 |
| -import { AccountInterface, RpcProvider } from "starknet"; |
6 | 5 |
|
7 | 6 | /**
|
8 | 7 | * Utility type to ensure at least one property is present
|
@@ -82,17 +81,12 @@ export type QueryOptions = {
|
82 | 81 | entityId?: string;
|
83 | 82 | };
|
84 | 83 |
|
85 |
| -/** |
86 |
| - * Logical operators for combining multiple conditions |
87 |
| - */ |
88 |
| -export type LogicalOperator = "AND" | "OR"; |
89 |
| - |
90 | 84 | /**
|
91 | 85 | * Recursively defines the conditions for the `where` clause.
|
92 | 86 | */
|
93 | 87 | export type WhereCondition<TModel> =
|
94 | 88 | | {
|
95 |
| - [key in LogicalOperator]?: Array<WhereCondition<TModel>>; |
| 89 | + [key in torii.LogicalOperator]?: Array<WhereCondition<TModel>>; |
96 | 90 | }
|
97 | 91 | | {
|
98 | 92 | [P in keyof TModel]?: {
|
@@ -341,81 +335,20 @@ export interface SDK<T extends SchemaType> {
|
341 | 335 | sendMessage: (data: TypedData, account: Account) => Promise<void>;
|
342 | 336 | }
|
343 | 337 |
|
344 |
| -export type BurnerStorage = { |
345 |
| - [address: string]: BurnerRecord; |
346 |
| -}; |
347 |
| - |
348 |
| -export type BurnerRecord = { |
349 |
| - chainId: string; |
350 |
| - privateKey: string; |
351 |
| - publicKey: string; |
352 |
| - deployTx: string; |
353 |
| - masterAccount: string; |
354 |
| - active: boolean; |
355 |
| - accountIndex?: number; |
356 |
| - metadata?: any; |
357 |
| -}; |
358 |
| - |
359 |
| -export type Burner = { |
360 |
| - address: string; |
361 |
| - active: boolean; |
362 |
| - masterAccount?: string; |
363 |
| - accountIndex?: number; |
364 |
| -}; |
365 |
| - |
366 |
| -export interface BurnerManagerOptions { |
367 |
| - masterAccount: Account; |
368 |
| - accountClassHash: string; |
369 |
| - feeTokenAddress: string; |
370 |
| - rpcProvider: RpcProvider; |
371 |
| -} |
372 |
| - |
373 |
| -export interface BurnerAccount { |
374 |
| - create: (options?: BurnerCreateOptions) => void; |
375 |
| - list: () => Burner[]; |
376 |
| - get: (address: string) => AccountInterface; |
377 |
| - remove: (address: string) => void; |
378 |
| - account: Account; |
379 |
| - select: (address: string) => void; |
380 |
| - deselect: () => void; |
381 |
| - isDeploying: boolean; |
382 |
| - clear: () => void; |
383 |
| - count: number; |
384 |
| - copyToClipboard: () => Promise<void>; |
385 |
| - applyFromClipboard: () => Promise<void>; |
386 |
| - getActiveAccount?: () => Account | null; |
387 |
| - generateAddressFromSeed?: (options?: BurnerCreateOptions) => string; |
388 |
| - checkIsDeployed: (address: string, deployTx?: string) => Promise<boolean>; |
389 |
| -} |
390 |
| - |
391 |
| -export interface BurnerCreateOptions { |
392 |
| - secret?: string; |
393 |
| - index?: number; |
394 |
| - metadata?: any; |
395 |
| - prefundedAmount?: string; |
396 |
| - maxFee?: number; |
397 |
| -} |
398 |
| - |
399 |
| -export interface BurnerKeys { |
400 |
| - privateKey: string; |
401 |
| - publicKey: string; |
402 |
| - address: string; |
403 |
| -} |
404 |
| - |
405 |
| -export type Predeployed = Burner & { name?: string }; |
406 |
| - |
407 |
| -export type PredeployedStorage = { |
408 |
| - [address: string]: PredeployedAccount; |
409 |
| -}; |
| 338 | +/** |
| 339 | + * Configuration interface for the SDK. |
| 340 | + */ |
| 341 | +export interface SDKConfig { |
| 342 | + /** |
| 343 | + * Configuration for the Torii client. |
| 344 | + * This includes settings such as the endpoint URL, authentication details, etc. |
| 345 | + */ |
| 346 | + client: torii.ClientConfig; |
410 | 347 |
|
411 |
| -export interface PredeployedManagerOptions { |
412 |
| - rpcProvider: RpcProvider; |
413 |
| - predeployedAccounts: PredeployedAccount[]; |
| 348 | + /** |
| 349 | + * The Starknet domain configuration. |
| 350 | + * This is used for generating typed data and signing messages. |
| 351 | + * It typically includes details like the chain ID, name, and version. |
| 352 | + */ |
| 353 | + domain: StarknetDomain; |
414 | 354 | }
|
415 |
| - |
416 |
| -export type PredeployedAccount = { |
417 |
| - name?: string; |
418 |
| - address: string; |
419 |
| - privateKey: string; |
420 |
| - active: boolean; |
421 |
| -}; |
0 commit comments