@dynamic-labs-wallet/browser 0.0.0-preview-120.0

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 (55) hide show
  1. package/index.cjs.d.ts +1 -0
  2. package/index.cjs.js +1805 -0
  3. package/index.esm.d.ts +1 -0
  4. package/index.esm.js +1738 -0
  5. package/internal/core/bip340.d.ts +22 -0
  6. package/internal/core/bip340.js +1 -0
  7. package/internal/core/common.d.ts +1 -0
  8. package/internal/core/common.js +1 -0
  9. package/internal/core/ecdsa.d.ts +23 -0
  10. package/internal/core/ecdsa.js +1 -0
  11. package/internal/core/ed25519.d.ts +22 -0
  12. package/internal/core/ed25519.js +1 -0
  13. package/internal/core/index.d.ts +6 -0
  14. package/internal/core/index.js +1 -0
  15. package/internal/core/native.d.ts +103 -0
  16. package/internal/core/native.js +1 -0
  17. package/internal/core/types.d.ts +58 -0
  18. package/internal/core/types.js +1 -0
  19. package/internal/web/generated/libmpc_executor.d.ts +130 -0
  20. package/internal/web/generated/libmpc_executor.js +2 -0
  21. package/internal/web/generated/libmpc_executor_bg.wasm +0 -0
  22. package/internal/web/generated/libmpc_executor_bg.wasm.d.ts +64 -0
  23. package/internal/web/index.d.ts +11 -0
  24. package/internal/web/index.js +1 -0
  25. package/package.json +34 -0
  26. package/src/backup/encryption.d.ts +22 -0
  27. package/src/backup/encryption.d.ts.map +1 -0
  28. package/src/backup/providers/googleDrive.d.ts +19 -0
  29. package/src/backup/providers/googleDrive.d.ts.map +1 -0
  30. package/src/client.d.ts +370 -0
  31. package/src/client.d.ts.map +1 -0
  32. package/src/constants.d.ts +5 -0
  33. package/src/constants.d.ts.map +1 -0
  34. package/src/index.d.ts +6 -0
  35. package/src/index.d.ts.map +1 -0
  36. package/src/mpc/index.d.ts +5 -0
  37. package/src/mpc/index.d.ts.map +1 -0
  38. package/src/mpc/mpc.d.ts +11 -0
  39. package/src/mpc/mpc.d.ts.map +1 -0
  40. package/src/mpc/types.d.ts +5 -0
  41. package/src/mpc/types.d.ts.map +1 -0
  42. package/src/services/iframeDisplay.d.ts +9 -0
  43. package/src/services/iframeDisplay.d.ts.map +1 -0
  44. package/src/services/iframeLocalStorage.d.ts +13 -0
  45. package/src/services/iframeLocalStorage.d.ts.map +1 -0
  46. package/src/services/localStorage.d.ts +32 -0
  47. package/src/services/localStorage.d.ts.map +1 -0
  48. package/src/services/logger.d.ts +3 -0
  49. package/src/services/logger.d.ts.map +1 -0
  50. package/src/services/messageTransportBridge.d.ts +3 -0
  51. package/src/services/messageTransportBridge.d.ts.map +1 -0
  52. package/src/types.d.ts +14 -0
  53. package/src/types.d.ts.map +1 -0
  54. package/src/utils.d.ts +43 -0
  55. package/src/utils.d.ts.map +1 -0
