@no-witness-labs/midday-sdk 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +60 -82
  2. package/dist/Client.d.ts +290 -340
  3. package/dist/Client.d.ts.map +1 -1
  4. package/dist/Client.js +318 -359
  5. package/dist/Client.js.map +1 -1
  6. package/dist/Config.d.ts +2 -57
  7. package/dist/Config.d.ts.map +1 -1
  8. package/dist/Config.js +1 -47
  9. package/dist/Config.js.map +1 -1
  10. package/dist/Hash.d.ts +126 -0
  11. package/dist/Hash.d.ts.map +1 -0
  12. package/dist/Hash.js +146 -0
  13. package/dist/Hash.js.map +1 -0
  14. package/dist/PrivateState.d.ts +9 -0
  15. package/dist/PrivateState.d.ts.map +1 -0
  16. package/dist/PrivateState.js +9 -0
  17. package/dist/PrivateState.js.map +1 -0
  18. package/dist/Providers.d.ts +42 -63
  19. package/dist/Providers.d.ts.map +1 -1
  20. package/dist/Providers.js +34 -62
  21. package/dist/Providers.js.map +1 -1
  22. package/dist/Runtime.d.ts +8 -0
  23. package/dist/Runtime.d.ts.map +1 -0
  24. package/dist/Runtime.js +8 -0
  25. package/dist/Runtime.js.map +1 -0
  26. package/dist/Wallet.d.ts +1 -1
  27. package/dist/Wallet.d.ts.map +1 -1
  28. package/dist/Wallet.js +2 -0
  29. package/dist/Wallet.js.map +1 -1
  30. package/dist/ZkConfig.d.ts +80 -0
  31. package/dist/ZkConfig.d.ts.map +1 -0
  32. package/dist/ZkConfig.js +85 -0
  33. package/dist/ZkConfig.js.map +1 -0
  34. package/dist/devnet/Cluster.d.ts +0 -9
  35. package/dist/devnet/Cluster.d.ts.map +1 -1
  36. package/dist/devnet/Cluster.js +0 -13
  37. package/dist/devnet/Cluster.js.map +1 -1
  38. package/dist/devnet/index.d.ts +9 -8
  39. package/dist/devnet/index.d.ts.map +1 -1
  40. package/dist/devnet/index.js +9 -8
  41. package/dist/devnet/index.js.map +1 -1
  42. package/dist/index.d.ts +30 -47
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +33 -52
  45. package/dist/index.js.map +1 -1
  46. package/dist/providers/HttpZkConfigProvider.d.ts +8 -6
  47. package/dist/providers/HttpZkConfigProvider.d.ts.map +1 -1
  48. package/dist/providers/HttpZkConfigProvider.js +8 -6
  49. package/dist/providers/HttpZkConfigProvider.js.map +1 -1
  50. package/dist/providers/IndexedDBPrivateStateProvider.d.ts +8 -8
  51. package/dist/providers/IndexedDBPrivateStateProvider.js +8 -8
  52. package/dist/utils/index.d.ts +9 -0
  53. package/dist/utils/index.d.ts.map +1 -0
  54. package/dist/utils/index.js +9 -0
  55. package/dist/utils/index.js.map +1 -0
  56. package/dist/wallet/connector.d.ts +1 -1
  57. package/dist/wallet/connector.js +1 -1
  58. package/dist/wallet/index.d.ts +15 -0
  59. package/dist/wallet/index.d.ts.map +1 -0
  60. package/dist/wallet/index.js +18 -0
  61. package/dist/wallet/index.js.map +1 -0
  62. package/package.json +1 -1
  63. package/dist/sdk/Type.d.ts +0 -91
  64. package/dist/sdk/Type.d.ts.map +0 -1
  65. package/dist/sdk/Type.js +0 -8
  66. package/dist/sdk/Type.js.map +0 -1
@@ -135,7 +135,7 @@ export declare function isWalletAvailable(): boolean;
135
135
  * const connection = yield* Midday.WalletConnector.effect.connect('testnet');
136
136
  *
137
137
  * // Promise-based usage
