@opendatalabs/vana-sdk 2.2.1 → 2.2.3-canary.046cb7e
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.
- package/dist/config/features.cjs +1 -24
- package/dist/config/features.cjs.map +1 -1
- package/dist/config/features.d.ts +13 -44
- package/dist/config/features.js +1 -24
- package/dist/config/features.js.map +1 -1
- package/dist/controllers/permissions.cjs +19 -14
- package/dist/controllers/permissions.cjs.map +1 -1
- package/dist/controllers/permissions.js +19 -14
- package/dist/controllers/permissions.js.map +1 -1
- package/dist/controllers/staking.cjs +539 -0
- package/dist/controllers/staking.cjs.map +1 -0
- package/dist/controllers/staking.d.ts +404 -0
- package/dist/controllers/staking.js +515 -0
- package/dist/controllers/staking.js.map +1 -0
- package/dist/core.cjs +4 -0
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +3 -0
- package/dist/core.js +4 -0
- package/dist/core.js.map +1 -1
- package/dist/crypto/ecies/index.cjs.map +1 -1
- package/dist/crypto/ecies/index.d.ts +10 -2
- package/dist/crypto/ecies/index.js.map +1 -1
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs +37 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaPoolEntityImplementation.d.ts +29 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.js +37 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.js.map +1 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs +156 -19
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.d.ts +120 -14
- package/dist/generated/abi/VanaPoolStakingImplementation.js +156 -19
- package/dist/generated/abi/VanaPoolStakingImplementation.js.map +1 -1
- package/dist/generated/abi/index.d.ts +149 -14
- package/dist/generated/event-types.cjs.map +1 -1
- package/dist/generated/event-types.d.ts +4 -0
- package/dist/generated/eventRegistry.cjs +24 -0
- package/dist/generated/eventRegistry.cjs.map +1 -1
- package/dist/generated/eventRegistry.js +24 -0
- package/dist/generated/eventRegistry.js.map +1 -1
- package/dist/index.browser.d.ts +4 -0
- package/dist/index.browser.js +12 -0
- package/dist/index.browser.js.map +1 -1
- package/dist/index.node.cjs +15 -0
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +5 -0
- package/dist/index.node.js +14 -0
- package/dist/index.node.js.map +1 -1
- package/dist/platform/browser.cjs +40 -119
- package/dist/platform/browser.cjs.map +1 -1
- package/dist/platform/browser.d.ts +7 -7
- package/dist/platform/browser.js +40 -119
- package/dist/platform/browser.js.map +1 -1
- package/dist/platform/node.cjs +51 -129
- package/dist/platform/node.cjs.map +1 -1
- package/dist/platform/node.d.ts +5 -5
- package/dist/platform/node.js +51 -129
- package/dist/platform/node.js.map +1 -1
- package/dist/tests/staking.test.d.ts +1 -0
- package/dist/types/permissions.cjs.map +1 -1
- package/dist/types/permissions.d.ts +2 -0
- package/package.json +1 -2
- package/dist/types/eccrypto-js.d.cjs +0 -2
- package/dist/types/eccrypto-js.d.cjs.map +0 -1
- package/dist/types/eccrypto-js.d.js +0 -1
- package/dist/types/eccrypto-js.d.js.map +0 -1
package/dist/index.browser.d.ts
CHANGED
|
@@ -125,6 +125,8 @@ export { ServerController } from "./controllers/server";
|
|
|
125
125
|
export { ProtocolController } from "./controllers/protocol";
|
|
126
126
|
export { SchemaController } from "./controllers/schemas";
|
|
127
127
|
export { OperationsController } from "./controllers/operations";
|
|
128
|
+
export { StakingController } from "./controllers/staking";
|
|
129
|
+
export type { EntityInfo, StakerEntityInfo, StakerEntitySummary, } from "./controllers/staking";
|
|
128
130
|
export * from "./contracts/contractController";
|
|
129
131
|
export * from "./utils/encryption";
|
|
130
132
|
export * from "./utils/formatters";
|
|
@@ -147,6 +149,8 @@ export { BaseController, RetryUtility, RateLimiter, MemoryCache, EventEmitter, M
|
|
|
147
149
|
export { BrowserPlatformAdapter } from "./platform/browser";
|
|
148
150
|
export { BrowserECIESUint8Provider as BrowserECIESProvider } from "./crypto/ecies/browser";
|
|
149
151
|
export type { VanaPlatformAdapter } from "./platform/interface";
|
|
152
|
+
export { ECIESError, isECIESEncrypted, serializeECIES, deserializeECIES, } from "./crypto/ecies";
|
|
153
|
+
export type { ECIESProvider, ECIESEncrypted, ECIESOptions, } from "./crypto/ecies";
|
|
150
154
|
export { createBrowserPlatformAdapter, createPlatformAdapterSafe, } from "./platform/browser-only";
|
|
151
155
|
export { detectPlatform, isPlatformSupported, getPlatformCapabilities, } from "./platform/utils";
|
|
152
156
|
export { ApiClient } from "./core/apiClient";
|
package/dist/index.browser.js
CHANGED
|
@@ -28,6 +28,7 @@ import { ServerController } from "./controllers/server";
|
|
|
28
28
|
import { ProtocolController } from "./controllers/protocol";
|
|
29
29
|
import { SchemaController } from "./controllers/schemas";
|
|
30
30
|
import { OperationsController } from "./controllers/operations";
|
|
31
|
+
import { StakingController } from "./controllers/staking";
|
|
31
32
|
export * from "./contracts/contractController";
|
|
32
33
|
export * from "./utils/encryption";
|
|
33
34
|
export * from "./utils/formatters";
|
|
@@ -67,6 +68,12 @@ import {
|
|
|
67
68
|
} from "./core/generics";
|
|
68
69
|
import { BrowserPlatformAdapter as BrowserPlatformAdapter2 } from "./platform/browser";
|
|
69
70
|
import { BrowserECIESUint8Provider } from "./crypto/ecies/browser";
|
|
71
|
+
import {
|
|
72
|
+
ECIESError,
|
|
73
|
+
isECIESEncrypted,
|
|
74
|
+
serializeECIES,
|
|
75
|
+
deserializeECIES
|
|
76
|
+
} from "./crypto/ecies";
|
|
70
77
|
import {
|
|
71
78
|
createBrowserPlatformAdapter,
|
|
72
79
|
createPlatformAdapterSafe
|
|
@@ -86,6 +93,7 @@ export {
|
|
|
86
93
|
CONTRACTS,
|
|
87
94
|
CircuitBreaker,
|
|
88
95
|
DataController,
|
|
96
|
+
ECIESError,
|
|
89
97
|
EnhancedTransactionResponse,
|
|
90
98
|
EventEmitter,
|
|
91
99
|
MemoryCache,
|
|
@@ -97,6 +105,7 @@ export {
|
|
|
97
105
|
RetryUtility,
|
|
98
106
|
SchemaController,
|
|
99
107
|
ServerController,
|
|
108
|
+
StakingController,
|
|
100
109
|
Vana,
|
|
101
110
|
VanaBrowserImpl,
|
|
102
111
|
VanaCore2 as VanaCore,
|
|
@@ -106,6 +115,7 @@ export {
|
|
|
106
115
|
createBrowserPlatformAdapter,
|
|
107
116
|
createPlatformAdapterSafe,
|
|
108
117
|
index_browser_default as default,
|
|
118
|
+
deserializeECIES,
|
|
109
119
|
detectPlatform,
|
|
110
120
|
enhanceResponse,
|
|
111
121
|
getAbi,
|
|
@@ -116,6 +126,7 @@ export {
|
|
|
116
126
|
getPlatformCapabilities,
|
|
117
127
|
getServiceEndpoints,
|
|
118
128
|
isAPIResponse,
|
|
129
|
+
isECIESEncrypted,
|
|
119
130
|
isPlatformSupported,
|
|
120
131
|
isReplicateAPIResponse,
|
|
121
132
|
mainnetServices,
|
|
@@ -124,6 +135,7 @@ export {
|
|
|
124
135
|
mokshaTestnet,
|
|
125
136
|
parseReplicateOutput,
|
|
126
137
|
safeParseJSON,
|
|
138
|
+
serializeECIES,
|
|
127
139
|
vanaMainnet
|
|
128
140
|
};
|
|
129
141
|
//# sourceMappingURL=index.browser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.browser.ts"],"sourcesContent":["/**\n * @module Browser\n * Browser-specific implementation of the Vana SDK\n */\n\nimport { BrowserPlatformAdapter } from \"./platform/browser\";\nimport { VanaCore } from \"./core\";\nimport type {\n VanaConfig,\n VanaConfigWithStorage,\n StorageRequiredMarker,\n} from \"./types\";\n\n/**\n * Internal implementation class for browser environments.\n * This class is not exported directly - use the Vana factory function instead.\n */\nclass VanaBrowserImpl extends VanaCore {\n constructor(config: VanaConfig) {\n super(new BrowserPlatformAdapter(), config);\n }\n}\n\n/**\n * Creates a new Vana SDK instance configured for browser environments.\n *\n * @remarks\n * This is the primary entry point for browser applications using the Vana SDK. The function\n * automatically detects your configuration type and provides compile-time type safety:\n * - **With storage configured**: All methods including file upload/download are available\n * - **Without storage**: Storage-dependent methods throw runtime errors and are excluded from TypeScript\n *\n * The SDK supports multiple wallet configurations (direct WalletClient or chain config),\n * various storage providers (IPFS, Pinata, Google Drive), and gasless transactions via relayers.\n * All operations are optimized for browser environments with proper bundle size optimization.\n *\n * @param config - Configuration object containing wallet, storage, and relayer settings\n * @returns A fully configured Vana SDK instance for browser use\n * @throws {InvalidConfigurationError} When configuration parameters are invalid or missing\n * @example\n * ```typescript\n * import { Vana } from '@opendatalabs/vana-sdk/browser';\n * import { createWalletClient, custom } from 'viem';\n * import { IPFSStorage } from '@opendatalabs/vana-sdk/browser';\n *\n * // Complete setup with storage and wallet\n * const walletClient = createWalletClient({\n * chain: mokshaTestnet,\n * transport: custom(window.ethereum)\n * });\n *\n * const vana = Vana({\n * walletClient,\n * storage: {\n * providers: {\n * ipfs: new IPFSStorage({ gateway: 'https://gateway.pinata.cloud' }),\n * pinata: new PinataStorage({ apiKey: process.env.PINATA_KEY })\n * },\n * defaultProvider: 'ipfs'\n * },\n * relayerCallbacks: {\n * async submitPermissionGrant(typedData, signature) {\n * const response = await fetch('/api/relay/grant', {\n * method: 'POST',\n * body: JSON.stringify({ typedData, signature })\n * });\n * return (await response.json()).transactionHash;\n * }\n * }\n * });\n *\n * // All operations now available\n * const files = await vana.data.getUserFiles();\n * const permissions = await vana.permissions.getUserPermissions();\n * await vana.data.upload({ content: 'My data', filename: 'data.txt' });\n * ```\n *\n * @example\n * ```typescript\n * // Minimal setup without storage (read-only operations)\n * const vanaReadOnly = Vana({ walletClient });\n *\n * // These work without storage\n * const files = await vanaReadOnly.data.getUserFiles();\n * const permissions = await vanaReadOnly.permissions.getUserPermissions();\n *\n * // This would throw a runtime error\n * // await vanaReadOnly.data.upload(params); // ❌ InvalidConfigurationError\n *\n * // Safe runtime check\n * if (vanaReadOnly.isStorageEnabled()) {\n * await vanaReadOnly.data.upload(params); // ✅ TypeScript allows this\n * } else {\n * console.log('Storage not configured - upload unavailable');\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using chain configuration instead of wallet client\n * const vana = Vana({\n * chainId: 14800, // Moksha testnet\n * account: '0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36',\n * rpcUrl: 'https://rpc.moksha.vana.org',\n * storage: {\n * providers: { ipfs: new IPFSStorage() },\n * defaultProvider: 'ipfs'\n * }\n * });\n * ```\n *\n * @see {@link https://docs.vana.org/docs/sdk/getting-started | Getting Started Guide} for setup tutorials\n * @see {@link VanaCore} for the underlying implementation details\n * @category Core SDK\n */\nexport function Vana(\n config: VanaConfigWithStorage,\n): VanaBrowserImpl & StorageRequiredMarker;\nexport function Vana(config: VanaConfig): VanaBrowserImpl;\n/**\n * Creates a new Vana SDK instance.\n *\n * @param config - The configuration for the Vana SDK\n * @returns A new Vana SDK instance\n */\nexport function Vana(config: VanaConfig) {\n return new VanaBrowserImpl(config);\n}\n\n/**\n * The type of a Vana SDK instance in browser environments.\n * Uses InstanceType to properly expose all public methods from the class hierarchy.\n *\n * @see {@link Vana}\n */\nexport type VanaInstance = InstanceType<typeof VanaBrowserImpl>;\n\n// Export as default export\nexport default Vana;\n\n// Re-export everything that was in index.ts (avoiding circular dependency)\n// Core class and factory\nexport { VanaCore, VanaCoreFactory } from \"./core\";\n\n// Types - modular exports\nexport type * from \"./types\";\n\n// Type guards and utilities\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./types/external-apis\";\n\n// VanaContract is exported from abi to avoid circular dependencies\nexport type { VanaContract } from \"./generated/abi\";\n\n// Enhanced response pattern for improved developer experience\nexport {\n EnhancedTransactionResponse,\n canEnhanceResponse,\n enhanceResponse,\n} from \"./client/enhancedResponse\";\n\n// Error classes\nexport * from \"./errors\";\n\n// Controllers\nexport { PermissionsController } from \"./controllers/permissions\";\nexport { DataController } from \"./controllers/data\";\nexport { ServerController } from \"./controllers/server\";\nexport { ProtocolController } from \"./controllers/protocol\";\nexport { SchemaController } from \"./controllers/schemas\";\nexport { OperationsController } from \"./controllers/operations\";\n\n// Contract controller\nexport * from \"./contracts/contractController\";\n\n// Utilities\nexport * from \"./utils/encryption\";\nexport * from \"./utils/formatters\";\nexport * from \"./utils/grantFiles\";\nexport * from \"./utils/grantValidation\";\nexport * from \"./utils/grants\";\nexport * from \"./utils/ipfs\";\nexport * from \"./utils/schemaValidation\";\nexport * from \"./utils/signatureCache\";\n// TransactionHandle removed - using POJOs instead\nexport type {\n Operation,\n TransactionResult,\n TransactionReceipt,\n PollingOptions,\n TransactionWaitOptions,\n} from \"./types/operations\";\n\n// Storage API\nexport * from \"./storage\";\n\n// Configuration\nexport { getContractAddress, CONTRACTS } from \"./generated/addresses\";\nexport { chains } from \"./config/chains\";\nexport {\n type ServiceEndpoints,\n mainnetServices,\n mokshaServices,\n getServiceEndpoints,\n getDefaultPersonalServerUrl,\n} from \"./config/default-services\";\n\n// Chain configurations with subgraph URLs - explicit exports for better DX\nexport {\n vanaMainnet,\n mokshaTestnet,\n moksha,\n type VanaChainConfig,\n getChainConfig,\n getAllChains,\n} from \"./chains\";\nexport * from \"./chains\";\n\n// ABIs\nexport { getAbi } from \"./generated/abi\";\nexport type { VanaContract as VanaContractAbi } from \"./generated/abi\";\n\n// Generic utilities for extensibility\nexport {\n BaseController,\n RetryUtility,\n RateLimiter,\n MemoryCache,\n EventEmitter,\n MiddlewarePipeline,\n AsyncQueue,\n CircuitBreaker,\n} from \"./core/generics\";\n\n// Platform adapters - browser-safe exports\nexport { BrowserPlatformAdapter } from \"./platform/browser\";\nexport { BrowserECIESUint8Provider as BrowserECIESProvider } from \"./crypto/ecies/browser\";\nexport type { VanaPlatformAdapter } from \"./platform/interface\";\n\n// Browser-only platform adapter utilities\nexport {\n createBrowserPlatformAdapter,\n createPlatformAdapterSafe,\n} from \"./platform/browser-only\";\n\n// Note: createNodePlatformAdapter is not exported in browser bundle to avoid Node.js dependencies\n\n// NodePlatformAdapter is available through dynamic import to avoid bundling Node.js dependencies\n// Use createNodePlatformAdapter() for dynamic import\n\n// Platform utilities - browser-safe only\nexport {\n detectPlatform,\n isPlatformSupported,\n getPlatformCapabilities,\n} from \"./platform/utils\";\n\nexport { ApiClient } from \"./core/apiClient\";\n\nexport type {\n ApiClientConfig,\n HttpMethod,\n RequestOptions,\n} from \"./core/apiClient\";\n\n// Note: Default export is already handled above with the Vana factory function\n\n// For testing purposes, we also export the implementation class\nexport { VanaBrowserImpl };\n"],"mappings":"AAKA,SAAS,8BAA8B;AACvC,SAAS,gBAAgB;AAWzB,MAAM,wBAAwB,SAAS;AAAA,EACrC,YAAY,QAAoB;AAC9B,UAAM,IAAI,uBAAuB,GAAG,MAAM;AAAA,EAC5C;AACF;AAwGO,SAAS,KAAK,QAAoB;AACvC,SAAO,IAAI,gBAAgB,MAAM;AACnC;AAWA,IAAO,wBAAQ;AAIf,SAAS,YAAAA,WAAU,uBAAuB;AAM1C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,cAAc;AAGd,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AAGrC,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAWd,cAAc;AAGd,SAAS,oBAAoB,iBAAiB;AAC9C,SAAS,cAAc;AACvB;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AAGd,SAAS,cAAc;AAIvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,0BAAAC,+BAA8B;AACvC,SAAsC,iCAA4B;AAIlE;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAQP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;","names":["VanaCore","BrowserPlatformAdapter"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.browser.ts"],"sourcesContent":["/**\n * @module Browser\n * Browser-specific implementation of the Vana SDK\n */\n\nimport { BrowserPlatformAdapter } from \"./platform/browser\";\nimport { VanaCore } from \"./core\";\nimport type {\n VanaConfig,\n VanaConfigWithStorage,\n StorageRequiredMarker,\n} from \"./types\";\n\n/**\n * Internal implementation class for browser environments.\n * This class is not exported directly - use the Vana factory function instead.\n */\nclass VanaBrowserImpl extends VanaCore {\n constructor(config: VanaConfig) {\n super(new BrowserPlatformAdapter(), config);\n }\n}\n\n/**\n * Creates a new Vana SDK instance configured for browser environments.\n *\n * @remarks\n * This is the primary entry point for browser applications using the Vana SDK. The function\n * automatically detects your configuration type and provides compile-time type safety:\n * - **With storage configured**: All methods including file upload/download are available\n * - **Without storage**: Storage-dependent methods throw runtime errors and are excluded from TypeScript\n *\n * The SDK supports multiple wallet configurations (direct WalletClient or chain config),\n * various storage providers (IPFS, Pinata, Google Drive), and gasless transactions via relayers.\n * All operations are optimized for browser environments with proper bundle size optimization.\n *\n * @param config - Configuration object containing wallet, storage, and relayer settings\n * @returns A fully configured Vana SDK instance for browser use\n * @throws {InvalidConfigurationError} When configuration parameters are invalid or missing\n * @example\n * ```typescript\n * import { Vana } from '@opendatalabs/vana-sdk/browser';\n * import { createWalletClient, custom } from 'viem';\n * import { IPFSStorage } from '@opendatalabs/vana-sdk/browser';\n *\n * // Complete setup with storage and wallet\n * const walletClient = createWalletClient({\n * chain: mokshaTestnet,\n * transport: custom(window.ethereum)\n * });\n *\n * const vana = Vana({\n * walletClient,\n * storage: {\n * providers: {\n * ipfs: new IPFSStorage({ gateway: 'https://gateway.pinata.cloud' }),\n * pinata: new PinataStorage({ apiKey: process.env.PINATA_KEY })\n * },\n * defaultProvider: 'ipfs'\n * },\n * relayerCallbacks: {\n * async submitPermissionGrant(typedData, signature) {\n * const response = await fetch('/api/relay/grant', {\n * method: 'POST',\n * body: JSON.stringify({ typedData, signature })\n * });\n * return (await response.json()).transactionHash;\n * }\n * }\n * });\n *\n * // All operations now available\n * const files = await vana.data.getUserFiles();\n * const permissions = await vana.permissions.getUserPermissions();\n * await vana.data.upload({ content: 'My data', filename: 'data.txt' });\n * ```\n *\n * @example\n * ```typescript\n * // Minimal setup without storage (read-only operations)\n * const vanaReadOnly = Vana({ walletClient });\n *\n * // These work without storage\n * const files = await vanaReadOnly.data.getUserFiles();\n * const permissions = await vanaReadOnly.permissions.getUserPermissions();\n *\n * // This would throw a runtime error\n * // await vanaReadOnly.data.upload(params); // ❌ InvalidConfigurationError\n *\n * // Safe runtime check\n * if (vanaReadOnly.isStorageEnabled()) {\n * await vanaReadOnly.data.upload(params); // ✅ TypeScript allows this\n * } else {\n * console.log('Storage not configured - upload unavailable');\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Using chain configuration instead of wallet client\n * const vana = Vana({\n * chainId: 14800, // Moksha testnet\n * account: '0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36',\n * rpcUrl: 'https://rpc.moksha.vana.org',\n * storage: {\n * providers: { ipfs: new IPFSStorage() },\n * defaultProvider: 'ipfs'\n * }\n * });\n * ```\n *\n * @see {@link https://docs.vana.org/docs/sdk/getting-started | Getting Started Guide} for setup tutorials\n * @see {@link VanaCore} for the underlying implementation details\n * @category Core SDK\n */\nexport function Vana(\n config: VanaConfigWithStorage,\n): VanaBrowserImpl & StorageRequiredMarker;\nexport function Vana(config: VanaConfig): VanaBrowserImpl;\n/**\n * Creates a new Vana SDK instance.\n *\n * @param config - The configuration for the Vana SDK\n * @returns A new Vana SDK instance\n */\nexport function Vana(config: VanaConfig) {\n return new VanaBrowserImpl(config);\n}\n\n/**\n * The type of a Vana SDK instance in browser environments.\n * Uses InstanceType to properly expose all public methods from the class hierarchy.\n *\n * @see {@link Vana}\n */\nexport type VanaInstance = InstanceType<typeof VanaBrowserImpl>;\n\n// Export as default export\nexport default Vana;\n\n// Re-export everything that was in index.ts (avoiding circular dependency)\n// Core class and factory\nexport { VanaCore, VanaCoreFactory } from \"./core\";\n\n// Types - modular exports\nexport type * from \"./types\";\n\n// Type guards and utilities\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./types/external-apis\";\n\n// VanaContract is exported from abi to avoid circular dependencies\nexport type { VanaContract } from \"./generated/abi\";\n\n// Enhanced response pattern for improved developer experience\nexport {\n EnhancedTransactionResponse,\n canEnhanceResponse,\n enhanceResponse,\n} from \"./client/enhancedResponse\";\n\n// Error classes\nexport * from \"./errors\";\n\n// Controllers\nexport { PermissionsController } from \"./controllers/permissions\";\nexport { DataController } from \"./controllers/data\";\nexport { ServerController } from \"./controllers/server\";\nexport { ProtocolController } from \"./controllers/protocol\";\nexport { SchemaController } from \"./controllers/schemas\";\nexport { OperationsController } from \"./controllers/operations\";\nexport { StakingController } from \"./controllers/staking\";\nexport type {\n EntityInfo,\n StakerEntityInfo,\n StakerEntitySummary,\n} from \"./controllers/staking\";\n\n// Contract controller\nexport * from \"./contracts/contractController\";\n\n// Utilities\nexport * from \"./utils/encryption\";\nexport * from \"./utils/formatters\";\nexport * from \"./utils/grantFiles\";\nexport * from \"./utils/grantValidation\";\nexport * from \"./utils/grants\";\nexport * from \"./utils/ipfs\";\nexport * from \"./utils/schemaValidation\";\nexport * from \"./utils/signatureCache\";\n// TransactionHandle removed - using POJOs instead\nexport type {\n Operation,\n TransactionResult,\n TransactionReceipt,\n PollingOptions,\n TransactionWaitOptions,\n} from \"./types/operations\";\n\n// Storage API\nexport * from \"./storage\";\n\n// Configuration\nexport { getContractAddress, CONTRACTS } from \"./generated/addresses\";\nexport { chains } from \"./config/chains\";\nexport {\n type ServiceEndpoints,\n mainnetServices,\n mokshaServices,\n getServiceEndpoints,\n getDefaultPersonalServerUrl,\n} from \"./config/default-services\";\n\n// Chain configurations with subgraph URLs - explicit exports for better DX\nexport {\n vanaMainnet,\n mokshaTestnet,\n moksha,\n type VanaChainConfig,\n getChainConfig,\n getAllChains,\n} from \"./chains\";\nexport * from \"./chains\";\n\n// ABIs\nexport { getAbi } from \"./generated/abi\";\nexport type { VanaContract as VanaContractAbi } from \"./generated/abi\";\n\n// Generic utilities for extensibility\nexport {\n BaseController,\n RetryUtility,\n RateLimiter,\n MemoryCache,\n EventEmitter,\n MiddlewarePipeline,\n AsyncQueue,\n CircuitBreaker,\n} from \"./core/generics\";\n\n// Platform adapters - browser-safe exports\nexport { BrowserPlatformAdapter } from \"./platform/browser\";\nexport { BrowserECIESUint8Provider as BrowserECIESProvider } from \"./crypto/ecies/browser\";\nexport type { VanaPlatformAdapter } from \"./platform/interface\";\n\n// ECIES utilities and types (exported via module index for consistency)\nexport {\n ECIESError,\n isECIESEncrypted,\n serializeECIES,\n deserializeECIES,\n} from \"./crypto/ecies\";\nexport type {\n ECIESProvider,\n ECIESEncrypted,\n ECIESOptions,\n} from \"./crypto/ecies\";\n\n// Browser-only platform adapter utilities\nexport {\n createBrowserPlatformAdapter,\n createPlatformAdapterSafe,\n} from \"./platform/browser-only\";\n\n// Note: createNodePlatformAdapter is not exported in browser bundle to avoid Node.js dependencies\n\n// NodePlatformAdapter is available through dynamic import to avoid bundling Node.js dependencies\n// Use createNodePlatformAdapter() for dynamic import\n\n// Platform utilities - browser-safe only\nexport {\n detectPlatform,\n isPlatformSupported,\n getPlatformCapabilities,\n} from \"./platform/utils\";\n\nexport { ApiClient } from \"./core/apiClient\";\n\nexport type {\n ApiClientConfig,\n HttpMethod,\n RequestOptions,\n} from \"./core/apiClient\";\n\n// Note: Default export is already handled above with the Vana factory function\n\n// For testing purposes, we also export the implementation class\nexport { VanaBrowserImpl };\n"],"mappings":"AAKA,SAAS,8BAA8B;AACvC,SAAS,gBAAgB;AAWzB,MAAM,wBAAwB,SAAS;AAAA,EACrC,YAAY,QAAoB;AAC9B,UAAM,IAAI,uBAAuB,GAAG,MAAM;AAAA,EAC5C;AACF;AAwGO,SAAS,KAAK,QAAoB;AACvC,SAAO,IAAI,gBAAgB,MAAM;AACnC;AAWA,IAAO,wBAAQ;AAIf,SAAS,YAAAA,WAAU,uBAAuB;AAM1C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,cAAc;AAGd,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AACrC,SAAS,yBAAyB;AAQlC,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAWd,cAAc;AAGd,SAAS,oBAAoB,iBAAiB;AAC9C,SAAS,cAAc;AACvB;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AAGd,SAAS,cAAc;AAIvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,0BAAAC,+BAA8B;AACvC,SAAsC,iCAA4B;AAIlE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAQP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;","names":["VanaCore","BrowserPlatformAdapter"]}
|
package/dist/index.node.cjs
CHANGED
|
@@ -27,11 +27,13 @@ __export(index_node_exports, {
|
|
|
27
27
|
CircuitBreaker: () => import_generics.CircuitBreaker,
|
|
28
28
|
DataController: () => import_data.DataController,
|
|
29
29
|
DistributedNonceManager: () => import_nonceManager.DistributedNonceManager,
|
|
30
|
+
ECIESError: () => import_ecies.ECIESError,
|
|
30
31
|
EnhancedTransactionResponse: () => import_enhancedResponse.EnhancedTransactionResponse,
|
|
31
32
|
EventEmitter: () => import_generics.EventEmitter,
|
|
32
33
|
InMemoryNonceManager: () => import_inMemoryNonceManager.InMemoryNonceManager,
|
|
33
34
|
MemoryCache: () => import_generics.MemoryCache,
|
|
34
35
|
MiddlewarePipeline: () => import_generics.MiddlewarePipeline,
|
|
36
|
+
NodeECIESProvider: () => import_node3.NodeECIESUint8Provider,
|
|
35
37
|
NodePlatformAdapter: () => import_node2.NodePlatformAdapter,
|
|
36
38
|
OperationsController: () => import_operations.OperationsController,
|
|
37
39
|
PermissionsController: () => import_permissions.PermissionsController,
|
|
@@ -41,6 +43,7 @@ __export(index_node_exports, {
|
|
|
41
43
|
RetryUtility: () => import_generics.RetryUtility,
|
|
42
44
|
SchemaController: () => import_schemas.SchemaController,
|
|
43
45
|
ServerController: () => import_server.ServerController,
|
|
46
|
+
StakingController: () => import_staking.StakingController,
|
|
44
47
|
SystemHealthChecker: () => import_health.SystemHealthChecker,
|
|
45
48
|
Vana: () => Vana,
|
|
46
49
|
VanaCore: () => import_core2.VanaCore,
|
|
@@ -54,6 +57,7 @@ __export(index_node_exports, {
|
|
|
54
57
|
createPlatformAdapterFor: () => import_utils.createPlatformAdapterFor,
|
|
55
58
|
createPlatformAdapterSafe: () => import_browser_safe.createPlatformAdapterSafe,
|
|
56
59
|
default: () => index_node_default,
|
|
60
|
+
deserializeECIES: () => import_ecies.deserializeECIES,
|
|
57
61
|
detectPlatform: () => import_utils.detectPlatform,
|
|
58
62
|
enhanceResponse: () => import_enhancedResponse.enhanceResponse,
|
|
59
63
|
getAbi: () => import_abi.getAbi,
|
|
@@ -65,6 +69,7 @@ __export(index_node_exports, {
|
|
|
65
69
|
getServiceEndpoints: () => import_default_services.getServiceEndpoints,
|
|
66
70
|
handleRelayerOperation: () => import_relayerHandler.handleRelayerOperation,
|
|
67
71
|
isAPIResponse: () => import_external_apis.isAPIResponse,
|
|
72
|
+
isECIESEncrypted: () => import_ecies.isECIESEncrypted,
|
|
68
73
|
isPlatformSupported: () => import_utils.isPlatformSupported,
|
|
69
74
|
isReplicateAPIResponse: () => import_external_apis.isReplicateAPIResponse,
|
|
70
75
|
mainnetServices: () => import_default_services.mainnetServices,
|
|
@@ -73,6 +78,7 @@ __export(index_node_exports, {
|
|
|
73
78
|
mokshaTestnet: () => import_chains2.mokshaTestnet,
|
|
74
79
|
parseReplicateOutput: () => import_external_apis.parseReplicateOutput,
|
|
75
80
|
safeParseJSON: () => import_external_apis.safeParseJSON,
|
|
81
|
+
serializeECIES: () => import_ecies.serializeECIES,
|
|
76
82
|
vanaMainnet: () => import_chains2.vanaMainnet
|
|
77
83
|
});
|
|
78
84
|
module.exports = __toCommonJS(index_node_exports);
|
|
@@ -92,6 +98,7 @@ var import_server = require("./controllers/server");
|
|
|
92
98
|
var import_protocol = require("./controllers/protocol");
|
|
93
99
|
var import_schemas = require("./controllers/schemas");
|
|
94
100
|
var import_operations = require("./controllers/operations");
|
|
101
|
+
var import_staking = require("./controllers/staking");
|
|
95
102
|
__reExport(index_node_exports, require("./contracts/contractController"), module.exports);
|
|
96
103
|
__reExport(index_node_exports, require("./utils/encryption"), module.exports);
|
|
97
104
|
__reExport(index_node_exports, require("./utils/formatters"), module.exports);
|
|
@@ -112,6 +119,8 @@ var import_generics = require("./core/generics");
|
|
|
112
119
|
var import_relayerHandler = require("./server/relayerHandler");
|
|
113
120
|
var import_node2 = require("./platform/node");
|
|
114
121
|
var import_browser = require("./platform/browser");
|
|
122
|
+
var import_node3 = require("./crypto/ecies/node");
|
|
123
|
+
var import_ecies = require("./crypto/ecies");
|
|
115
124
|
var import_utils = require("./platform/utils");
|
|
116
125
|
var import_browser_safe = require("./platform/browser-safe");
|
|
117
126
|
var import_apiClient = require("./core/apiClient");
|
|
@@ -138,11 +147,13 @@ var index_node_default = Vana;
|
|
|
138
147
|
CircuitBreaker,
|
|
139
148
|
DataController,
|
|
140
149
|
DistributedNonceManager,
|
|
150
|
+
ECIESError,
|
|
141
151
|
EnhancedTransactionResponse,
|
|
142
152
|
EventEmitter,
|
|
143
153
|
InMemoryNonceManager,
|
|
144
154
|
MemoryCache,
|
|
145
155
|
MiddlewarePipeline,
|
|
156
|
+
NodeECIESProvider,
|
|
146
157
|
NodePlatformAdapter,
|
|
147
158
|
OperationsController,
|
|
148
159
|
PermissionsController,
|
|
@@ -152,6 +163,7 @@ var index_node_default = Vana;
|
|
|
152
163
|
RetryUtility,
|
|
153
164
|
SchemaController,
|
|
154
165
|
ServerController,
|
|
166
|
+
StakingController,
|
|
155
167
|
SystemHealthChecker,
|
|
156
168
|
Vana,
|
|
157
169
|
VanaCore,
|
|
@@ -164,6 +176,7 @@ var index_node_default = Vana;
|
|
|
164
176
|
createPlatformAdapter,
|
|
165
177
|
createPlatformAdapterFor,
|
|
166
178
|
createPlatformAdapterSafe,
|
|
179
|
+
deserializeECIES,
|
|
167
180
|
detectPlatform,
|
|
168
181
|
enhanceResponse,
|
|
169
182
|
getAbi,
|
|
@@ -175,6 +188,7 @@ var index_node_default = Vana;
|
|
|
175
188
|
getServiceEndpoints,
|
|
176
189
|
handleRelayerOperation,
|
|
177
190
|
isAPIResponse,
|
|
191
|
+
isECIESEncrypted,
|
|
178
192
|
isPlatformSupported,
|
|
179
193
|
isReplicateAPIResponse,
|
|
180
194
|
mainnetServices,
|
|
@@ -183,6 +197,7 @@ var index_node_default = Vana;
|
|
|
183
197
|
mokshaTestnet,
|
|
184
198
|
parseReplicateOutput,
|
|
185
199
|
safeParseJSON,
|
|
200
|
+
serializeECIES,
|
|
186
201
|
vanaMainnet,
|
|
187
202
|
...require("./errors"),
|
|
188
203
|
...require("./contracts/contractController"),
|
package/dist/index.node.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.node.ts"],"sourcesContent":["/**\n * @module Node\n * Node.js-specific implementation of the Vana SDK\n */\n\nimport { NodePlatformAdapter } from \"./platform/node\";\nimport { VanaCore } from \"./core\";\nimport type {\n VanaConfig,\n VanaConfigWithStorage,\n StorageRequiredMarker,\n RelayerRequiredMarker,\n} from \"./types\";\nimport type {\n IOperationStore,\n IRelayerStateStore,\n} from \"./types/operationStore\";\nimport type { IAtomicStore } from \"./types/atomicStore\";\nimport type { PublicClient } from \"viem\";\n\n/**\n * Node.js-specific configuration interface with operation store support\n *\n * @category Configuration\n */\nexport type VanaNodeConfig = VanaConfig & {\n operationStore?: IOperationStore | IRelayerStateStore; // Can be either type\n atomicStore?: IAtomicStore;\n};\n\n/**\n * Node.js configuration with storage requirements\n *\n * @category Configuration\n */\nexport type VanaNodeConfigWithStorage = VanaConfigWithStorage & {\n operationStore?: IOperationStore | IRelayerStateStore; // Can be either type\n atomicStore?: IAtomicStore;\n};\n\n/**\n * Internal implementation class for Node.js environments.\n * This class is not exported directly - use the Vana factory function instead.\n */\nclass VanaNodeImpl extends VanaCore {\n override readonly operationStore?: IOperationStore | IRelayerStateStore;\n override readonly atomicStore?: IAtomicStore;\n\n constructor(config: VanaNodeConfig) {\n super(new NodePlatformAdapter(), config);\n this.operationStore = config.operationStore;\n this.atomicStore = config.atomicStore;\n }\n}\n\n/**\n * Creates a new Vana SDK instance configured for Node.js environments.\n *\n * @remarks\n * This is the primary entry point for Node.js applications using the Vana SDK. The function\n * automatically detects your configuration type and provides compile-time type safety:\n * - **With storage configured**: All methods including file upload/download are available\n * - **Without storage**: Storage-dependent methods throw runtime errors and are excluded from TypeScript\n *\n * The Node.js version provides enhanced capabilities including native file system access,\n * server-side cryptographic operations, and support for personal server deployment.\n * It includes all browser capabilities plus Node.js-specific optimizations and utilities.\n *\n * @param config - Configuration object containing wallet, storage, and relayer settings\n * @returns A fully configured Vana SDK instance for Node.js use\n * @throws {InvalidConfigurationError} When configuration parameters are invalid or missing\n * @example\n * ```typescript\n * import { Vana } from '@opendatalabs/vana-sdk/node';\n * import { createWalletClient, http } from 'viem';\n * import { privateKeyToAccount } from 'viem/accounts';\n * import { IPFSStorage, PinataStorage } from '@opendatalabs/vana-sdk/node';\n * import { mokshaTestnet } from '@opendatalabs/vana-sdk/node';\n *\n * // Server setup with private key\n * const account = privateKeyToAccount('0x...');\n * const walletClient = createWalletClient({\n * account,\n * chain: mokshaTestnet,\n * transport: http('https://rpc.moksha.vana.org')\n * });\n *\n * const vana = Vana({\n * walletClient,\n * storage: {\n * providers: {\n * ipfs: new IPFSStorage({\n * gateway: 'https://gateway.pinata.cloud',\n * timeout: 30000\n * }),\n * pinata: new PinataStorage({\n * apiKey: process.env.PINATA_KEY,\n * secretKey: process.env.PINATA_SECRET\n * })\n * },\n * defaultProvider: 'pinata'\n * },\n * relayerCallbacks: {\n * async submitPermissionGrant(typedData, signature) {\n * // Server-side relayer implementation\n * return await submitToCustomRelayer(typedData, signature);\n * }\n * }\n * });\n *\n * // Server operations\n * const uploadResult = await vana.data.upload({\n * content: await fs.readFile('./user-data.json'),\n * filename: 'user-data.json',\n * schemaId: 1\n * });\n *\n * // Personal server setup\n * await vana.server.setupPersonalServer({\n * serverUrl: 'https://my-server.example.com',\n * capabilities: ['data_processing', 'ml_inference']\n * });\n * ```\n *\n * @example\n * ```typescript\n * // CLI tool or script usage\n * const vana = Vana({\n * chainId: 14800, // Moksha testnet\n * account: privateKeyToAccount(process.env.PRIVATE_KEY),\n * rpcUrl: process.env.RPC_URL,\n * storage: {\n * providers: { ipfs: new IPFSStorage() },\n * defaultProvider: 'ipfs'\n * }\n * });\n *\n * // Batch operations for data processing\n * const userFiles = await vana.data.getUserFiles({\n * owner: process.env.USER_ADDRESS\n * });\n *\n * for (const file of userFiles) {\n * const decrypted = await vana.data.decryptFile(file);\n * // Process file data...\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Express.js server integration\n * import express from 'express';\n * import { handleRelayerOperation } from '@opendatalabs/vana-sdk/node';\n *\n * const app = express();\n *\n * app.post('/api/relay', async (req, res) => {\n * try {\n * const result = await handleRelayerOperation(\n * vana,\n * req.body\n * );\n * res.json(result);\n * } catch (error) {\n * res.status(500).json({ error: error.message });\n * }\n * });\n * ```\n *\n * @see {@link https://docs.vana.org/docs/sdk/server-setup | Server Setup Guide} for Node.js-specific features\n * @see {@link VanaCore} for the underlying implementation details\n * @category Core SDK\n */\n// Overload 1: For configurations that include both storage and operation store\nexport function Vana(\n config: VanaNodeConfigWithStorage & { operationStore: IOperationStore },\n): VanaNodeImpl & StorageRequiredMarker & RelayerRequiredMarker;\n\n// Overload 2: For configurations that include only the operation store\nexport function Vana(\n config: VanaNodeConfig & { operationStore: IOperationStore },\n): VanaNodeImpl & RelayerRequiredMarker;\n\n// Overload 3: For configurations with storage but no operation store\nexport function Vana(\n config: VanaNodeConfigWithStorage,\n): VanaNodeImpl & StorageRequiredMarker;\n\n// Overload 4: Base configuration without special requirements\nexport function Vana(config: VanaNodeConfig): VanaNodeImpl;\n\n// Implementation\nexport function Vana(config: VanaNodeConfig) {\n return new VanaNodeImpl(config);\n}\n\n/**\n * The type of a Vana SDK instance in Node.js environments.\n * Uses InstanceType to properly expose all public methods from the class hierarchy.\n *\n * @see {@link Vana}\n */\nexport type VanaInstance = InstanceType<typeof VanaNodeImpl>;\n\n// Export as default export\nexport default Vana;\n\n// Re-export everything that was in index.ts (avoiding circular dependency)\n// Core class and factory\nexport { VanaCore, VanaCoreFactory } from \"./core\";\nexport { DistributedNonceManager } from \"./core/nonceManager\";\nexport { InMemoryNonceManager } from \"./core/inMemoryNonceManager\";\nexport { SystemHealthChecker } from \"./core/health\";\nexport type {\n SystemHealthCheckerConfig,\n HealthStatus,\n ComponentHealth,\n NonceHealth,\n QueueHealth,\n} from \"./core/health\";\n\n// Storage implementations\nexport { RedisAtomicStore } from \"./lib/redisAtomicStore\";\nexport type { RedisAtomicStoreConfig } from \"./lib/redisAtomicStore\";\n\n// Types - modular exports\nexport type * from \"./types\";\nexport type { IAtomicStore } from \"./types/atomicStore\";\nexport type {\n IOperationStore,\n StoredOperation,\n IRelayerStateStore,\n OperationState,\n} from \"./types/operationStore\";\n\n// Type guards and utilities\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./types/external-apis\";\n\n// VanaContract is exported from abi to avoid circular dependencies\nexport type { VanaContract } from \"./generated/abi\";\n\n// Enhanced response pattern for improved developer experience\nexport {\n EnhancedTransactionResponse,\n canEnhanceResponse,\n enhanceResponse,\n} from \"./client/enhancedResponse\";\n\n// Error classes\nexport * from \"./errors\";\n\n// Controllers\nexport { PermissionsController } from \"./controllers/permissions\";\nexport { DataController } from \"./controllers/data\";\nexport { ServerController } from \"./controllers/server\";\nexport { ProtocolController } from \"./controllers/protocol\";\nexport { SchemaController } from \"./controllers/schemas\";\nexport { OperationsController } from \"./controllers/operations\";\n\n// Contract controller\nexport * from \"./contracts/contractController\";\n\n// Utilities\nexport * from \"./utils/encryption\";\nexport * from \"./utils/formatters\";\nexport * from \"./utils/grantFiles\";\nexport * from \"./utils/grantValidation\";\nexport * from \"./utils/grants\";\nexport * from \"./utils/ipfs\";\nexport * from \"./utils/schemaValidation\";\nexport * from \"./utils/signatureCache\";\n\n// Storage API\nexport * from \"./storage\";\n\n// Configuration\nexport { getContractAddress, CONTRACTS } from \"./generated/addresses\";\nexport { chains } from \"./config/chains\";\nexport {\n type ServiceEndpoints,\n mainnetServices,\n mokshaServices,\n getServiceEndpoints,\n getDefaultPersonalServerUrl,\n} from \"./config/default-services\";\n\n// Chain configurations with subgraph URLs - explicit exports for better DX\nexport {\n vanaMainnet,\n mokshaTestnet,\n moksha,\n type VanaChainConfig,\n getChainConfig,\n getAllChains,\n} from \"./chains\";\nexport * from \"./chains\";\n\n// ABIs\nexport { getAbi } from \"./generated/abi\";\nexport type { VanaContract as VanaContractAbi } from \"./generated/abi\";\n\n// Generic utilities for extensibility\nexport {\n BaseController,\n RetryUtility,\n RateLimiter,\n MemoryCache,\n EventEmitter,\n MiddlewarePipeline,\n AsyncQueue,\n CircuitBreaker,\n} from \"./core/generics\";\n\n// Server-side utilities\nexport {\n handleRelayerOperation,\n type RelayerOperationOptions,\n} from \"./server/relayerHandler\";\nexport type {\n UnifiedRelayerRequest,\n UnifiedRelayerResponse,\n} from \"./types/relayer\";\n// TransactionHandle removed - using POJOs instead\nexport type {\n Operation,\n TransactionResult,\n TransactionReceipt,\n PollingOptions,\n TransactionWaitOptions,\n} from \"./types/operations\";\n\n// Platform adapters\nexport { NodePlatformAdapter } from \"./platform/node\";\nexport { BrowserPlatformAdapter } from \"./platform/browser\";\nexport type { VanaPlatformAdapter } from \"./platform/interface\";\n\n// Platform utilities\nexport {\n detectPlatform,\n createPlatformAdapter,\n createPlatformAdapterFor,\n isPlatformSupported,\n getPlatformCapabilities,\n} from \"./platform/utils\";\n\n// Browser-safe platform utilities\nexport {\n createNodePlatformAdapter,\n createBrowserPlatformAdapter,\n createPlatformAdapterSafe,\n} from \"./platform/browser-safe\";\n\nexport { ApiClient } from \"./core/apiClient\";\n\nexport type {\n ApiClientConfig,\n HttpMethod,\n RequestOptions,\n} from \"./core/apiClient\";\n\n// Note: Default export is already handled above with the Vana factory function\n// For testing purposes, we also export the implementation class\nexport { VanaNodeImpl };\n\n// Server-specific interface for accessing stores\nexport interface VanaWithStores {\n readonly operationStore?: IOperationStore | IRelayerStateStore;\n readonly atomicStore?: IAtomicStore;\n readonly publicClient: PublicClient;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,kBAAoC;AACpC,kBAAyB;AA2MzB,IAAAA,eAA0C;AAC1C,0BAAwC;AACxC,kCAAqC;AACrC,oBAAoC;AAUpC,8BAAiC;AAcjC,2BAKO;AAMP,8BAIO;AAGP,+BAAc,qBA9Pd;AAiQA,yBAAsC;AACtC,kBAA+B;AAC/B,oBAAiC;AACjC,sBAAmC;AACnC,qBAAiC;AACjC,wBAAqC;AAGrC,+BAAc,2CAzQd;AA4QA,+BAAc,+BA5Qd;AA6QA,+BAAc,+BA7Qd;AA8QA,+BAAc,+BA9Qd;AA+QA,+BAAc,oCA/Qd;AAgRA,+BAAc,2BAhRd;AAiRA,+BAAc,yBAjRd;AAkRA,+BAAc,qCAlRd;AAmRA,+BAAc,mCAnRd;AAsRA,+BAAc,sBAtRd;AAyRA,uBAA8C;AAC9C,oBAAuB;AACvB,8BAMO;AAGP,IAAAC,iBAOO;AACP,+BAAc,qBA5Sd;AA+SA,iBAAuB;AAIvB,sBASO;AAGP,4BAGO;AAeP,IAAAC,eAAoC;AACpC,qBAAuC;AAIvC,mBAMO;AAGP,0BAIO;AAEP,uBAA0B;AAzT1B,MAAM,qBAAqB,qBAAS;AAAA,EAChB;AAAA,EACA;AAAA,EAElB,YAAY,QAAwB;AAClC,UAAM,IAAI,gCAAoB,GAAG,MAAM;AACvC,SAAK,iBAAiB,OAAO;AAC7B,SAAK,cAAc,OAAO;AAAA,EAC5B;AACF;AA2IO,SAAS,KAAK,QAAwB;AAC3C,SAAO,IAAI,aAAa,MAAM;AAChC;AAWA,IAAO,qBAAQ;","names":["import_core","import_chains","import_node"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.node.ts"],"sourcesContent":["/**\n * @module Node\n * Node.js-specific implementation of the Vana SDK\n */\n\nimport { NodePlatformAdapter } from \"./platform/node\";\nimport { VanaCore } from \"./core\";\nimport type {\n VanaConfig,\n VanaConfigWithStorage,\n StorageRequiredMarker,\n RelayerRequiredMarker,\n} from \"./types\";\nimport type {\n IOperationStore,\n IRelayerStateStore,\n} from \"./types/operationStore\";\nimport type { IAtomicStore } from \"./types/atomicStore\";\nimport type { PublicClient } from \"viem\";\n\n/**\n * Node.js-specific configuration interface with operation store support\n *\n * @category Configuration\n */\nexport type VanaNodeConfig = VanaConfig & {\n operationStore?: IOperationStore | IRelayerStateStore; // Can be either type\n atomicStore?: IAtomicStore;\n};\n\n/**\n * Node.js configuration with storage requirements\n *\n * @category Configuration\n */\nexport type VanaNodeConfigWithStorage = VanaConfigWithStorage & {\n operationStore?: IOperationStore | IRelayerStateStore; // Can be either type\n atomicStore?: IAtomicStore;\n};\n\n/**\n * Internal implementation class for Node.js environments.\n * This class is not exported directly - use the Vana factory function instead.\n */\nclass VanaNodeImpl extends VanaCore {\n override readonly operationStore?: IOperationStore | IRelayerStateStore;\n override readonly atomicStore?: IAtomicStore;\n\n constructor(config: VanaNodeConfig) {\n super(new NodePlatformAdapter(), config);\n this.operationStore = config.operationStore;\n this.atomicStore = config.atomicStore;\n }\n}\n\n/**\n * Creates a new Vana SDK instance configured for Node.js environments.\n *\n * @remarks\n * This is the primary entry point for Node.js applications using the Vana SDK. The function\n * automatically detects your configuration type and provides compile-time type safety:\n * - **With storage configured**: All methods including file upload/download are available\n * - **Without storage**: Storage-dependent methods throw runtime errors and are excluded from TypeScript\n *\n * The Node.js version provides enhanced capabilities including native file system access,\n * server-side cryptographic operations, and support for personal server deployment.\n * It includes all browser capabilities plus Node.js-specific optimizations and utilities.\n *\n * @param config - Configuration object containing wallet, storage, and relayer settings\n * @returns A fully configured Vana SDK instance for Node.js use\n * @throws {InvalidConfigurationError} When configuration parameters are invalid or missing\n * @example\n * ```typescript\n * import { Vana } from '@opendatalabs/vana-sdk/node';\n * import { createWalletClient, http } from 'viem';\n * import { privateKeyToAccount } from 'viem/accounts';\n * import { IPFSStorage, PinataStorage } from '@opendatalabs/vana-sdk/node';\n * import { mokshaTestnet } from '@opendatalabs/vana-sdk/node';\n *\n * // Server setup with private key\n * const account = privateKeyToAccount('0x...');\n * const walletClient = createWalletClient({\n * account,\n * chain: mokshaTestnet,\n * transport: http('https://rpc.moksha.vana.org')\n * });\n *\n * const vana = Vana({\n * walletClient,\n * storage: {\n * providers: {\n * ipfs: new IPFSStorage({\n * gateway: 'https://gateway.pinata.cloud',\n * timeout: 30000\n * }),\n * pinata: new PinataStorage({\n * apiKey: process.env.PINATA_KEY,\n * secretKey: process.env.PINATA_SECRET\n * })\n * },\n * defaultProvider: 'pinata'\n * },\n * relayerCallbacks: {\n * async submitPermissionGrant(typedData, signature) {\n * // Server-side relayer implementation\n * return await submitToCustomRelayer(typedData, signature);\n * }\n * }\n * });\n *\n * // Server operations\n * const uploadResult = await vana.data.upload({\n * content: await fs.readFile('./user-data.json'),\n * filename: 'user-data.json',\n * schemaId: 1\n * });\n *\n * // Personal server setup\n * await vana.server.setupPersonalServer({\n * serverUrl: 'https://my-server.example.com',\n * capabilities: ['data_processing', 'ml_inference']\n * });\n * ```\n *\n * @example\n * ```typescript\n * // CLI tool or script usage\n * const vana = Vana({\n * chainId: 14800, // Moksha testnet\n * account: privateKeyToAccount(process.env.PRIVATE_KEY),\n * rpcUrl: process.env.RPC_URL,\n * storage: {\n * providers: { ipfs: new IPFSStorage() },\n * defaultProvider: 'ipfs'\n * }\n * });\n *\n * // Batch operations for data processing\n * const userFiles = await vana.data.getUserFiles({\n * owner: process.env.USER_ADDRESS\n * });\n *\n * for (const file of userFiles) {\n * const decrypted = await vana.data.decryptFile(file);\n * // Process file data...\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Express.js server integration\n * import express from 'express';\n * import { handleRelayerOperation } from '@opendatalabs/vana-sdk/node';\n *\n * const app = express();\n *\n * app.post('/api/relay', async (req, res) => {\n * try {\n * const result = await handleRelayerOperation(\n * vana,\n * req.body\n * );\n * res.json(result);\n * } catch (error) {\n * res.status(500).json({ error: error.message });\n * }\n * });\n * ```\n *\n * @see {@link https://docs.vana.org/docs/sdk/server-setup | Server Setup Guide} for Node.js-specific features\n * @see {@link VanaCore} for the underlying implementation details\n * @category Core SDK\n */\n// Overload 1: For configurations that include both storage and operation store\nexport function Vana(\n config: VanaNodeConfigWithStorage & { operationStore: IOperationStore },\n): VanaNodeImpl & StorageRequiredMarker & RelayerRequiredMarker;\n\n// Overload 2: For configurations that include only the operation store\nexport function Vana(\n config: VanaNodeConfig & { operationStore: IOperationStore },\n): VanaNodeImpl & RelayerRequiredMarker;\n\n// Overload 3: For configurations with storage but no operation store\nexport function Vana(\n config: VanaNodeConfigWithStorage,\n): VanaNodeImpl & StorageRequiredMarker;\n\n// Overload 4: Base configuration without special requirements\nexport function Vana(config: VanaNodeConfig): VanaNodeImpl;\n\n// Implementation\nexport function Vana(config: VanaNodeConfig) {\n return new VanaNodeImpl(config);\n}\n\n/**\n * The type of a Vana SDK instance in Node.js environments.\n * Uses InstanceType to properly expose all public methods from the class hierarchy.\n *\n * @see {@link Vana}\n */\nexport type VanaInstance = InstanceType<typeof VanaNodeImpl>;\n\n// Export as default export\nexport default Vana;\n\n// Re-export everything that was in index.ts (avoiding circular dependency)\n// Core class and factory\nexport { VanaCore, VanaCoreFactory } from \"./core\";\nexport { DistributedNonceManager } from \"./core/nonceManager\";\nexport { InMemoryNonceManager } from \"./core/inMemoryNonceManager\";\nexport { SystemHealthChecker } from \"./core/health\";\nexport type {\n SystemHealthCheckerConfig,\n HealthStatus,\n ComponentHealth,\n NonceHealth,\n QueueHealth,\n} from \"./core/health\";\n\n// Storage implementations\nexport { RedisAtomicStore } from \"./lib/redisAtomicStore\";\nexport type { RedisAtomicStoreConfig } from \"./lib/redisAtomicStore\";\n\n// Types - modular exports\nexport type * from \"./types\";\nexport type { IAtomicStore } from \"./types/atomicStore\";\nexport type {\n IOperationStore,\n StoredOperation,\n IRelayerStateStore,\n OperationState,\n} from \"./types/operationStore\";\n\n// Type guards and utilities\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./types/external-apis\";\n\n// VanaContract is exported from abi to avoid circular dependencies\nexport type { VanaContract } from \"./generated/abi\";\n\n// Enhanced response pattern for improved developer experience\nexport {\n EnhancedTransactionResponse,\n canEnhanceResponse,\n enhanceResponse,\n} from \"./client/enhancedResponse\";\n\n// Error classes\nexport * from \"./errors\";\n\n// Controllers\nexport { PermissionsController } from \"./controllers/permissions\";\nexport { DataController } from \"./controllers/data\";\nexport { ServerController } from \"./controllers/server\";\nexport { ProtocolController } from \"./controllers/protocol\";\nexport { SchemaController } from \"./controllers/schemas\";\nexport { OperationsController } from \"./controllers/operations\";\nexport { StakingController } from \"./controllers/staking\";\nexport type {\n EntityInfo,\n StakerEntityInfo,\n StakerEntitySummary,\n} from \"./controllers/staking\";\n\n// Contract controller\nexport * from \"./contracts/contractController\";\n\n// Utilities\nexport * from \"./utils/encryption\";\nexport * from \"./utils/formatters\";\nexport * from \"./utils/grantFiles\";\nexport * from \"./utils/grantValidation\";\nexport * from \"./utils/grants\";\nexport * from \"./utils/ipfs\";\nexport * from \"./utils/schemaValidation\";\nexport * from \"./utils/signatureCache\";\n\n// Storage API\nexport * from \"./storage\";\n\n// Configuration\nexport { getContractAddress, CONTRACTS } from \"./generated/addresses\";\nexport { chains } from \"./config/chains\";\nexport {\n type ServiceEndpoints,\n mainnetServices,\n mokshaServices,\n getServiceEndpoints,\n getDefaultPersonalServerUrl,\n} from \"./config/default-services\";\n\n// Chain configurations with subgraph URLs - explicit exports for better DX\nexport {\n vanaMainnet,\n mokshaTestnet,\n moksha,\n type VanaChainConfig,\n getChainConfig,\n getAllChains,\n} from \"./chains\";\nexport * from \"./chains\";\n\n// ABIs\nexport { getAbi } from \"./generated/abi\";\nexport type { VanaContract as VanaContractAbi } from \"./generated/abi\";\n\n// Generic utilities for extensibility\nexport {\n BaseController,\n RetryUtility,\n RateLimiter,\n MemoryCache,\n EventEmitter,\n MiddlewarePipeline,\n AsyncQueue,\n CircuitBreaker,\n} from \"./core/generics\";\n\n// Server-side utilities\nexport {\n handleRelayerOperation,\n type RelayerOperationOptions,\n} from \"./server/relayerHandler\";\nexport type {\n UnifiedRelayerRequest,\n UnifiedRelayerResponse,\n} from \"./types/relayer\";\n// TransactionHandle removed - using POJOs instead\nexport type {\n Operation,\n TransactionResult,\n TransactionReceipt,\n PollingOptions,\n TransactionWaitOptions,\n} from \"./types/operations\";\n\n// Platform adapters\nexport { NodePlatformAdapter } from \"./platform/node\";\nexport { BrowserPlatformAdapter } from \"./platform/browser\";\nexport { NodeECIESUint8Provider as NodeECIESProvider } from \"./crypto/ecies/node\";\nexport type { VanaPlatformAdapter } from \"./platform/interface\";\n\n// ECIES utilities and types (platform-agnostic, exported via module index)\nexport {\n ECIESError,\n isECIESEncrypted,\n serializeECIES,\n deserializeECIES,\n} from \"./crypto/ecies\";\nexport type {\n ECIESProvider,\n ECIESEncrypted,\n ECIESOptions,\n} from \"./crypto/ecies\";\n\n// Platform utilities\nexport {\n detectPlatform,\n createPlatformAdapter,\n createPlatformAdapterFor,\n isPlatformSupported,\n getPlatformCapabilities,\n} from \"./platform/utils\";\n\n// Browser-safe platform utilities\nexport {\n createNodePlatformAdapter,\n createBrowserPlatformAdapter,\n createPlatformAdapterSafe,\n} from \"./platform/browser-safe\";\n\nexport { ApiClient } from \"./core/apiClient\";\n\nexport type {\n ApiClientConfig,\n HttpMethod,\n RequestOptions,\n} from \"./core/apiClient\";\n\n// Note: Default export is already handled above with the Vana factory function\n// For testing purposes, we also export the implementation class\nexport { VanaNodeImpl };\n\n// Server-specific interface for accessing stores\nexport interface VanaWithStores {\n readonly operationStore?: IOperationStore | IRelayerStateStore;\n readonly atomicStore?: IAtomicStore;\n readonly publicClient: PublicClient;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,kBAAoC;AACpC,kBAAyB;AA2MzB,IAAAA,eAA0C;AAC1C,0BAAwC;AACxC,kCAAqC;AACrC,oBAAoC;AAUpC,8BAAiC;AAcjC,2BAKO;AAMP,8BAIO;AAGP,+BAAc,qBA9Pd;AAiQA,yBAAsC;AACtC,kBAA+B;AAC/B,oBAAiC;AACjC,sBAAmC;AACnC,qBAAiC;AACjC,wBAAqC;AACrC,qBAAkC;AAQlC,+BAAc,2CA/Qd;AAkRA,+BAAc,+BAlRd;AAmRA,+BAAc,+BAnRd;AAoRA,+BAAc,+BApRd;AAqRA,+BAAc,oCArRd;AAsRA,+BAAc,2BAtRd;AAuRA,+BAAc,yBAvRd;AAwRA,+BAAc,qCAxRd;AAyRA,+BAAc,mCAzRd;AA4RA,+BAAc,sBA5Rd;AA+RA,uBAA8C;AAC9C,oBAAuB;AACvB,8BAMO;AAGP,IAAAC,iBAOO;AACP,+BAAc,qBAlTd;AAqTA,iBAAuB;AAIvB,sBASO;AAGP,4BAGO;AAeP,IAAAC,eAAoC;AACpC,qBAAuC;AACvC,IAAAA,eAA4D;AAI5D,mBAKO;AAQP,mBAMO;AAGP,0BAIO;AAEP,uBAA0B;AA7U1B,MAAM,qBAAqB,qBAAS;AAAA,EAChB;AAAA,EACA;AAAA,EAElB,YAAY,QAAwB;AAClC,UAAM,IAAI,gCAAoB,GAAG,MAAM;AACvC,SAAK,iBAAiB,OAAO;AAC7B,SAAK,cAAc,OAAO;AAAA,EAC5B;AACF;AA2IO,SAAS,KAAK,QAAwB;AAC3C,SAAO,IAAI,aAAa,MAAM;AAChC;AAWA,IAAO,qBAAQ;","names":["import_core","import_chains","import_node"]}
|
package/dist/index.node.d.ts
CHANGED
|
@@ -188,6 +188,8 @@ export { ServerController } from "./controllers/server";
|
|
|
188
188
|
export { ProtocolController } from "./controllers/protocol";
|
|
189
189
|
export { SchemaController } from "./controllers/schemas";
|
|
190
190
|
export { OperationsController } from "./controllers/operations";
|
|
191
|
+
export { StakingController } from "./controllers/staking";
|
|
192
|
+
export type { EntityInfo, StakerEntityInfo, StakerEntitySummary, } from "./controllers/staking";
|
|
191
193
|
export * from "./contracts/contractController";
|
|
192
194
|
export * from "./utils/encryption";
|
|
193
195
|
export * from "./utils/formatters";
|
|
@@ -211,7 +213,10 @@ export type { UnifiedRelayerRequest, UnifiedRelayerResponse, } from "./types/rel
|
|
|
211
213
|
export type { Operation, TransactionResult, TransactionReceipt, PollingOptions, TransactionWaitOptions, } from "./types/operations";
|
|
212
214
|
export { NodePlatformAdapter } from "./platform/node";
|
|
213
215
|
export { BrowserPlatformAdapter } from "./platform/browser";
|
|
216
|
+
export { NodeECIESUint8Provider as NodeECIESProvider } from "./crypto/ecies/node";
|
|
214
217
|
export type { VanaPlatformAdapter } from "./platform/interface";
|
|
218
|
+
export { ECIESError, isECIESEncrypted, serializeECIES, deserializeECIES, } from "./crypto/ecies";
|
|
219
|
+
export type { ECIESProvider, ECIESEncrypted, ECIESOptions, } from "./crypto/ecies";
|
|
215
220
|
export { detectPlatform, createPlatformAdapter, createPlatformAdapterFor, isPlatformSupported, getPlatformCapabilities, } from "./platform/utils";
|
|
216
221
|
export { createNodePlatformAdapter, createBrowserPlatformAdapter, createPlatformAdapterSafe, } from "./platform/browser-safe";
|
|
217
222
|
export { ApiClient } from "./core/apiClient";
|
package/dist/index.node.js
CHANGED
|
@@ -36,6 +36,7 @@ import { ServerController } from "./controllers/server";
|
|
|
36
36
|
import { ProtocolController } from "./controllers/protocol";
|
|
37
37
|
import { SchemaController } from "./controllers/schemas";
|
|
38
38
|
import { OperationsController } from "./controllers/operations";
|
|
39
|
+
import { StakingController } from "./controllers/staking";
|
|
39
40
|
export * from "./contracts/contractController";
|
|
40
41
|
export * from "./utils/encryption";
|
|
41
42
|
export * from "./utils/formatters";
|
|
@@ -78,6 +79,13 @@ import {
|
|
|
78
79
|
} from "./server/relayerHandler";
|
|
79
80
|
import { NodePlatformAdapter as NodePlatformAdapter2 } from "./platform/node";
|
|
80
81
|
import { BrowserPlatformAdapter } from "./platform/browser";
|
|
82
|
+
import { NodeECIESUint8Provider } from "./crypto/ecies/node";
|
|
83
|
+
import {
|
|
84
|
+
ECIESError,
|
|
85
|
+
isECIESEncrypted,
|
|
86
|
+
serializeECIES,
|
|
87
|
+
deserializeECIES
|
|
88
|
+
} from "./crypto/ecies";
|
|
81
89
|
import {
|
|
82
90
|
detectPlatform,
|
|
83
91
|
createPlatformAdapter,
|
|
@@ -100,11 +108,13 @@ export {
|
|
|
100
108
|
CircuitBreaker,
|
|
101
109
|
DataController,
|
|
102
110
|
DistributedNonceManager,
|
|
111
|
+
ECIESError,
|
|
103
112
|
EnhancedTransactionResponse,
|
|
104
113
|
EventEmitter,
|
|
105
114
|
InMemoryNonceManager,
|
|
106
115
|
MemoryCache,
|
|
107
116
|
MiddlewarePipeline,
|
|
117
|
+
NodeECIESUint8Provider as NodeECIESProvider,
|
|
108
118
|
NodePlatformAdapter2 as NodePlatformAdapter,
|
|
109
119
|
OperationsController,
|
|
110
120
|
PermissionsController,
|
|
@@ -114,6 +124,7 @@ export {
|
|
|
114
124
|
RetryUtility,
|
|
115
125
|
SchemaController,
|
|
116
126
|
ServerController,
|
|
127
|
+
StakingController,
|
|
117
128
|
SystemHealthChecker,
|
|
118
129
|
Vana,
|
|
119
130
|
VanaCore2 as VanaCore,
|
|
@@ -127,6 +138,7 @@ export {
|
|
|
127
138
|
createPlatformAdapterFor,
|
|
128
139
|
createPlatformAdapterSafe,
|
|
129
140
|
index_node_default as default,
|
|
141
|
+
deserializeECIES,
|
|
130
142
|
detectPlatform,
|
|
131
143
|
enhanceResponse,
|
|
132
144
|
getAbi,
|
|
@@ -138,6 +150,7 @@ export {
|
|
|
138
150
|
getServiceEndpoints,
|
|
139
151
|
handleRelayerOperation,
|
|
140
152
|
isAPIResponse,
|
|
153
|
+
isECIESEncrypted,
|
|
141
154
|
isPlatformSupported,
|
|
142
155
|
isReplicateAPIResponse,
|
|
143
156
|
mainnetServices,
|
|
@@ -146,6 +159,7 @@ export {
|
|
|
146
159
|
mokshaTestnet,
|
|
147
160
|
parseReplicateOutput,
|
|
148
161
|
safeParseJSON,
|
|
162
|
+
serializeECIES,
|
|
149
163
|
vanaMainnet
|
|
150
164
|
};
|
|
151
165
|
//# sourceMappingURL=index.node.js.map
|
package/dist/index.node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.node.ts"],"sourcesContent":["/**\n * @module Node\n * Node.js-specific implementation of the Vana SDK\n */\n\nimport { NodePlatformAdapter } from \"./platform/node\";\nimport { VanaCore } from \"./core\";\nimport type {\n VanaConfig,\n VanaConfigWithStorage,\n StorageRequiredMarker,\n RelayerRequiredMarker,\n} from \"./types\";\nimport type {\n IOperationStore,\n IRelayerStateStore,\n} from \"./types/operationStore\";\nimport type { IAtomicStore } from \"./types/atomicStore\";\nimport type { PublicClient } from \"viem\";\n\n/**\n * Node.js-specific configuration interface with operation store support\n *\n * @category Configuration\n */\nexport type VanaNodeConfig = VanaConfig & {\n operationStore?: IOperationStore | IRelayerStateStore; // Can be either type\n atomicStore?: IAtomicStore;\n};\n\n/**\n * Node.js configuration with storage requirements\n *\n * @category Configuration\n */\nexport type VanaNodeConfigWithStorage = VanaConfigWithStorage & {\n operationStore?: IOperationStore | IRelayerStateStore; // Can be either type\n atomicStore?: IAtomicStore;\n};\n\n/**\n * Internal implementation class for Node.js environments.\n * This class is not exported directly - use the Vana factory function instead.\n */\nclass VanaNodeImpl extends VanaCore {\n override readonly operationStore?: IOperationStore | IRelayerStateStore;\n override readonly atomicStore?: IAtomicStore;\n\n constructor(config: VanaNodeConfig) {\n super(new NodePlatformAdapter(), config);\n this.operationStore = config.operationStore;\n this.atomicStore = config.atomicStore;\n }\n}\n\n/**\n * Creates a new Vana SDK instance configured for Node.js environments.\n *\n * @remarks\n * This is the primary entry point for Node.js applications using the Vana SDK. The function\n * automatically detects your configuration type and provides compile-time type safety:\n * - **With storage configured**: All methods including file upload/download are available\n * - **Without storage**: Storage-dependent methods throw runtime errors and are excluded from TypeScript\n *\n * The Node.js version provides enhanced capabilities including native file system access,\n * server-side cryptographic operations, and support for personal server deployment.\n * It includes all browser capabilities plus Node.js-specific optimizations and utilities.\n *\n * @param config - Configuration object containing wallet, storage, and relayer settings\n * @returns A fully configured Vana SDK instance for Node.js use\n * @throws {InvalidConfigurationError} When configuration parameters are invalid or missing\n * @example\n * ```typescript\n * import { Vana } from '@opendatalabs/vana-sdk/node';\n * import { createWalletClient, http } from 'viem';\n * import { privateKeyToAccount } from 'viem/accounts';\n * import { IPFSStorage, PinataStorage } from '@opendatalabs/vana-sdk/node';\n * import { mokshaTestnet } from '@opendatalabs/vana-sdk/node';\n *\n * // Server setup with private key\n * const account = privateKeyToAccount('0x...');\n * const walletClient = createWalletClient({\n * account,\n * chain: mokshaTestnet,\n * transport: http('https://rpc.moksha.vana.org')\n * });\n *\n * const vana = Vana({\n * walletClient,\n * storage: {\n * providers: {\n * ipfs: new IPFSStorage({\n * gateway: 'https://gateway.pinata.cloud',\n * timeout: 30000\n * }),\n * pinata: new PinataStorage({\n * apiKey: process.env.PINATA_KEY,\n * secretKey: process.env.PINATA_SECRET\n * })\n * },\n * defaultProvider: 'pinata'\n * },\n * relayerCallbacks: {\n * async submitPermissionGrant(typedData, signature) {\n * // Server-side relayer implementation\n * return await submitToCustomRelayer(typedData, signature);\n * }\n * }\n * });\n *\n * // Server operations\n * const uploadResult = await vana.data.upload({\n * content: await fs.readFile('./user-data.json'),\n * filename: 'user-data.json',\n * schemaId: 1\n * });\n *\n * // Personal server setup\n * await vana.server.setupPersonalServer({\n * serverUrl: 'https://my-server.example.com',\n * capabilities: ['data_processing', 'ml_inference']\n * });\n * ```\n *\n * @example\n * ```typescript\n * // CLI tool or script usage\n * const vana = Vana({\n * chainId: 14800, // Moksha testnet\n * account: privateKeyToAccount(process.env.PRIVATE_KEY),\n * rpcUrl: process.env.RPC_URL,\n * storage: {\n * providers: { ipfs: new IPFSStorage() },\n * defaultProvider: 'ipfs'\n * }\n * });\n *\n * // Batch operations for data processing\n * const userFiles = await vana.data.getUserFiles({\n * owner: process.env.USER_ADDRESS\n * });\n *\n * for (const file of userFiles) {\n * const decrypted = await vana.data.decryptFile(file);\n * // Process file data...\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Express.js server integration\n * import express from 'express';\n * import { handleRelayerOperation } from '@opendatalabs/vana-sdk/node';\n *\n * const app = express();\n *\n * app.post('/api/relay', async (req, res) => {\n * try {\n * const result = await handleRelayerOperation(\n * vana,\n * req.body\n * );\n * res.json(result);\n * } catch (error) {\n * res.status(500).json({ error: error.message });\n * }\n * });\n * ```\n *\n * @see {@link https://docs.vana.org/docs/sdk/server-setup | Server Setup Guide} for Node.js-specific features\n * @see {@link VanaCore} for the underlying implementation details\n * @category Core SDK\n */\n// Overload 1: For configurations that include both storage and operation store\nexport function Vana(\n config: VanaNodeConfigWithStorage & { operationStore: IOperationStore },\n): VanaNodeImpl & StorageRequiredMarker & RelayerRequiredMarker;\n\n// Overload 2: For configurations that include only the operation store\nexport function Vana(\n config: VanaNodeConfig & { operationStore: IOperationStore },\n): VanaNodeImpl & RelayerRequiredMarker;\n\n// Overload 3: For configurations with storage but no operation store\nexport function Vana(\n config: VanaNodeConfigWithStorage,\n): VanaNodeImpl & StorageRequiredMarker;\n\n// Overload 4: Base configuration without special requirements\nexport function Vana(config: VanaNodeConfig): VanaNodeImpl;\n\n// Implementation\nexport function Vana(config: VanaNodeConfig) {\n return new VanaNodeImpl(config);\n}\n\n/**\n * The type of a Vana SDK instance in Node.js environments.\n * Uses InstanceType to properly expose all public methods from the class hierarchy.\n *\n * @see {@link Vana}\n */\nexport type VanaInstance = InstanceType<typeof VanaNodeImpl>;\n\n// Export as default export\nexport default Vana;\n\n// Re-export everything that was in index.ts (avoiding circular dependency)\n// Core class and factory\nexport { VanaCore, VanaCoreFactory } from \"./core\";\nexport { DistributedNonceManager } from \"./core/nonceManager\";\nexport { InMemoryNonceManager } from \"./core/inMemoryNonceManager\";\nexport { SystemHealthChecker } from \"./core/health\";\nexport type {\n SystemHealthCheckerConfig,\n HealthStatus,\n ComponentHealth,\n NonceHealth,\n QueueHealth,\n} from \"./core/health\";\n\n// Storage implementations\nexport { RedisAtomicStore } from \"./lib/redisAtomicStore\";\nexport type { RedisAtomicStoreConfig } from \"./lib/redisAtomicStore\";\n\n// Types - modular exports\nexport type * from \"./types\";\nexport type { IAtomicStore } from \"./types/atomicStore\";\nexport type {\n IOperationStore,\n StoredOperation,\n IRelayerStateStore,\n OperationState,\n} from \"./types/operationStore\";\n\n// Type guards and utilities\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./types/external-apis\";\n\n// VanaContract is exported from abi to avoid circular dependencies\nexport type { VanaContract } from \"./generated/abi\";\n\n// Enhanced response pattern for improved developer experience\nexport {\n EnhancedTransactionResponse,\n canEnhanceResponse,\n enhanceResponse,\n} from \"./client/enhancedResponse\";\n\n// Error classes\nexport * from \"./errors\";\n\n// Controllers\nexport { PermissionsController } from \"./controllers/permissions\";\nexport { DataController } from \"./controllers/data\";\nexport { ServerController } from \"./controllers/server\";\nexport { ProtocolController } from \"./controllers/protocol\";\nexport { SchemaController } from \"./controllers/schemas\";\nexport { OperationsController } from \"./controllers/operations\";\n\n// Contract controller\nexport * from \"./contracts/contractController\";\n\n// Utilities\nexport * from \"./utils/encryption\";\nexport * from \"./utils/formatters\";\nexport * from \"./utils/grantFiles\";\nexport * from \"./utils/grantValidation\";\nexport * from \"./utils/grants\";\nexport * from \"./utils/ipfs\";\nexport * from \"./utils/schemaValidation\";\nexport * from \"./utils/signatureCache\";\n\n// Storage API\nexport * from \"./storage\";\n\n// Configuration\nexport { getContractAddress, CONTRACTS } from \"./generated/addresses\";\nexport { chains } from \"./config/chains\";\nexport {\n type ServiceEndpoints,\n mainnetServices,\n mokshaServices,\n getServiceEndpoints,\n getDefaultPersonalServerUrl,\n} from \"./config/default-services\";\n\n// Chain configurations with subgraph URLs - explicit exports for better DX\nexport {\n vanaMainnet,\n mokshaTestnet,\n moksha,\n type VanaChainConfig,\n getChainConfig,\n getAllChains,\n} from \"./chains\";\nexport * from \"./chains\";\n\n// ABIs\nexport { getAbi } from \"./generated/abi\";\nexport type { VanaContract as VanaContractAbi } from \"./generated/abi\";\n\n// Generic utilities for extensibility\nexport {\n BaseController,\n RetryUtility,\n RateLimiter,\n MemoryCache,\n EventEmitter,\n MiddlewarePipeline,\n AsyncQueue,\n CircuitBreaker,\n} from \"./core/generics\";\n\n// Server-side utilities\nexport {\n handleRelayerOperation,\n type RelayerOperationOptions,\n} from \"./server/relayerHandler\";\nexport type {\n UnifiedRelayerRequest,\n UnifiedRelayerResponse,\n} from \"./types/relayer\";\n// TransactionHandle removed - using POJOs instead\nexport type {\n Operation,\n TransactionResult,\n TransactionReceipt,\n PollingOptions,\n TransactionWaitOptions,\n} from \"./types/operations\";\n\n// Platform adapters\nexport { NodePlatformAdapter } from \"./platform/node\";\nexport { BrowserPlatformAdapter } from \"./platform/browser\";\nexport type { VanaPlatformAdapter } from \"./platform/interface\";\n\n// Platform utilities\nexport {\n detectPlatform,\n createPlatformAdapter,\n createPlatformAdapterFor,\n isPlatformSupported,\n getPlatformCapabilities,\n} from \"./platform/utils\";\n\n// Browser-safe platform utilities\nexport {\n createNodePlatformAdapter,\n createBrowserPlatformAdapter,\n createPlatformAdapterSafe,\n} from \"./platform/browser-safe\";\n\nexport { ApiClient } from \"./core/apiClient\";\n\nexport type {\n ApiClientConfig,\n HttpMethod,\n RequestOptions,\n} from \"./core/apiClient\";\n\n// Note: Default export is already handled above with the Vana factory function\n// For testing purposes, we also export the implementation class\nexport { VanaNodeImpl };\n\n// Server-specific interface for accessing stores\nexport interface VanaWithStores {\n readonly operationStore?: IOperationStore | IRelayerStateStore;\n readonly atomicStore?: IAtomicStore;\n readonly publicClient: PublicClient;\n}\n"],"mappings":"AAKA,SAAS,2BAA2B;AACpC,SAAS,gBAAgB;AAsCzB,MAAM,qBAAqB,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EAElB,YAAY,QAAwB;AAClC,UAAM,IAAI,oBAAoB,GAAG,MAAM;AACvC,SAAK,iBAAiB,OAAO;AAC7B,SAAK,cAAc,OAAO;AAAA,EAC5B;AACF;AA2IO,SAAS,KAAK,QAAwB;AAC3C,SAAO,IAAI,aAAa,MAAM;AAChC;AAWA,IAAO,qBAAQ;AAIf,SAAS,YAAAA,WAAU,uBAAuB;AAC1C,SAAS,+BAA+B;AACxC,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AAUpC,SAAS,wBAAwB;AAcjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,cAAc;AAGd,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AAGrC,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AAGd,SAAS,oBAAoB,iBAAiB;AAC9C,SAAS,cAAc;AACvB;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AAGd,SAAS,cAAc;AAIvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,OAEK;AAeP,SAAS,uBAAAC,4BAA2B;AACpC,SAAS,8BAA8B;AAIvC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;","names":["VanaCore","NodePlatformAdapter"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.node.ts"],"sourcesContent":["/**\n * @module Node\n * Node.js-specific implementation of the Vana SDK\n */\n\nimport { NodePlatformAdapter } from \"./platform/node\";\nimport { VanaCore } from \"./core\";\nimport type {\n VanaConfig,\n VanaConfigWithStorage,\n StorageRequiredMarker,\n RelayerRequiredMarker,\n} from \"./types\";\nimport type {\n IOperationStore,\n IRelayerStateStore,\n} from \"./types/operationStore\";\nimport type { IAtomicStore } from \"./types/atomicStore\";\nimport type { PublicClient } from \"viem\";\n\n/**\n * Node.js-specific configuration interface with operation store support\n *\n * @category Configuration\n */\nexport type VanaNodeConfig = VanaConfig & {\n operationStore?: IOperationStore | IRelayerStateStore; // Can be either type\n atomicStore?: IAtomicStore;\n};\n\n/**\n * Node.js configuration with storage requirements\n *\n * @category Configuration\n */\nexport type VanaNodeConfigWithStorage = VanaConfigWithStorage & {\n operationStore?: IOperationStore | IRelayerStateStore; // Can be either type\n atomicStore?: IAtomicStore;\n};\n\n/**\n * Internal implementation class for Node.js environments.\n * This class is not exported directly - use the Vana factory function instead.\n */\nclass VanaNodeImpl extends VanaCore {\n override readonly operationStore?: IOperationStore | IRelayerStateStore;\n override readonly atomicStore?: IAtomicStore;\n\n constructor(config: VanaNodeConfig) {\n super(new NodePlatformAdapter(), config);\n this.operationStore = config.operationStore;\n this.atomicStore = config.atomicStore;\n }\n}\n\n/**\n * Creates a new Vana SDK instance configured for Node.js environments.\n *\n * @remarks\n * This is the primary entry point for Node.js applications using the Vana SDK. The function\n * automatically detects your configuration type and provides compile-time type safety:\n * - **With storage configured**: All methods including file upload/download are available\n * - **Without storage**: Storage-dependent methods throw runtime errors and are excluded from TypeScript\n *\n * The Node.js version provides enhanced capabilities including native file system access,\n * server-side cryptographic operations, and support for personal server deployment.\n * It includes all browser capabilities plus Node.js-specific optimizations and utilities.\n *\n * @param config - Configuration object containing wallet, storage, and relayer settings\n * @returns A fully configured Vana SDK instance for Node.js use\n * @throws {InvalidConfigurationError} When configuration parameters are invalid or missing\n * @example\n * ```typescript\n * import { Vana } from '@opendatalabs/vana-sdk/node';\n * import { createWalletClient, http } from 'viem';\n * import { privateKeyToAccount } from 'viem/accounts';\n * import { IPFSStorage, PinataStorage } from '@opendatalabs/vana-sdk/node';\n * import { mokshaTestnet } from '@opendatalabs/vana-sdk/node';\n *\n * // Server setup with private key\n * const account = privateKeyToAccount('0x...');\n * const walletClient = createWalletClient({\n * account,\n * chain: mokshaTestnet,\n * transport: http('https://rpc.moksha.vana.org')\n * });\n *\n * const vana = Vana({\n * walletClient,\n * storage: {\n * providers: {\n * ipfs: new IPFSStorage({\n * gateway: 'https://gateway.pinata.cloud',\n * timeout: 30000\n * }),\n * pinata: new PinataStorage({\n * apiKey: process.env.PINATA_KEY,\n * secretKey: process.env.PINATA_SECRET\n * })\n * },\n * defaultProvider: 'pinata'\n * },\n * relayerCallbacks: {\n * async submitPermissionGrant(typedData, signature) {\n * // Server-side relayer implementation\n * return await submitToCustomRelayer(typedData, signature);\n * }\n * }\n * });\n *\n * // Server operations\n * const uploadResult = await vana.data.upload({\n * content: await fs.readFile('./user-data.json'),\n * filename: 'user-data.json',\n * schemaId: 1\n * });\n *\n * // Personal server setup\n * await vana.server.setupPersonalServer({\n * serverUrl: 'https://my-server.example.com',\n * capabilities: ['data_processing', 'ml_inference']\n * });\n * ```\n *\n * @example\n * ```typescript\n * // CLI tool or script usage\n * const vana = Vana({\n * chainId: 14800, // Moksha testnet\n * account: privateKeyToAccount(process.env.PRIVATE_KEY),\n * rpcUrl: process.env.RPC_URL,\n * storage: {\n * providers: { ipfs: new IPFSStorage() },\n * defaultProvider: 'ipfs'\n * }\n * });\n *\n * // Batch operations for data processing\n * const userFiles = await vana.data.getUserFiles({\n * owner: process.env.USER_ADDRESS\n * });\n *\n * for (const file of userFiles) {\n * const decrypted = await vana.data.decryptFile(file);\n * // Process file data...\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Express.js server integration\n * import express from 'express';\n * import { handleRelayerOperation } from '@opendatalabs/vana-sdk/node';\n *\n * const app = express();\n *\n * app.post('/api/relay', async (req, res) => {\n * try {\n * const result = await handleRelayerOperation(\n * vana,\n * req.body\n * );\n * res.json(result);\n * } catch (error) {\n * res.status(500).json({ error: error.message });\n * }\n * });\n * ```\n *\n * @see {@link https://docs.vana.org/docs/sdk/server-setup | Server Setup Guide} for Node.js-specific features\n * @see {@link VanaCore} for the underlying implementation details\n * @category Core SDK\n */\n// Overload 1: For configurations that include both storage and operation store\nexport function Vana(\n config: VanaNodeConfigWithStorage & { operationStore: IOperationStore },\n): VanaNodeImpl & StorageRequiredMarker & RelayerRequiredMarker;\n\n// Overload 2: For configurations that include only the operation store\nexport function Vana(\n config: VanaNodeConfig & { operationStore: IOperationStore },\n): VanaNodeImpl & RelayerRequiredMarker;\n\n// Overload 3: For configurations with storage but no operation store\nexport function Vana(\n config: VanaNodeConfigWithStorage,\n): VanaNodeImpl & StorageRequiredMarker;\n\n// Overload 4: Base configuration without special requirements\nexport function Vana(config: VanaNodeConfig): VanaNodeImpl;\n\n// Implementation\nexport function Vana(config: VanaNodeConfig) {\n return new VanaNodeImpl(config);\n}\n\n/**\n * The type of a Vana SDK instance in Node.js environments.\n * Uses InstanceType to properly expose all public methods from the class hierarchy.\n *\n * @see {@link Vana}\n */\nexport type VanaInstance = InstanceType<typeof VanaNodeImpl>;\n\n// Export as default export\nexport default Vana;\n\n// Re-export everything that was in index.ts (avoiding circular dependency)\n// Core class and factory\nexport { VanaCore, VanaCoreFactory } from \"./core\";\nexport { DistributedNonceManager } from \"./core/nonceManager\";\nexport { InMemoryNonceManager } from \"./core/inMemoryNonceManager\";\nexport { SystemHealthChecker } from \"./core/health\";\nexport type {\n SystemHealthCheckerConfig,\n HealthStatus,\n ComponentHealth,\n NonceHealth,\n QueueHealth,\n} from \"./core/health\";\n\n// Storage implementations\nexport { RedisAtomicStore } from \"./lib/redisAtomicStore\";\nexport type { RedisAtomicStoreConfig } from \"./lib/redisAtomicStore\";\n\n// Types - modular exports\nexport type * from \"./types\";\nexport type { IAtomicStore } from \"./types/atomicStore\";\nexport type {\n IOperationStore,\n StoredOperation,\n IRelayerStateStore,\n OperationState,\n} from \"./types/operationStore\";\n\n// Type guards and utilities\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./types/external-apis\";\n\n// VanaContract is exported from abi to avoid circular dependencies\nexport type { VanaContract } from \"./generated/abi\";\n\n// Enhanced response pattern for improved developer experience\nexport {\n EnhancedTransactionResponse,\n canEnhanceResponse,\n enhanceResponse,\n} from \"./client/enhancedResponse\";\n\n// Error classes\nexport * from \"./errors\";\n\n// Controllers\nexport { PermissionsController } from \"./controllers/permissions\";\nexport { DataController } from \"./controllers/data\";\nexport { ServerController } from \"./controllers/server\";\nexport { ProtocolController } from \"./controllers/protocol\";\nexport { SchemaController } from \"./controllers/schemas\";\nexport { OperationsController } from \"./controllers/operations\";\nexport { StakingController } from \"./controllers/staking\";\nexport type {\n EntityInfo,\n StakerEntityInfo,\n StakerEntitySummary,\n} from \"./controllers/staking\";\n\n// Contract controller\nexport * from \"./contracts/contractController\";\n\n// Utilities\nexport * from \"./utils/encryption\";\nexport * from \"./utils/formatters\";\nexport * from \"./utils/grantFiles\";\nexport * from \"./utils/grantValidation\";\nexport * from \"./utils/grants\";\nexport * from \"./utils/ipfs\";\nexport * from \"./utils/schemaValidation\";\nexport * from \"./utils/signatureCache\";\n\n// Storage API\nexport * from \"./storage\";\n\n// Configuration\nexport { getContractAddress, CONTRACTS } from \"./generated/addresses\";\nexport { chains } from \"./config/chains\";\nexport {\n type ServiceEndpoints,\n mainnetServices,\n mokshaServices,\n getServiceEndpoints,\n getDefaultPersonalServerUrl,\n} from \"./config/default-services\";\n\n// Chain configurations with subgraph URLs - explicit exports for better DX\nexport {\n vanaMainnet,\n mokshaTestnet,\n moksha,\n type VanaChainConfig,\n getChainConfig,\n getAllChains,\n} from \"./chains\";\nexport * from \"./chains\";\n\n// ABIs\nexport { getAbi } from \"./generated/abi\";\nexport type { VanaContract as VanaContractAbi } from \"./generated/abi\";\n\n// Generic utilities for extensibility\nexport {\n BaseController,\n RetryUtility,\n RateLimiter,\n MemoryCache,\n EventEmitter,\n MiddlewarePipeline,\n AsyncQueue,\n CircuitBreaker,\n} from \"./core/generics\";\n\n// Server-side utilities\nexport {\n handleRelayerOperation,\n type RelayerOperationOptions,\n} from \"./server/relayerHandler\";\nexport type {\n UnifiedRelayerRequest,\n UnifiedRelayerResponse,\n} from \"./types/relayer\";\n// TransactionHandle removed - using POJOs instead\nexport type {\n Operation,\n TransactionResult,\n TransactionReceipt,\n PollingOptions,\n TransactionWaitOptions,\n} from \"./types/operations\";\n\n// Platform adapters\nexport { NodePlatformAdapter } from \"./platform/node\";\nexport { BrowserPlatformAdapter } from \"./platform/browser\";\nexport { NodeECIESUint8Provider as NodeECIESProvider } from \"./crypto/ecies/node\";\nexport type { VanaPlatformAdapter } from \"./platform/interface\";\n\n// ECIES utilities and types (platform-agnostic, exported via module index)\nexport {\n ECIESError,\n isECIESEncrypted,\n serializeECIES,\n deserializeECIES,\n} from \"./crypto/ecies\";\nexport type {\n ECIESProvider,\n ECIESEncrypted,\n ECIESOptions,\n} from \"./crypto/ecies\";\n\n// Platform utilities\nexport {\n detectPlatform,\n createPlatformAdapter,\n createPlatformAdapterFor,\n isPlatformSupported,\n getPlatformCapabilities,\n} from \"./platform/utils\";\n\n// Browser-safe platform utilities\nexport {\n createNodePlatformAdapter,\n createBrowserPlatformAdapter,\n createPlatformAdapterSafe,\n} from \"./platform/browser-safe\";\n\nexport { ApiClient } from \"./core/apiClient\";\n\nexport type {\n ApiClientConfig,\n HttpMethod,\n RequestOptions,\n} from \"./core/apiClient\";\n\n// Note: Default export is already handled above with the Vana factory function\n// For testing purposes, we also export the implementation class\nexport { VanaNodeImpl };\n\n// Server-specific interface for accessing stores\nexport interface VanaWithStores {\n readonly operationStore?: IOperationStore | IRelayerStateStore;\n readonly atomicStore?: IAtomicStore;\n readonly publicClient: PublicClient;\n}\n"],"mappings":"AAKA,SAAS,2BAA2B;AACpC,SAAS,gBAAgB;AAsCzB,MAAM,qBAAqB,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EAElB,YAAY,QAAwB;AAClC,UAAM,IAAI,oBAAoB,GAAG,MAAM;AACvC,SAAK,iBAAiB,OAAO;AAC7B,SAAK,cAAc,OAAO;AAAA,EAC5B;AACF;AA2IO,SAAS,KAAK,QAAwB;AAC3C,SAAO,IAAI,aAAa,MAAM;AAChC;AAWA,IAAO,qBAAQ;AAIf,SAAS,YAAAA,WAAU,uBAAuB;AAC1C,SAAS,+BAA+B;AACxC,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AAUpC,SAAS,wBAAwB;AAcjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAMP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,cAAc;AAGd,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,4BAA4B;AACrC,SAAS,yBAAyB;AAQlC,cAAc;AAGd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AAGd,cAAc;AAGd,SAAS,oBAAoB,iBAAiB;AAC9C,SAAS,cAAc;AACvB;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,cAAc;AAGd,SAAS,cAAc;AAIvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,OAEK;AAeP,SAAS,uBAAAC,4BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAmC,8BAAyB;AAI5D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAQP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB;","names":["VanaCore","NodePlatformAdapter"]}
|