@aboutcircles/sdk-utils 0.1.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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=abi.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi.test.d.ts","sourceRoot":"","sources":["../../src/tests/abi.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,508 @@
1
+ import { describe, test, expect } from 'bun:test';
2
+ import { encodeFunctionData, decodeFunctionResult } from '../abi';
3
+ import { encodeFunctionData as viemEncodeFunctionData, decodeFunctionResult as viemDecodeFunctionResult } from 'viem/utils';
4
+ describe('encodeFunctionData', () => {
5
+ test('encodes function with no inputs', () => {
6
+ const abi = [
7
+ {
8
+ name: 'name',
9
+ type: 'function',
10
+ stateMutability: 'view',
11
+ inputs: [],
12
+ outputs: [{ type: 'string', name: '' }],
13
+ },
14
+ ];
15
+ const custom = encodeFunctionData({
16
+ abi,
17
+ functionName: 'name',
18
+ });
19
+ const viem = viemEncodeFunctionData({
20
+ abi,
21
+ functionName: 'name',
22
+ });
23
+ expect(custom).toBe(viem);
24
+ expect(custom).toBe('0x06fdde03');
25
+ });
26
+ test('encodes function with single address input', () => {
27
+ const abi = [
28
+ {
29
+ name: 'balanceOf',
30
+ type: 'function',
31
+ stateMutability: 'view',
32
+ inputs: [{ type: 'address', name: 'account' }],
33
+ outputs: [{ type: 'uint256', name: '' }],
34
+ },
35
+ ];
36
+ const address = '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed';
37
+ const custom = encodeFunctionData({
38
+ abi,
39
+ functionName: 'balanceOf',
40
+ args: [address],
41
+ });
42
+ const viem = viemEncodeFunctionData({
43
+ abi,
44
+ functionName: 'balanceOf',
45
+ args: [address],
46
+ });
47
+ expect(custom).toBe(viem);
48
+ });
49
+ test('encodes function with uint256 input', () => {
50
+ const abi = [
51
+ {
52
+ name: 'transfer',
53
+ type: 'function',
54
+ stateMutability: 'nonpayable',
55
+ inputs: [
56
+ { type: 'address', name: 'to' },
57
+ { type: 'uint256', name: 'amount' },
58
+ ],
59
+ outputs: [{ type: 'bool', name: '' }],
60
+ },
61
+ ];
62
+ const custom = encodeFunctionData({
63
+ abi,
64
+ functionName: 'transfer',
65
+ args: ['0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed', 1000n],
66
+ });
67
+ const viem = viemEncodeFunctionData({
68
+ abi,
69
+ functionName: 'transfer',
70
+ args: ['0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed', 1000n],
71
+ });
72
+ expect(custom).toBe(viem);
73
+ });
74
+ test('encodes function with bool input', () => {
75
+ const abi = [
76
+ {
77
+ name: 'setApprovalForAll',
78
+ type: 'function',
79
+ stateMutability: 'nonpayable',
80
+ inputs: [
81
+ { type: 'address', name: 'operator' },
82
+ { type: 'bool', name: 'approved' },
83
+ ],
84
+ outputs: [],
85
+ },
86
+ ];
87
+ const custom = encodeFunctionData({
88
+ abi,
89
+ functionName: 'setApprovalForAll',
90
+ args: ['0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed', true],
91
+ });
92
+ const viem = viemEncodeFunctionData({
93
+ abi,
94
+ functionName: 'setApprovalForAll',
95
+ args: ['0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed', true],
96
+ });
97
+ expect(custom).toBe(viem);
98
+ });
99
+ test('encodes function with bytes32 input', () => {
100
+ const abi = [
101
+ {
102
+ name: 'setData',
103
+ type: 'function',
104
+ stateMutability: 'nonpayable',
105
+ inputs: [{ type: 'bytes32', name: 'data' }],
106
+ outputs: [],
107
+ },
108
+ ];
109
+ const bytes32Value = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef';
110
+ const custom = encodeFunctionData({
111
+ abi,
112
+ functionName: 'setData',
113
+ args: [bytes32Value],
114
+ });
115
+ const viem = viemEncodeFunctionData({
116
+ abi,
117
+ functionName: 'setData',
118
+ args: [bytes32Value],
119
+ });
120
+ expect(custom).toBe(viem);
121
+ });
122
+ test('encodes function with multiple uint types', () => {
123
+ const abi = [
124
+ {
125
+ name: 'multiUint',
126
+ type: 'function',
127
+ stateMutability: 'pure',
128
+ inputs: [
129
+ { type: 'uint8', name: 'a' },
130
+ { type: 'uint16', name: 'b' },
131
+ { type: 'uint256', name: 'c' },
132
+ ],
133
+ outputs: [],
134
+ },
135
+ ];
136
+ const custom = encodeFunctionData({
137
+ abi,
138
+ functionName: 'multiUint',
139
+ args: [255, 65535, 123456789n],
140
+ });
141
+ const viem = viemEncodeFunctionData({
142
+ abi,
143
+ functionName: 'multiUint',
144
+ args: [255, 65535, 123456789n],
145
+ });
146
+ expect(custom).toBe(viem);
147
+ });
148
+ test('encodes function with string input', () => {
149
+ const abi = [
150
+ {
151
+ name: 'setName',
152
+ type: 'function',
153
+ stateMutability: 'nonpayable',
154
+ inputs: [{ type: 'string', name: 'newName' }],
155
+ outputs: [],
156
+ },
157
+ ];
158
+ const custom = encodeFunctionData({
159
+ abi,
160
+ functionName: 'setName',
161
+ args: ['Hello World'],
162
+ });
163
+ const viem = viemEncodeFunctionData({
164
+ abi,
165
+ functionName: 'setName',
166
+ args: ['Hello World'],
167
+ });
168
+ expect(custom).toBe(viem);
169
+ });
170
+ test('encodes function with fixed array input', () => {
171
+ const abi = [
172
+ {
173
+ name: 'setValues',
174
+ type: 'function',
175
+ stateMutability: 'nonpayable',
176
+ inputs: [{ type: 'uint256[3]', name: 'values' }],
177
+ outputs: [],
178
+ },
179
+ ];
180
+ const custom = encodeFunctionData({
181
+ abi,
182
+ functionName: 'setValues',
183
+ args: [[1n, 2n, 3n]],
184
+ });
185
+ const viem = viemEncodeFunctionData({
186
+ abi,
187
+ functionName: 'setValues',
188
+ args: [[1n, 2n, 3n]],
189
+ });
190
+ expect(custom).toBe(viem);
191
+ });
192
+ test('encodes function with dynamic array input', () => {
193
+ const abi = [
194
+ {
195
+ name: 'setDynamicValues',
196
+ type: 'function',
197
+ stateMutability: 'nonpayable',
198
+ inputs: [{ type: 'uint256[]', name: 'values' }],
199
+ outputs: [],
200
+ },
201
+ ];
202
+ const custom = encodeFunctionData({
203
+ abi,
204
+ functionName: 'setDynamicValues',
205
+ args: [[1n, 2n, 3n, 4n, 5n]],
206
+ });
207
+ const viem = viemEncodeFunctionData({
208
+ abi,
209
+ functionName: 'setDynamicValues',
210
+ args: [[1n, 2n, 3n, 4n, 5n]],
211
+ });
212
+ expect(custom).toBe(viem);
213
+ });
214
+ test('encodes function with mixed static and dynamic inputs', () => {
215
+ const abi = [
216
+ {
217
+ name: 'complexFunction',
218
+ type: 'function',
219
+ stateMutability: 'nonpayable',
220
+ inputs: [
221
+ { type: 'address', name: 'addr' },
222
+ { type: 'uint256', name: 'amount' },
223
+ { type: 'string', name: 'message' },
224
+ ],
225
+ outputs: [],
226
+ },
227
+ ];
228
+ const custom = encodeFunctionData({
229
+ abi,
230
+ functionName: 'complexFunction',
231
+ args: ['0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed', 1000n, 'test'],
232
+ });
233
+ const viem = viemEncodeFunctionData({
234
+ abi,
235
+ functionName: 'complexFunction',
236
+ args: ['0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed', 1000n, 'test'],
237
+ });
238
+ expect(custom).toBe(viem);
239
+ });
240
+ test('encodes operateFlowMatrix function with complex nested tuples', () => {
241
+ const abi = [
242
+ {
243
+ type: 'function',
244
+ name: 'operateFlowMatrix',
245
+ inputs: [
246
+ { name: '_flowVertices', type: 'address[]' },
247
+ {
248
+ name: '_flow',
249
+ type: 'tuple[]',
250
+ components: [
251
+ { name: 'streamSinkId', type: 'uint16' },
252
+ { name: 'amount', type: 'uint192' },
253
+ ],
254
+ },
255
+ {
256
+ name: '_streams',
257
+ type: 'tuple[]',
258
+ components: [
259
+ { name: 'sourceCoordinate', type: 'uint16' },
260
+ { name: 'flowEdgeIds', type: 'uint16[]' },
261
+ { name: 'data', type: 'bytes' },
262
+ ],
263
+ },
264
+ { name: '_packedCoordinates', type: 'bytes' },
265
+ ],
266
+ outputs: [],
267
+ stateMutability: 'nonpayable',
268
+ },
269
+ ];
270
+ const flowVertices = [
271
+ '0x1786712d8cbf16cb6bb1bcee04b499f0ab8a8b83',
272
+ '0xa63abf03d5c6ef8d56e1432277573c47cbe8a8a6',
273
+ '0xafeeb1c2ff5ee3757f106743142d2cd719116c72',
274
+ '0xc7d3df890952a327af94d5ba6fdc1bf145188a1b',
275
+ '0xcbdf2a2b2c7417ce9f10943d44d590058418ac00',
276
+ '0xd910d745a5b3da2e487864f39c777ef1362780a8',
277
+ '0xdcc6f30bc1b06b7523c364beffbf879475d140b6',
278
+ '0xf48554937f18885c7f15c432c596b5843648231d',
279
+ ];
280
+ const flow = [
281
+ { streamSinkId: 0, amount: 47518455000000000000n },
282
+ { streamSinkId: 1, amount: 47518455000000000000n },
283
+ { streamSinkId: 0, amount: 82656000000000000n },
284
+ { streamSinkId: 0, amount: 82656000000000000n },
285
+ { streamSinkId: 1, amount: 82656000000000000n },
286
+ ];
287
+ const streams = [
288
+ {
289
+ sourceCoordinate: 0,
290
+ flowEdgeIds: [1, 4],
291
+ data: '0x',
292
+ },
293
+ ];
294
+ const packedCoordinates = '0x000000000007000500070003000200000001000600010004000400040003';
295
+ const custom = encodeFunctionData({
296
+ abi,
297
+ functionName: 'operateFlowMatrix',
298
+ args: [flowVertices, flow, streams, packedCoordinates],
299
+ });
300
+ const viem = viemEncodeFunctionData({
301
+ abi,
302
+ functionName: 'operateFlowMatrix',
303
+ args: [flowVertices, flow, streams, packedCoordinates],
304
+ });
305
+ expect(custom).toBe(viem);
306
+ });
307
+ });
308
+ describe('decodeFunctionResult', () => {
309
+ test('decodes uint256 result', () => {
310
+ const abi = [
311
+ {
312
+ name: 'balanceOf',
313
+ type: 'function',
314
+ stateMutability: 'view',
315
+ inputs: [{ type: 'address', name: 'account' }],
316
+ outputs: [{ type: 'uint256', name: 'balance' }],
317
+ },
318
+ ];
319
+ const data = '0x00000000000000000000000000000000000000000000000000000000000003e8';
320
+ const custom = decodeFunctionResult({
321
+ abi,
322
+ functionName: 'balanceOf',
323
+ data,
324
+ });
325
+ const viem = viemDecodeFunctionResult({
326
+ abi,
327
+ functionName: 'balanceOf',
328
+ data,
329
+ });
330
+ expect(custom).toBe(viem);
331
+ expect(custom).toBe(1000n);
332
+ });
333
+ test('decodes address result', () => {
334
+ const abi = [
335
+ {
336
+ name: 'owner',
337
+ type: 'function',
338
+ stateMutability: 'view',
339
+ inputs: [],
340
+ outputs: [{ type: 'address', name: '' }],
341
+ },
342
+ ];
343
+ const data = '0x0000000000000000000000005aaeb6053f3e94c9b9a09f33669435e7ef1beaed';
344
+ const custom = decodeFunctionResult({
345
+ abi,
346
+ functionName: 'owner',
347
+ data,
348
+ });
349
+ const viem = viemDecodeFunctionResult({
350
+ abi,
351
+ functionName: 'owner',
352
+ data,
353
+ });
354
+ expect(custom).toBe(viem);
355
+ expect(custom).toBe('0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed');
356
+ });
357
+ test('decodes bool result', () => {
358
+ const abi = [
359
+ {
360
+ name: 'isApproved',
361
+ type: 'function',
362
+ stateMutability: 'view',
363
+ inputs: [],
364
+ outputs: [{ type: 'bool', name: '' }],
365
+ },
366
+ ];
367
+ const data = '0x0000000000000000000000000000000000000000000000000000000000000001';
368
+ const custom = decodeFunctionResult({
369
+ abi,
370
+ functionName: 'isApproved',
371
+ data,
372
+ });
373
+ const viem = viemDecodeFunctionResult({
374
+ abi,
375
+ functionName: 'isApproved',
376
+ data,
377
+ });
378
+ expect(custom).toBe(viem);
379
+ expect(custom).toBe(true);
380
+ });
381
+ test('decodes string result', () => {
382
+ const abi = [
383
+ {
384
+ name: 'name',
385
+ type: 'function',
386
+ stateMutability: 'view',
387
+ inputs: [],
388
+ outputs: [{ type: 'string', name: '' }],
389
+ },
390
+ ];
391
+ const data = '0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000b48656c6c6f20576f726c64000000000000000000000000000000000000000000';
392
+ const custom = decodeFunctionResult({
393
+ abi,
394
+ functionName: 'name',
395
+ data,
396
+ });
397
+ const viem = viemDecodeFunctionResult({
398
+ abi,
399
+ functionName: 'name',
400
+ data,
401
+ });
402
+ expect(custom).toBe(viem);
403
+ expect(custom).toBe('Hello World');
404
+ });
405
+ test('decodes bytes32 result', () => {
406
+ const abi = [
407
+ {
408
+ name: 'getData',
409
+ type: 'function',
410
+ stateMutability: 'view',
411
+ inputs: [],
412
+ outputs: [{ type: 'bytes32', name: '' }],
413
+ },
414
+ ];
415
+ const data = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef';
416
+ const custom = decodeFunctionResult({
417
+ abi,
418
+ functionName: 'getData',
419
+ data,
420
+ });
421
+ const viem = viemDecodeFunctionResult({
422
+ abi,
423
+ functionName: 'getData',
424
+ data,
425
+ });
426
+ expect(custom).toBe(viem);
427
+ });
428
+ test('decodes multiple outputs (tuple)', () => {
429
+ const abi = [
430
+ {
431
+ name: 'getInfo',
432
+ type: 'function',
433
+ stateMutability: 'view',
434
+ inputs: [],
435
+ outputs: [
436
+ { type: 'address', name: 'addr' },
437
+ { type: 'uint256', name: 'amount' },
438
+ { type: 'bool', name: 'active' },
439
+ ],
440
+ },
441
+ ];
442
+ const data = '0x0000000000000000000000005aaeb6053f3e94c9b9a09f33669435e7ef1beaed00000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000000000000000001';
443
+ const custom = decodeFunctionResult({
444
+ abi,
445
+ functionName: 'getInfo',
446
+ data,
447
+ });
448
+ const viem = viemDecodeFunctionResult({
449
+ abi,
450
+ functionName: 'getInfo',
451
+ data,
452
+ });
453
+ expect(custom).toEqual(viem);
454
+ expect(custom).toEqual([
455
+ '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed',
456
+ 1000n,
457
+ true,
458
+ ]);
459
+ });
460
+ test('decodes dynamic array result', () => {
461
+ const abi = [
462
+ {
463
+ name: 'getValues',
464
+ type: 'function',
465
+ stateMutability: 'view',
466
+ inputs: [],
467
+ outputs: [{ type: 'uint256[]', name: '' }],
468
+ },
469
+ ];
470
+ const data = '0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000c8';
471
+ const custom = decodeFunctionResult({
472
+ abi,
473
+ functionName: 'getValues',
474
+ data,
475
+ });
476
+ const viem = viemDecodeFunctionResult({
477
+ abi,
478
+ functionName: 'getValues',
479
+ data,
480
+ });
481
+ expect(custom).toEqual(viem);
482
+ expect(custom).toEqual([10n, 20n, 200n]);
483
+ });
484
+ test('decodes fixed array result', () => {
485
+ const abi = [
486
+ {
487
+ name: 'getFixedValues',
488
+ type: 'function',
489
+ stateMutability: 'view',
490
+ inputs: [],
491
+ outputs: [{ type: 'uint256[3]', name: '' }],
492
+ },
493
+ ];
494
+ const data = '0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003';
495
+ const custom = decodeFunctionResult({
496
+ abi,
497
+ functionName: 'getFixedValues',
498
+ data,
499
+ });
500
+ const viem = viemDecodeFunctionResult({
501
+ abi,
502
+ functionName: 'getFixedValues',
503
+ data,
504
+ });
505
+ expect(custom).toEqual(viem);
506
+ expect(custom).toEqual([1n, 2n, 3n]);
507
+ });
508
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=checksumAddress.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checksumAddress.test.d.ts","sourceRoot":"","sources":["../../src/tests/checksumAddress.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,93 @@
1
+ import { describe, test, expect } from 'bun:test';
2
+ import { checksumAddress } from '../abi';
3
+ describe('checksumAddress', () => {
4
+ test('checksums lowercase address correctly', () => {
5
+ const lowercase = '0x5aaeb6053f3e94c9b9a09f33669435e7ef1beaed';
6
+ const expected = '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed';
7
+ expect(checksumAddress(lowercase)).toBe(expected);
8
+ });
9
+ test('checksums uppercase address correctly', () => {
10
+ const uppercase = '0X5AAEB6053F3E94C9B9A09F33669435E7EF1BEAED';
11
+ const expected = '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed';
12
+ expect(checksumAddress(uppercase)).toBe(expected);
13
+ });
14
+ test('checksums mixed case address correctly', () => {
15
+ const mixedCase = '0x5aAeB6053f3E94c9b9a09F33669435e7Ef1beAED';
16
+ const expected = '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed';
17
+ expect(checksumAddress(mixedCase)).toBe(expected);
18
+ });
19
+ test('handles address without 0x prefix', () => {
20
+ const withoutPrefix = '5aaeb6053f3e94c9b9a09f33669435e7ef1beaed';
21
+ const expected = '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed';
22
+ expect(checksumAddress(withoutPrefix)).toBe(expected);
23
+ });
24
+ test('checksums all-zero address', () => {
25
+ const zeroAddress = '0x0000000000000000000000000000000000000000';
26
+ const expected = '0x0000000000000000000000000000000000000000';
27
+ expect(checksumAddress(zeroAddress)).toBe(expected);
28
+ });
29
+ test('checksums real Ethereum addresses correctly', () => {
30
+ // Real addresses with known checksums
31
+ const testCases = [
32
+ {
33
+ input: '0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359',
34
+ expected: '0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359',
35
+ },
36
+ {
37
+ input: '0xdbf03b407c01e7cd3cbea99509d93f8dddc8c6fb',
38
+ expected: '0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB',
39
+ },
40
+ {
41
+ input: '0xd1220a0cf47c7b9be7a2e6ba89f429762e7b9adb',
42
+ expected: '0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb',
43
+ },
44
+ {
45
+ input: '0xc7d3df890952a327af94d5ba6fdc1bf145188a1b',
46
+ expected: '0xc7d3dF890952a327Af94D5Ba6fdC1Bf145188a1b',
47
+ },
48
+ {
49
+ input: '0xcbdf2a2b2c7417ce9f10943d44d590058418ac00',
50
+ expected: '0xCbdf2A2b2C7417CE9f10943d44D590058418Ac00',
51
+ },
52
+ ];
53
+ testCases.forEach(({ input, expected }) => {
54
+ expect(checksumAddress(input)).toBe(expected);
55
+ });
56
+ });
57
+ test('is idempotent - checksumming a checksummed address returns the same', () => {
58
+ const checksummed = '0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed';
59
+ expect(checksumAddress(checksummed)).toBe(checksummed);
60
+ expect(checksumAddress(checksumAddress(checksummed))).toBe(checksummed);
61
+ });
62
+ test('handles addresses from contract deployments', () => {
63
+ // Common contract addresses
64
+ const contracts = [
65
+ {
66
+ input: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', // USDC
67
+ expected: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
68
+ },
69
+ {
70
+ input: '0xdac17f958d2ee523a2206206994597c13d831ec7', // USDT
71
+ expected: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
72
+ },
73
+ ];
74
+ contracts.forEach(({ input, expected }) => {
75
+ expect(checksumAddress(input)).toBe(expected);
76
+ });
77
+ });
78
+ test('validates EIP-55 checksumming algorithm', () => {
79
+ // Test vectors from EIP-55
80
+ const eip55TestVectors = [
81
+ '0x52908400098527886E0F7030069857D2E4169EE7',
82
+ '0x8617E340B3D01FA5F11F306F4090FD50E238070D',
83
+ '0xde709f2102306220921060314715629080e2fb77',
84
+ '0x27b1fdb04752bbc536007a920d24acb045561c26',
85
+ ];
86
+ eip55TestVectors.forEach((address) => {
87
+ // These addresses are already checksummed according to EIP-55
88
+ // So checksumming them should return the same address
89
+ const result = checksumAddress(address.toLowerCase());
90
+ expect(result).toBe(address);
91
+ });
92
+ });
93
+ });
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@aboutcircles/sdk-utils",
3
+ "version": "0.1.0",
4
+ "description": "Utility functions for Circles SDK including demurrage calculations and conversions",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "bun build ./src/index.ts --outdir ./dist --format esm --splitting && tsc --emitDeclarationOnly",
16
+ "dev": "tsc --build --watch",
17
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "keywords": [
23
+ "circles",
24
+ "demurrage",
25
+ "converter",
26
+ "utils"
27
+ ],
28
+ "license": "MIT",
29
+ "dependencies": {
30
+ "@aboutcircles/sdk-types": "*",
31
+ "multiformats": "^13.4.1"
32
+ }
33
+ }