138
- * const connection = await Midday.connectWallet('testnet');
138
+ * const connection = await Midday.BrowserWallet.connectWallet('testnet');
139
139
  * ```
140
140
  */
141
141
  export declare function connectWallet(networkId?: string): Promise<WalletConnection>;
@@ -127,7 +127,7 @@ export function isWalletAvailable() {
127
127
  * const connection = yield* Midday.WalletConnector.effect.connect('testnet');
128
128
  *
129
129
  * // Promise-based usage
130
- * const connection = await Midday.connectWallet('testnet');
130
+ * const connection = await Midday.BrowserWallet.connectWallet('testnet');
131
131
  * ```
132
132
  */
133
133
  export async function connectWallet(networkId = 'testnet') {
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Browser wallet connection and providers.
3
+ *
4
+ * This module combines:
5
+ * - Wallet connector (Lace browser extension)
6
+ * - Wallet providers (WalletProvider, MidnightProvider)
7
+ * - Wallet errors
8
+ *
9
+ * @since 0.3.0
10
+ * @module
11
+ */
12
+ export { WalletError } from './errors.js';
13
+ export { connectWallet, disconnectWallet, isWalletAvailable, getWalletProvingProvider, effect, WalletConnectorService, WalletConnectorLive, type WalletConnection, type ShieldedAddresses, type InitialAPI, type ConnectedAPI, type Configuration, type ProvingProvider, type KeyMaterialProvider, type WalletConnectorServiceImpl, type WalletConnectorEffect, } from './connector.js';
14
+ export { createWalletProviders, effect as providerEffect, WalletProviderService, WalletProviderLive, type WalletKeys, type WalletProviders, type WalletProviderServiceImpl, type WalletProviderEffect, } from './provider.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,MAAM,EACN,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,qBAAqB,EACrB,MAAM,IAAI,cAAc,EACxB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Browser wallet connection and providers.
3
+ *
4
+ * This module combines:
5
+ * - Wallet connector (Lace browser extension)
6
+ * - Wallet providers (WalletProvider, MidnightProvider)
7
+ * - Wallet errors
8
+ *
9
+ * @since 0.3.0
10
+ * @module
11
+ */
12
+ // Errors
13
+ export { WalletError } from './errors.js';
14
+ // Connector
15
+ export { connectWallet, disconnectWallet, isWalletAvailable, getWalletProvingProvider, effect, WalletConnectorService, WalletConnectorLive, } from './connector.js';
16
+ // Provider
17
+ export { createWalletProviders, effect as providerEffect, WalletProviderService, WalletProviderLive, } from './provider.js';
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wallet/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,SAAS;AACT,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,YAAY;AACZ,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,MAAM,EACN,sBAAsB,EACtB,mBAAmB,GAUpB,MAAM,gBAAgB,CAAC;AAExB,WAAW;AACX,OAAO,EACL,qBAAqB,EACrB,MAAM,IAAI,cAAc,EACxB,qBAAqB,EACrB,kBAAkB,GAKnB,MAAM,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@no-witness-labs/midday-sdk",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Developer-friendly SDK for building dapps on Midnight Network",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,91 +0,0 @@
1
- /**
2
- * Type helpers for Effect-to-Promise API conversion.
3
- *
4
- * @since 0.3.0
5
- * @module
6
- */
7
- import type * as Effect from 'effect/Effect';
8
- /**
9
- * Utility to force TypeScript to expand and display computed types.
10
- * Improves IDE hover display for complex mapped types.
11
- */
12
- type Expand<T> = T extends (...args: infer A) => infer R ? (...args: A) => R : T extends object ? {
13
- [K in keyof T]: T[K];
14
- } : T;
15
- /**
16
- * Converts an Effect type to a Promise type by extracting the success value.
17
- * Handles both direct Effect types and functions returning Effects.
18
- *
19
- * @example
20
- * ```typescript
21
- * type EffectType = Effect.Effect<string, Error>;
22
- * type PromiseType = EffectToPromise<EffectType>; // Promise<string>
23
- *
24
- * type EffectFn = (x: number) => Effect.Effect<string, Error>;
25
- * type PromiseFn = EffectToPromise<EffectFn>; // (x: number) => Promise<string>
26
- * ```
27
- */
28
- export type EffectToPromise<T> = T extends Effect.Effect<infer Return, infer _Error, infer _Context> ? Promise<Return> : T extends (...args: Array<any>) => Effect.Effect<infer Return, infer _Error, infer _Context> ? (...args: Parameters<T>) => Promise<Return> : never;
29
- /**
30
- * Converts an API interface with Effect-returning methods to Promise-returning methods.
31
- *
32
- * Used to create the Promise-based wrapper API from the Effect-based API.
33
- *
34
- * @example
35
- * ```typescript
36
- * interface MyAPIEffect {
37
- * readonly foo: () => Effect.Effect<string, Error>;
38
- * readonly bar: (n: number) => Effect.Effect<boolean, Error>;
39
- * }
40
- *
41
- * // Results in:
42
- * // {
43
- * // readonly foo: () => Promise<string>;
44
- * // readonly bar: (n: number) => Promise<boolean>;
45
- * // }
46
- * type MyAPI = EffectToPromiseAPI<MyAPIEffect>;
47
- * ```
48
- */
49
- export type EffectToPromiseAPI<T> = Expand<{
50
- readonly [K in keyof T]: EffectToPromise<T[K]>;
51
- }>;
52
- /**
53
- * Selective Promise conversion - specify which Effects become Promises, rest become sync.
54
- *
55
- * @example
56
- * ```typescript
57
- * interface MyAPIEffect {
58
- * readonly asyncOp: () => Effect.Effect<string, Error>;
59
- * readonly syncOp: () => Effect.Effect<number, Error>;
60
- * }
61
- *
62
- * // asyncOp becomes Promise, syncOp becomes sync (returns number directly)
63
- * type MyAPI = SelectivePromiseAPI<MyAPIEffect, 'asyncOp'>;
64
- * ```
65
- */
66
- export type SelectivePromiseAPI<T, PromiseKeys extends keyof T = never> = {
67
- readonly [K in PromiseKeys]: EffectToPromise<T[K]>;
68
- } & {
69
- readonly [K in Exclude<keyof T, PromiseKeys>]: T[K] extends Effect.Effect<infer Return, any, any> ? Return : T[K];
70
- };
71
- /**
72
- * Selective Sync conversion - specify which Effects become sync, rest become Promises.
73
- *
74
- * @example
75
- * ```typescript
76
- * interface MyAPIEffect {
77
- * readonly asyncOp: () => Effect.Effect<string, Error>;
78
- * readonly syncOp: () => Effect.Effect<number, Error>;
79
- * }
80
- *
81
- * // syncOp becomes sync (returns number), asyncOp becomes Promise
82
- * type MyAPI = SelectiveSyncAPI<MyAPIEffect, 'syncOp'>;
83
- * ```
84
- */
85
- export type SelectiveSyncAPI<T, SyncKeys extends keyof T = never> = {
86
- readonly [K in SyncKeys]: T[K] extends Effect.Effect<infer Return, any, any> ? Return : T[K];
87
- } & {
88
- readonly [K in Exclude<keyof T, SyncKeys>]: EffectToPromise<T[K]>;
89
- };
90
- export {};
91
- //# sourceMappingURL=Type.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Type.d.ts","sourceRoot":"","sources":["../../src/sdk/Type.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAC;AAE7C;;;GAGG;AACH,KAAK,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GACpD,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GACjB,CAAC,SAAS,MAAM,GACd;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GACxB,CAAC,CAAC;AAER;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,MAAM,CAAC,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,MAAM,QAAQ,CAAC,GAChG,OAAO,CAAC,MAAM,CAAC,GAEf,CAAC,SAAS,CAAC,GAAG,IAAI,EA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AAQ,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAClE,CAAC"}
package/dist/sdk/Type.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Type helpers for Effect-to-Promise API conversion.
3
- *
4
- * @since 0.3.0
5
- * @module
6
- */
7
- export {};
8
- //# sourceMappingURL=Type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Type.js","sourceRoot":"","sources":["../../src/sdk/Type.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}