package/src/types.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { KeyShareBackupInfo, ThresholdSignatureScheme } from '@dynamic-labs-wallet/core';
2
+ export interface WalletProperties {
3
+ chainName: string;
4
+ walletId: string;
5
+ accountAddress: string;
6
+ clientKeySharesBackupInfo: KeyShareBackupInfo;
7
+ thresholdSignatureScheme: ThresholdSignatureScheme;
8
+ derivationPath?: string;
9
+ }
10
+ export type DisplayMessages = {
11
+ displayClientShares: (accountAddress: string, clientKeyShares?: string[]) => Promise<void>;
12
+ displayPrivateKey: (accountAddress: string, privateKey: string) => Promise<void>;
13
+ };
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../packages/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,yBAAyB,EAAE,kBAAkB,CAAC;IAC9C,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,mBAAmB,EAAE,CACnB,cAAc,EAAE,MAAM,EACtB,eAAe,CAAC,EAAE,MAAM,EAAE,KACvB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,iBAAiB,EAAE,CACjB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,CAAC"}
package/src/utils.d.ts ADDED
@@ -0,0 +1,43 @@
1
+ import { ThresholdSignatureScheme, KeyShareBackupInfo, WaasWalletProperties } from '@dynamic-labs-wallet/core';
2
+ import { ClientKeyShare } from './mpc/types';
3
+ export declare const bytesToBase64: (arr: Uint8Array) => string;
4
+ export declare const stringToBytes: (str: string) => Uint8Array;
5
+ export declare const base64ToBytes: (base64: string) => Uint8Array;
6
+ export declare const ensureBase64Padding: (str: string) => string;
7
+ export declare const isBrowser: () => boolean;
8
+ export declare const isHexString: (str: string) => boolean;
9
+ export declare const getClientKeyShareExportFileName: ({ thresholdSignatureScheme, accountAddress, }: {
10
+ thresholdSignatureScheme: ThresholdSignatureScheme;
11
+ accountAddress: string;
12
+ }) => string;
13
+ export declare const getClientKeyShareBackupInfo: (params?: {
14
+ walletProperties: WaasWalletProperties;
15
+ }) => KeyShareBackupInfo;
16
+ /**
17
+ * Helper function to merge keyshares and remove duplicates based on pubkey and secretShare
18
+ * @param existingKeyShares - Array of existing keyshares
19
+ * @param newKeyShares - Array of new keyshares to merge
20
+ * @returns Array of merged unique keyshares
21
+ */
22
+ export declare const mergeUniqueKeyShares: (existingKeyShares: ClientKeyShare[], newKeyShares: ClientKeyShare[]) => ClientKeyShare[];
23
+ export declare const timeoutPromise: ({ timeInMs, activity, }: {
24
+ timeInMs: number;
25
+ activity?: string;
26
+ }) => Promise<unknown>;
27
+ interface RetryConfig {
28
+ maxAttempts?: number;
29
+ retryInterval?: number;
30
+ operationName?: string;
31
+ logContext?: Record<string, unknown>;
32
+ }
33
+ /**
34
+ * Generic helper function to retry a promise-based operations
35
+ *
36
+ * @param operation - The async operation to retry
37
+ * @param config - Configuration options for retry behavior
38
+ * @returns Promise with the operation result
39
+ * @throws Last error encountered after all retries are exhausted
40
+ */
41
+ export declare function retryPromise<T>(operation: () => Promise<T>, { maxAttempts, retryInterval, operationName, logContext, }?: RetryConfig): Promise<T>;
42
+ export {};
43
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,wBAAwB,EACxB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,eAAO,MAAM,aAAa,QAAS,UAAU,WAE5C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,eAExC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,eAE3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAEjD,CAAC;AAEF,eAAO,MAAM,SAAS,eAAsC,CAAC;AAE7D,eAAO,MAAM,WAAW,QAAS,MAAM,YAKtC,CAAC;AAEF,eAAO,MAAM,+BAA+B,kDAGzC;IACD,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,cAAc,EAAE,MAAM,CAAC;CACxB,WAEA,CAAC;AAEF,eAAO,MAAM,2BAA2B,YAAa;IACnD,gBAAgB,EAAE,oBAAoB,CAAC;CACxC,KAAG,kBAgCH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,sBACZ,cAAc,EAAE,gBACrB,cAAc,EAAE,KAC7B,cAAc,EAchB,CAAC;AAEF,eAAO,MAAM,cAAc,4BAGxB;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,qBAOA,CAAC;AAEF,UAAU,WAAW;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,EACE,WAAe,EACf,aAAmB,EACnB,aAA2B,EAC3B,UAAe,GAChB,GAAE,WAAgB,GAClB,OAAO,CAAC,CAAC,CAAC,CA0BZ"}