@spacesops/wdk-react-native-core 1.0.0-beta.69 → 1.0.0-beta.70

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 (140) hide show
  1. package/dist/hooks/useBalance.js +50 -7
  2. package/dist/hooks/useBalance.js.map +1 -1
  3. package/dist/hooks/useTransactions.d.ts +21 -0
  4. package/dist/hooks/useTransactions.js +64 -0
  5. package/dist/hooks/useTransactions.js.map +1 -0
  6. package/dist/index.d.ts +5 -2
  7. package/dist/index.js +3 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/provider/WdkAppProvider.d.ts +7 -2
  10. package/dist/provider/WdkAppProvider.js +6 -1
  11. package/dist/provider/WdkAppProvider.js.map +1 -1
  12. package/dist/services/transactionService.d.ts +27 -0
  13. package/dist/services/transactionService.js +154 -0
  14. package/dist/services/transactionService.js.map +1 -0
  15. package/dist/store/indexerConfigStore.d.ts +7 -0
  16. package/dist/store/indexerConfigStore.js +14 -0
  17. package/dist/store/indexerConfigStore.js.map +1 -0
  18. package/dist/types.d.ts +33 -0
  19. package/dist/utils/constants.d.ts +18 -0
  20. package/dist/utils/constants.js +18 -0
  21. package/dist/utils/constants.js.map +1 -1
  22. package/dist/utils/mmkvKeyManager.js +3 -3
  23. package/dist/utils/mmkvKeyManager.js.map +1 -1
  24. package/dist/utils/operationMutex.js.map +1 -1
  25. package/dist/utils/retryUtils.d.ts +19 -0
  26. package/dist/utils/retryUtils.js +55 -0
  27. package/dist/utils/retryUtils.js.map +1 -0
  28. package/dist/utils/schemas.d.ts +15 -3
  29. package/dist/utils/schemas.js +27 -2
  30. package/dist/utils/schemas.js.map +1 -1
  31. package/dist/utils/typeGuards.d.ts +1 -1
  32. package/dist/utils/typeGuards.js +3 -3
  33. package/dist/utils/typeGuards.js.map +1 -1
  34. package/package.json +2 -1
  35. package/src/hooks/useBalance.ts +2 -3
  36. package/src/services/transactionService.ts +2 -1
  37. package/src/utils/mmkvKeyManager.ts +3 -3
  38. package/src/utils/operationMutex.ts +1 -1
  39. package/dist/__mocks__/react.d.ts +0 -40
  40. package/dist/__mocks__/react.js +0 -33
  41. package/dist/__mocks__/react.js.map +0 -1
  42. package/dist/__mocks__/secureStorage.d.ts +0 -27
  43. package/dist/__mocks__/secureStorage.js +0 -81
  44. package/dist/__mocks__/secureStorage.js.map +0 -1
  45. package/dist/__tests__/hooks/useBalance.test.d.ts +0 -6
  46. package/dist/__tests__/hooks/useBalance.test.js +0 -217
  47. package/dist/__tests__/hooks/useBalance.test.js.map +0 -1
  48. package/dist/__tests__/hooks/useWallet.test.d.ts +0 -6
  49. package/dist/__tests__/hooks/useWallet.test.js +0 -105
  50. package/dist/__tests__/hooks/useWallet.test.js.map +0 -1
  51. package/dist/__tests__/hooks/useWalletManager.test.d.ts +0 -6
  52. package/dist/__tests__/hooks/useWalletManager.test.js +0 -193
  53. package/dist/__tests__/hooks/useWalletManager.test.js.map +0 -1
  54. package/dist/__tests__/hooks/useWdkApp.test.d.ts +0 -6
  55. package/dist/__tests__/hooks/useWdkApp.test.js +0 -55
  56. package/dist/__tests__/hooks/useWdkApp.test.js.map +0 -1
  57. package/dist/__tests__/hooks/useWorklet.test.d.ts +0 -6
  58. package/dist/__tests__/hooks/useWorklet.test.js +0 -168
  59. package/dist/__tests__/hooks/useWorklet.test.js.map +0 -1
  60. package/dist/__tests__/provider/WdkAppProvider.test.d.ts +0 -6
  61. package/dist/__tests__/provider/WdkAppProvider.test.js +0 -57
  62. package/dist/__tests__/provider/WdkAppProvider.test.js.map +0 -1
  63. package/dist/__tests__/services/accountService.test.d.ts +0 -6
  64. package/dist/__tests__/services/accountService.test.js +0 -263
  65. package/dist/__tests__/services/accountService.test.js.map +0 -1
  66. package/dist/__tests__/services/addressService.test.d.ts +0 -6
  67. package/dist/__tests__/services/addressService.test.js +0 -258
  68. package/dist/__tests__/services/addressService.test.js.map +0 -1
  69. package/dist/__tests__/services/balanceService.test.d.ts +0 -6
  70. package/dist/__tests__/services/balanceService.test.js +0 -333
  71. package/dist/__tests__/services/balanceService.test.js.map +0 -1
  72. package/dist/__tests__/services/walletSetupService.test.d.ts +0 -6
  73. package/dist/__tests__/services/walletSetupService.test.js +0 -304
  74. package/dist/__tests__/services/walletSetupService.test.js.map +0 -1
  75. package/dist/__tests__/services/walletSwitchingService.test.d.ts +0 -6
  76. package/dist/__tests__/services/walletSwitchingService.test.js +0 -209
  77. package/dist/__tests__/services/walletSwitchingService.test.js.map +0 -1
  78. package/dist/__tests__/services/workletLifecycleService.test.d.ts +0 -6
  79. package/dist/__tests__/services/workletLifecycleService.test.js +0 -451
  80. package/dist/__tests__/services/workletLifecycleService.test.js.map +0 -1
  81. package/dist/__tests__/setup.d.ts +0 -4
  82. package/dist/__tests__/setup.js +0 -49
  83. package/dist/__tests__/setup.js.map +0 -1
  84. package/dist/__tests__/storage/mmkvStorage.test.d.ts +0 -6
  85. package/dist/__tests__/storage/mmkvStorage.test.js +0 -213
  86. package/dist/__tests__/storage/mmkvStorage.test.js.map +0 -1
  87. package/dist/__tests__/store/walletStore.test.d.ts +0 -4
  88. package/dist/__tests__/store/walletStore.test.js +0 -86
  89. package/dist/__tests__/store/walletStore.test.js.map +0 -1
  90. package/dist/__tests__/store/workletStore.test.d.ts +0 -4
  91. package/dist/__tests__/store/workletStore.test.js +0 -255
  92. package/dist/__tests__/store/workletStore.test.js.map +0 -1
  93. package/dist/__tests__/types/hrpc.test.d.ts +0 -4
  94. package/dist/__tests__/types/hrpc.test.js +0 -99
  95. package/dist/__tests__/types/hrpc.test.js.map +0 -1
  96. package/dist/__tests__/utils/balanceUtils.test.d.ts +0 -4
  97. package/dist/__tests__/utils/balanceUtils.test.js +0 -133
  98. package/dist/__tests__/utils/balanceUtils.test.js.map +0 -1
  99. package/dist/__tests__/utils/errorHandling.test.d.ts +0 -6
  100. package/dist/__tests__/utils/errorHandling.test.js +0 -119
  101. package/dist/__tests__/utils/errorHandling.test.js.map +0 -1
  102. package/dist/__tests__/utils/errorUtils.test.d.ts +0 -4
  103. package/dist/__tests__/utils/errorUtils.test.js +0 -133
  104. package/dist/__tests__/utils/errorUtils.test.js.map +0 -1
  105. package/dist/__tests__/utils/initializationState.test.d.ts +0 -6
  106. package/dist/__tests__/utils/initializationState.test.js +0 -243
  107. package/dist/__tests__/utils/initializationState.test.js.map +0 -1
  108. package/dist/__tests__/utils/jsonUtils.test.d.ts +0 -4
  109. package/dist/__tests__/utils/jsonUtils.test.js +0 -118
  110. package/dist/__tests__/utils/jsonUtils.test.js.map +0 -1
  111. package/dist/__tests__/utils/mmkvKeyManager.test.d.ts +0 -6
  112. package/dist/__tests__/utils/mmkvKeyManager.test.js +0 -158
  113. package/dist/__tests__/utils/mmkvKeyManager.test.js.map +0 -1
  114. package/dist/__tests__/utils/mnemonicUtils.test.d.ts +0 -4
  115. package/dist/__tests__/utils/mnemonicUtils.test.js +0 -40
  116. package/dist/__tests__/utils/mnemonicUtils.test.js.map +0 -1
  117. package/dist/__tests__/utils/raceConditions.test.d.ts +0 -6
  118. package/dist/__tests__/utils/raceConditions.test.js +0 -239
  119. package/dist/__tests__/utils/raceConditions.test.js.map +0 -1
  120. package/dist/__tests__/utils/result.test.d.ts +0 -4
  121. package/dist/__tests__/utils/result.test.js +0 -66
  122. package/dist/__tests__/utils/result.test.js.map +0 -1
  123. package/dist/__tests__/utils/schemas.test.d.ts +0 -4
  124. package/dist/__tests__/utils/schemas.test.js +0 -66
  125. package/dist/__tests__/utils/schemas.test.js.map +0 -1
  126. package/dist/__tests__/utils/storeHelpers.test.d.ts +0 -4
  127. package/dist/__tests__/utils/storeHelpers.test.js +0 -227
  128. package/dist/__tests__/utils/storeHelpers.test.js.map +0 -1
  129. package/dist/__tests__/utils/typeGuards.test.d.ts +0 -4
  130. package/dist/__tests__/utils/typeGuards.test.js +0 -175
  131. package/dist/__tests__/utils/typeGuards.test.js.map +0 -1
  132. package/dist/__tests__/utils/validation.test.d.ts +0 -4
  133. package/dist/__tests__/utils/validation.test.js +0 -167
  134. package/dist/__tests__/utils/validation.test.js.map +0 -1
  135. package/dist/__tests__/utils/walletUtils.test.d.ts +0 -4
  136. package/dist/__tests__/utils/walletUtils.test.js +0 -156
  137. package/dist/__tests__/utils/walletUtils.test.js.map +0 -1
  138. package/dist/utils/types.js +0 -6
  139. package/dist/utils/utils/schemas.js +0 -173
  140. package/dist/utils/utils/validation.js +0 -151
@@ -1,99 +0,0 @@
1
- /**
2
- * Tests for HRPC type guards
3
- */
4
- import { isExtendedHRPC, asExtendedHRPC } from '../../types/hrpc';
5
- describe('hrpc', () => {
6
- describe('isExtendedHRPC', () => {
7
- it('should return true for HRPC with all extended methods', () => {
8
- const hrpc = {
9
- callMethod: jest.fn(),
10
- initializeWDK: jest.fn(),
11
- generateEntropyAndEncrypt: jest.fn(),
12
- getMnemonicFromEntropy: jest.fn(),
13
- getSeedAndEntropyFromMnemonic: jest.fn(),
14
- };
15
- expect(isExtendedHRPC(hrpc)).toBe(true);
16
- });
17
- it('should return false for HRPC without initializeWDK', () => {
18
- const hrpc = {
19
- callMethod: jest.fn(),
20
- generateEntropyAndEncrypt: jest.fn(),
21
- getMnemonicFromEntropy: jest.fn(),
22
- getSeedAndEntropyFromMnemonic: jest.fn(),
23
- };
24
- expect(isExtendedHRPC(hrpc)).toBe(false);
25
- });
26
- it('should return false for HRPC without generateEntropyAndEncrypt', () => {
27
- const hrpc = {
28
- callMethod: jest.fn(),
29
- initializeWDK: jest.fn(),
30
- getMnemonicFromEntropy: jest.fn(),
31
- getSeedAndEntropyFromMnemonic: jest.fn(),
32
- };
33
- expect(isExtendedHRPC(hrpc)).toBe(false);
34
- });
35
- it('should return false for HRPC without getMnemonicFromEntropy', () => {
36
- const hrpc = {
37
- callMethod: jest.fn(),
38
- initializeWDK: jest.fn(),
39
- generateEntropyAndEncrypt: jest.fn(),
40
- getSeedAndEntropyFromMnemonic: jest.fn(),
41
- };
42
- expect(isExtendedHRPC(hrpc)).toBe(false);
43
- });
44
- it('should return false for HRPC without getSeedAndEntropyFromMnemonic', () => {
45
- const hrpc = {
46
- callMethod: jest.fn(),
47
- initializeWDK: jest.fn(),
48
- generateEntropyAndEncrypt: jest.fn(),
49
- getMnemonicFromEntropy: jest.fn(),
50
- };
51
- expect(isExtendedHRPC(hrpc)).toBe(false);
52
- });
53
- it('should return false for HRPC with non-function methods', () => {
54
- const hrpc = {
55
- callMethod: jest.fn(),
56
- initializeWDK: 'not a function',
57
- generateEntropyAndEncrypt: jest.fn(),
58
- getMnemonicFromEntropy: jest.fn(),
59
- getSeedAndEntropyFromMnemonic: jest.fn(),
60
- };
61
- expect(isExtendedHRPC(hrpc)).toBe(false);
62
- });
63
- it('should return false for basic HRPC', () => {
64
- const hrpc = {
65
- callMethod: jest.fn(),
66
- };
67
- expect(isExtendedHRPC(hrpc)).toBe(false);
68
- });
69
- });
70
- describe('asExtendedHRPC', () => {
71
- it('should return HRPC when it has all extended methods', () => {
72
- const hrpc = {
73
- callMethod: jest.fn(),
74
- initializeWDK: jest.fn(),
75
- generateEntropyAndEncrypt: jest.fn(),
76
- getMnemonicFromEntropy: jest.fn(),
77
- getSeedAndEntropyFromMnemonic: jest.fn(),
78
- };
79
- const result = asExtendedHRPC(hrpc);
80
- expect(result).toBe(hrpc);
81
- });
82
- it('should throw error when HRPC does not have required methods', () => {
83
- const hrpc = {
84
- callMethod: jest.fn(),
85
- };
86
- expect(() => asExtendedHRPC(hrpc)).toThrow('HRPC instance does not have required extended methods');
87
- });
88
- it('should throw error when HRPC is missing initializeWDK', () => {
89
- const hrpc = {
90
- callMethod: jest.fn(),
91
- generateEntropyAndEncrypt: jest.fn(),
92
- getMnemonicFromEntropy: jest.fn(),
93
- getSeedAndEntropyFromMnemonic: jest.fn(),
94
- };
95
- expect(() => asExtendedHRPC(hrpc)).toThrow('HRPC instance does not have required extended methods');
96
- });
97
- });
98
- });
99
- //# sourceMappingURL=hrpc.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hrpc.test.js","sourceRoot":"","s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C,EAAE,EAAE;gBACjC,6BAA6B,EAAE,IAAI,CAAC,EAAE,EAAE;aACtB,CAAA;YAEpB,MAAM,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CACxC,uDAAuD,CACxD,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,4 +0,0 @@
1
- /**
2
- * Tests for balance utility functions
3
- */
4
- export {};
@@ -1,133 +0,0 @@
1
- /**
2
- * Tests for balance utility functions
3
- */
4
- import { convertBalanceToString, formatBalance, convertBigIntToString } from '../../utils/balanceUtils';
5
- describe('balanceUtils', () => {
6
- describe('convertBalanceToString', () => {
7
- it('should convert BigInt to string', () => {
8
- expect(convertBalanceToString(BigInt(100))).toBe('100');
9
- expect(convertBalanceToString(BigInt('1000000000000000000'))).toBe('1000000000000000000');
10
- });
11
- it('should return string as-is', () => {
12
- expect(convertBalanceToString('100')).toBe('100');
13
- expect(convertBalanceToString('0')).toBe('0');
14
- });
15
- it('should convert number to string', () => {
16
- expect(convertBalanceToString(100)).toBe('100');
17
- expect(convertBalanceToString(0)).toBe('0');
18
- });
19
- it('should convert other types to string', () => {
20
- expect(convertBalanceToString(null)).toBe('null');
21
- expect(convertBalanceToString(undefined)).toBe('undefined');
22
- expect(convertBalanceToString(true)).toBe('true');
23
- });
24
- });
25
- describe('formatBalance', () => {
26
- it('should format balance with 18 decimals', () => {
27
- expect(formatBalance('1000000000000000000', 18)).toBe('1');
28
- expect(formatBalance('1500000000000000000', 18)).toBe('1.5');
29
- expect(formatBalance('100000000000000000', 18)).toBe('0.1');
30
- expect(formatBalance('123456789000000000', 18)).toBe('0.123456789');
31
- });
32
- it('should format balance with 6 decimals', () => {
33
- expect(formatBalance('1000000', 6)).toBe('1');
34
- expect(formatBalance('1500000', 6)).toBe('1.5');
35
- expect(formatBalance('1000001', 6)).toBe('1.000001');
36
- });
37
- it('should handle zero balance', () => {
38
- expect(formatBalance('0', 18)).toBe('0');
39
- expect(formatBalance(null, 18)).toBe('0');
40
- expect(formatBalance('null', 18)).toBe('0');
41
- });
42
- it('should remove trailing zeros', () => {
43
- expect(formatBalance('1000000000000000000', 18)).toBe('1');
44
- expect(formatBalance('10000000000000000000', 18)).toBe('10');
45
- });
46
- it('should handle large balances', () => {
47
- expect(formatBalance('1000000000000000000000', 18)).toBe('1000');
48
- expect(formatBalance('1000000000000000000000000', 18)).toBe('1000000');
49
- });
50
- it('should handle invalid balance gracefully', () => {
51
- expect(formatBalance('invalid', 18)).toBe('invalid');
52
- expect(formatBalance('', 18)).toBe('0');
53
- });
54
- });
55
- describe('convertBigIntToString', () => {
56
- it('should convert BigInt to string', () => {
57
- expect(convertBigIntToString(BigInt(100))).toBe('100');
58
- expect(convertBigIntToString(BigInt('1000000000000000000'))).toBe('1000000000000000000');
59
- });
60
- it('should convert BigInt in arrays', () => {
61
- const input = [BigInt(100), BigInt(200), 'string', 42];
62
- const result = convertBigIntToString(input);
63
- expect(result).toEqual(['100', '200', 'string', 42]);
64
- });
65
- it('should convert BigInt in nested arrays', () => {
66
- const input = [[BigInt(100)], [BigInt(200), 'test']];
67
- const result = convertBigIntToString(input);
68
- expect(result).toEqual([['100'], ['200', 'test']]);
69
- });
70
- it('should convert BigInt in objects', () => {
71
- const input = {
72
- balance: BigInt(100),
73
- amount: BigInt(200),
74
- name: 'test',
75
- count: 42,
76
- };
77
- const result = convertBigIntToString(input);
78
- expect(result).toEqual({
79
- balance: '100',
80
- amount: '200',
81
- name: 'test',
82
- count: 42,
83
- });
84
- });
85
- it('should convert BigInt in nested objects', () => {
86
- const input = {
87
- data: {
88
- balance: BigInt(100),
89
- nested: {
90
- amount: BigInt(200),
91
- },
92
- },
93
- };
94
- const result = convertBigIntToString(input);
95
- expect(result).toEqual({
96
- data: {
97
- balance: '100',
98
- nested: {
99
- amount: '200',
100
- },
101
- },
102
- });
103
- });
104
- it('should convert BigInt in mixed arrays and objects', () => {
105
- const input = {
106
- balances: [BigInt(100), BigInt(200)],
107
- data: {
108
- amounts: [BigInt(300), BigInt(400)],
109
- },
110
- };
111
- const result = convertBigIntToString(input);
112
- expect(result).toEqual({
113
- balances: ['100', '200'],
114
- data: {
115
- amounts: ['300', '400'],
116
- },
117
- });
118
- });
119
- it('should return primitives as-is', () => {
120
- expect(convertBigIntToString('string')).toBe('string');
121
- expect(convertBigIntToString(42)).toBe(42);
122
- expect(convertBigIntToString(null)).toBe(null);
123
- expect(convertBigIntToString(undefined)).toBe(undefined);
124
- expect(convertBigIntToString(true)).toBe(true);
125
- expect(convertBigIntToString(false)).toBe(false);
126
- });
127
- it('should handle empty arrays and objects', () => {
128
- expect(convertBigIntToString([])).toEqual([]);
129
- expect(convertBigIntToString({})).toEqual({});
130
- });
131
- });
132
- });
133
- //# sourceMappingURL=balanceUtils.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"balanceUtils.test.js","sourceRoot":"","sources":["../../../src/__tests__/utils/balanceUtils.test.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEvG,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;YACzC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YACvD,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;QAC3F,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;YACpC,MAAM,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,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AA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Tests for errorHandling utilities
3
- *
4
- * Tests service error handling patterns
5
- */
6
- export {};
@@ -1,119 +0,0 @@
1
- /**
2
- * Tests for errorHandling utilities
3
- *
4
- * Tests service error handling patterns
5
- */
6
- import { handleServiceError } from '../../utils/errorHandling';
7
- import { normalizeError } from '../../utils/errorUtils';
8
- import { logError } from '../../utils/logger';
9
- // Mock dependencies
10
- jest.mock('../../utils/errorUtils', () => ({
11
- normalizeError: jest.fn(),
12
- }));
13
- jest.mock('../../utils/logger', () => ({
14
- logError: jest.fn(),
15
- }));
16
- describe('errorHandling', () => {
17
- beforeEach(() => {
18
- jest.clearAllMocks();
19
- });
20
- describe('handleServiceError', () => {
21
- it('should normalize and log error', () => {
22
- const error = new Error('Test error');
23
- const normalizedError = new Error('Normalized error');
24
- normalizeError.mockReturnValue(normalizedError);
25
- expect(() => {
26
- handleServiceError(error, 'TestService', 'testOperation');
27
- }).toThrow('Normalized error');
28
- expect(normalizeError).toHaveBeenCalledWith(error, false, {
29
- component: 'TestService',
30
- operation: 'testOperation',
31
- });
32
- expect(logError).toHaveBeenCalledWith('[TestService] testOperation failed:', normalizedError);
33
- });
34
- it('should include context in error normalization', () => {
35
- const error = new Error('Test error');
36
- const normalizedError = new Error('Normalized error');
37
- normalizeError.mockReturnValue(normalizedError);
38
- const context = { network: 'ethereum', accountIndex: 0 };
39
- expect(() => {
40
- handleServiceError(error, 'TestService', 'testOperation', context);
41
- }).toThrow('Normalized error');
42
- expect(normalizeError).toHaveBeenCalledWith(error, false, {
43
- component: 'TestService',
44
- operation: 'testOperation',
45
- ...context,
46
- });
47
- });
48
- it('should not sanitize errors (sanitizeLevel: false)', () => {
49
- const error = new Error('Test error');
50
- const normalizedError = new Error('Normalized error');
51
- normalizeError.mockReturnValue(normalizedError);
52
- expect(() => {
53
- handleServiceError(error, 'TestService', 'testOperation');
54
- }).toThrow();
55
- expect(normalizeError).toHaveBeenCalledWith(error, false, expect.any(Object));
56
- });
57
- it('should handle non-Error objects', () => {
58
- const error = 'String error';
59
- const normalizedError = new Error('Normalized error');
60
- normalizeError.mockReturnValue(normalizedError);
61
- expect(() => {
62
- handleServiceError(error, 'TestService', 'testOperation');
63
- }).toThrow('Normalized error');
64
- expect(normalizeError).toHaveBeenCalledWith(error, false, {
65
- component: 'TestService',
66
- operation: 'testOperation',
67
- });
68
- });
69
- it('should handle null/undefined errors', () => {
70
- const normalizedError = new Error('Normalized error');
71
- normalizeError.mockReturnValue(normalizedError);
72
- expect(() => {
73
- handleServiceError(null, 'TestService', 'testOperation');
74
- }).toThrow('Normalized error');
75
- expect(normalizeError).toHaveBeenCalledWith(null, false, {
76
- component: 'TestService',
77
- operation: 'testOperation',
78
- });
79
- });
80
- it('should always throw normalized error', () => {
81
- const error = new Error('Test error');
82
- const normalizedError = new Error('Normalized error');
83
- normalizeError.mockReturnValue(normalizedError);
84
- expect(() => {
85
- handleServiceError(error, 'TestService', 'testOperation');
86
- }).toThrow(normalizedError);
87
- // Verify it throws (never returns)
88
- try {
89
- handleServiceError(error, 'TestService', 'testOperation');
90
- fail('Should have thrown');
91
- }
92
- catch (e) {
93
- expect(e).toBe(normalizedError);
94
- }
95
- });
96
- it('should log error with correct format', () => {
97
- const error = new Error('Test error');
98
- const normalizedError = new Error('Normalized error');
99
- normalizeError.mockReturnValue(normalizedError);
100
- expect(() => {
101
- handleServiceError(error, 'MyService', 'myOperation');
102
- }).toThrow();
103
- expect(logError).toHaveBeenCalledWith('[MyService] myOperation failed:', normalizedError);
104
- });
105
- it('should handle complex error objects', () => {
106
- const error = { code: 'ERR_CODE', message: 'Error message', details: { foo: 'bar' } };
107
- const normalizedError = new Error('Normalized error');
108
- normalizeError.mockReturnValue(normalizedError);
109
- expect(() => {
110
- handleServiceError(error, 'TestService', 'testOperation');
111
- }).toThrow('Normalized error');
112
- expect(normalizeError).toHaveBeenCalledWith(error, false, {
113
- component: 'TestService',
114
- operation: 'testOperation',
115
- });
116
- });
117
- });
118
- });
119
- //# sourceMappingURL=errorHandling.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errorHandling.test.js","sourceRoot":"","sources":["../../../src/__tests__/utils/errorHandling.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C,oBAAoB;AACpB,IAAI,CAAC,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,CAAC,CAAC;IACzC,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;CAC1B,CAAC,CAAC,CAAA;AAEH,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,GAAG,EAAE,CAAC,CAAC;IACrC,QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE;CACpB,CAAC,CAAC,CAAA;AAEH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;YACxC,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAA;YACrC,MAAM,eAAe,GAAG,IAAI,KAAK,CAAC,kBAAkB,CAAC,CACpD;YAAC,cAA4B,CAAC,eAAe,CAAC,eAAe,CAAC,CAAA;YAE/D,MAAM,CAAC,GAAG,EAAE;gBACV,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,eAAe,CAAC,CAAA;YAC3D,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;YAE9B,MAAM,CAAC,cAAc,CAAC,CA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AAC,kBAAkB,CAAC,CACpD;YAAC,cAA4B,CAAC,eAAe,CAAC,eAAe,CAAC,CAAA;YAE/D,MAAM,CAAC,GAAG,EAAE;gBACV,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,eAAe,CAAC,CAAA;YAC3D,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;YAE9B,MAAM,CAAC,cAAc,CAAC,CAAC,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE;gBACxD,SAAS,EAAE,aAAa;gBACxB,SAAS,EAAE,eAAe;aAC3B,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,4 +0,0 @@
1
- /**
2
- * Tests for error utility functions
3
- */
4
- export {};
@@ -1,133 +0,0 @@
1
- /**
2
- * Tests for error utility functions
3
- */
4
- import { normalizeError, getErrorMessage, isErrorType, createContextualError, sanitizeErrorMessage, SanitizationLevel, } from '../../utils/errorUtils';
5
- describe('errorUtils', () => {
6
- describe('normalizeError', () => {
7
- it('should normalize Error instances', () => {
8
- const error = new Error('Test error');
9
- const normalized = normalizeError(error, false);
10
- expect(normalized).toBeInstanceOf(Error);
11
- expect(normalized.message).toBe('Test error');
12
- });
13
- it('should normalize string errors', () => {
14
- const normalized = normalizeError('String error', false);
15
- expect(normalized).toBeInstanceOf(Error);
16
- expect(normalized.message).toBe('String error');
17
- });
18
- it('should normalize object with message property', () => {
19
- const error = { message: 'Object error' };
20
- const normalized = normalizeError(error, false);
21
- expect(normalized).toBeInstanceOf(Error);
22
- expect(normalized.message).toBe('Object error');
23
- });
24
- it('should normalize other values', () => {
25
- const normalized = normalizeError(123, false);
26
- expect(normalized).toBeInstanceOf(Error);
27
- expect(normalized.message).toBe('123');
28
- });
29
- it('should preserve error name and stack', () => {
30
- const error = new TypeError('Type error');
31
- error.stack = 'stack trace';
32
- const normalized = normalizeError(error, false);
33
- expect(normalized.name).toBe('TypeError');
34
- expect(normalized.stack).toBe('stack trace');
35
- });
36
- it('should sanitize error messages in production', () => {
37
- const originalEnv = process.env.NODE_ENV;
38
- process.env.NODE_ENV = 'production';
39
- const error = new Error('Error with 0x1234567890123456789012345678901234567890');
40
- const normalized = normalizeError(error, true);
41
- expect(normalized.message).not.toContain('0x1234567890123456789012345678901234567890');
42
- process.env.NODE_ENV = originalEnv;
43
- });
44
- it('should use SanitizationLevel enum', () => {
45
- const error = new Error('Error with 0x1234567890123456789012345678901234567890');
46
- const none = normalizeError(error, SanitizationLevel.NONE);
47
- expect(none.message).toContain('0x1234567890123456789012345678901234567890');
48
- const dev = normalizeError(error, SanitizationLevel.DEVELOPMENT);
49
- expect(dev.message).toContain('0x1234');
50
- const prod = normalizeError(error, SanitizationLevel.PRODUCTION);
51
- expect(prod.message).not.toContain('0x1234567890123456789012345678901234567890');
52
- });
53
- it('should handle boolean sanitize parameter for backward compatibility', () => {
54
- const error = new Error('Error with 0x1234567890123456789012345678901234567890');
55
- const sanitized = normalizeError(error, true);
56
- expect(sanitized.message).not.toContain('0x1234567890123456789012345678901234567890');
57
- const notSanitized = normalizeError(error, false);
58
- expect(notSanitized.message).toContain('0x1234567890123456789012345678901234567890');
59
- });
60
- it('should sanitize stack traces based on level', () => {
61
- const error = new Error('Test error');
62
- error.stack = 'Error: Test error\n at file:///path/to/sensitive/key.js:1:1';
63
- const prod = normalizeError(error, SanitizationLevel.PRODUCTION);
64
- expect(prod.stack).not.toContain('/path/to/sensitive/key.js');
65
- const none = normalizeError(error, SanitizationLevel.NONE);
66
- expect(none.stack).toContain('/path/to/sensitive/key.js');
67
- });
68
- });
69
- describe('getErrorMessage', () => {
70
- it('should extract message from Error', () => {
71
- const error = new Error('Test error');
72
- expect(getErrorMessage(error)).toBe('Test error');
73
- });
74
- it('should extract message from string', () => {
75
- expect(getErrorMessage('String error')).toBe('String error');
76
- });
77
- it('should extract message from object', () => {
78
- expect(getErrorMessage({ message: 'Object error' })).toBe('Object error');
79
- });
80
- });
81
- describe('isErrorType', () => {
82
- it('should return true for matching error type', () => {
83
- const error = new TypeError('Type error');
84
- expect(isErrorType(error, 'TypeError')).toBe(true);
85
- });
86
- it('should return false for non-matching error type', () => {
87
- const error = new TypeError('Type error');
88
- expect(isErrorType(error, 'ReferenceError')).toBe(false);
89
- });
90
- it('should return false for non-Error values', () => {
91
- expect(isErrorType('string', 'Error')).toBe(false);
92
- expect(isErrorType(null, 'Error')).toBe(false);
93
- });
94
- });
95
- describe('createContextualError', () => {
96
- it('should create error with message', () => {
97
- const error = createContextualError('Test error');
98
- expect(error).toBeInstanceOf(Error);
99
- expect(error.message).toBe('Test error');
100
- });
101
- it('should create error with context', () => {
102
- const context = { operation: 'test', component: 'TestComponent' };
103
- const error = createContextualError('Test error', context);
104
- expect(error).toBeInstanceOf(Error);
105
- expect(error.context).toEqual(context);
106
- });
107
- });
108
- describe('sanitizeErrorMessage', () => {
109
- it('should sanitize sensitive patterns in production', () => {
110
- const message = 'Error with encryptionKey: 0x1234567890123456789012345678901234567890';
111
- const sanitized = sanitizeErrorMessage(message, false);
112
- expect(sanitized).not.toContain('0x1234567890123456789012345678901234567890');
113
- expect(sanitized).toContain('[encryption data]');
114
- });
115
- it('should preserve more info in development', () => {
116
- const message = 'Error with 0x1234567890123456789012345678901234567890';
117
- const sanitized = sanitizeErrorMessage(message, true);
118
- expect(sanitized).toContain('0x1234');
119
- expect(sanitized).toContain('7890');
120
- });
121
- it('should not sanitize safe patterns', () => {
122
- const message = 'Error with publicKey: 0x1234567890123456789012345678901234567890';
123
- const sanitized = sanitizeErrorMessage(message, false);
124
- expect(sanitized).toContain('publicKey');
125
- });
126
- it('should handle mnemonic phrases', () => {
127
- const message = 'Error with mnemonic: word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12';
128
- const sanitized = sanitizeErrorMessage(message, false);
129
- expect(sanitized).toContain('[mnemonic phrase]');
130
- });
131
- });
132
- });
133
- //# sourceMappingURL=errorUtils.test.js.map
@@ -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