@nadohq/shared 0.1.0-alpha.45 → 0.1.0-alpha.47

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 (65) hide show
  1. package/dist/consts/chainEnvToChain.d.cts +32 -33
  2. package/dist/consts/chainEnvToChain.d.ts +32 -33
  3. package/dist/consts/index.d.cts +0 -1
  4. package/dist/consts/index.d.ts +0 -1
  5. package/dist/eip712/eip712ValueTypes.d.cts +1 -1
  6. package/dist/eip712/eip712ValueTypes.d.ts +1 -1
  7. package/dist/encoding/encoding.cjs +21 -0
  8. package/dist/encoding/encoding.cjs.map +1 -1
  9. package/dist/encoding/encoding.d.cts +27 -3
  10. package/dist/encoding/encoding.d.ts +27 -3
  11. package/dist/encoding/encoding.js +24 -1
  12. package/dist/encoding/encoding.js.map +1 -1
  13. package/dist/encoding/index.d.cts +2 -2
  14. package/dist/encoding/index.d.ts +2 -2
  15. package/dist/index.d.cts +3 -3
  16. package/dist/index.d.ts +3 -3
  17. package/dist/types/balanceTypes.d.cts +1 -1
  18. package/dist/types/balanceTypes.d.ts +1 -1
  19. package/dist/types/index.d.cts +1 -1
  20. package/dist/types/index.d.ts +1 -1
  21. package/dist/types/orderAppendixTypes.cjs.map +1 -1
  22. package/dist/types/orderAppendixTypes.d.cts +21 -1
  23. package/dist/types/orderAppendixTypes.d.ts +21 -1
  24. package/dist/types/viemTypes.d.cts +1 -1
  25. package/dist/types/viemTypes.d.ts +1 -1
  26. package/dist/utils/balanceValue.d.cts +1 -1
  27. package/dist/utils/balanceValue.d.ts +1 -1
  28. package/dist/utils/bytes32.d.cts +1 -1
  29. package/dist/utils/bytes32.d.ts +1 -1
  30. package/dist/utils/math/bigDecimal.cjs +4 -3
  31. package/dist/utils/math/bigDecimal.cjs.map +1 -1
  32. package/dist/utils/math/bigDecimal.js +4 -3
  33. package/dist/utils/math/bigDecimal.js.map +1 -1
  34. package/dist/utils/orders/appendix/orderAppendix.test.cjs +54 -0
  35. package/dist/utils/orders/appendix/orderAppendix.test.cjs.map +1 -1
  36. package/dist/utils/orders/appendix/orderAppendix.test.js +54 -0
  37. package/dist/utils/orders/appendix/orderAppendix.test.js.map +1 -1
  38. package/dist/utils/orders/appendix/packOrderAppendix.cjs +5 -1
  39. package/dist/utils/orders/appendix/packOrderAppendix.cjs.map +1 -1
  40. package/dist/utils/orders/appendix/packOrderAppendix.js +5 -1
  41. package/dist/utils/orders/appendix/packOrderAppendix.js.map +1 -1
  42. package/dist/utils/orders/appendix/types.cjs.map +1 -1
  43. package/dist/utils/orders/appendix/types.d.cts +6 -4
  44. package/dist/utils/orders/appendix/types.d.ts +6 -4
  45. package/dist/utils/orders/appendix/unpackOrderAppendix.cjs +19 -3
  46. package/dist/utils/orders/appendix/unpackOrderAppendix.cjs.map +1 -1
  47. package/dist/utils/orders/appendix/unpackOrderAppendix.js +19 -3
  48. package/dist/utils/orders/appendix/unpackOrderAppendix.js.map +1 -1
  49. package/dist/utils/productTypeFilter.d.cts +2 -2
  50. package/dist/utils/productTypeFilter.d.ts +2 -2
  51. package/dist/utils/toPrintableObject.cjs +2 -2
  52. package/dist/utils/toPrintableObject.cjs.map +1 -1
  53. package/dist/utils/toPrintableObject.d.cts +5 -1
  54. package/dist/utils/toPrintableObject.d.ts +5 -1
  55. package/dist/utils/toPrintableObject.js +2 -2
  56. package/dist/utils/toPrintableObject.js.map +1 -1
  57. package/package.json +6 -3
  58. package/src/encoding/encoding.ts +43 -1
  59. package/src/types/orderAppendixTypes.ts +21 -0
  60. package/src/utils/math/bigDecimal.ts +5 -3
  61. package/src/utils/orders/appendix/orderAppendix.test.ts +58 -0
  62. package/src/utils/orders/appendix/packOrderAppendix.ts +5 -1
  63. package/src/utils/orders/appendix/types.ts +7 -5
  64. package/src/utils/orders/appendix/unpackOrderAppendix.ts +18 -2
  65. package/src/utils/toPrintableObject.ts +11 -2
@@ -1,4 +1,3 @@
1
- import * as abitype from 'abitype';
2
1
  import * as viem_chains from 'viem/chains';
3
2
  import * as viem from 'viem';
4
3
  import { ChainEnv } from '../types/ChainEnv.cjs';
@@ -134,7 +133,7 @@ declare const CHAIN_ENV_TO_CHAIN: {
134
133
  gasUsed: bigint;
135
134
  hash: `0x${string}` | null;
136
135
  logsBloom: `0x${string}` | null;
137
- miner: abitype.Address;
136
+ miner: viem.Address;
138
137
  mixHash: viem.Hash;
139
138
  nonce: `0x${string}` | null;
140
139
  number: bigint | null;
@@ -160,14 +159,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
160
159
  format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
161
160
  blockHash: `0x${string}` | null;
162
161
  blockNumber: bigint | null;
163
- from: abitype.Address;
162
+ from: viem.Address;
164
163
  gas: bigint;
165
164
  hash: viem.Hash;
166
165
  input: viem.Hex;
167
166
  nonce: number;
168
167
  r: viem.Hex;
169
168
  s: viem.Hex;
170
- to: abitype.Address | null;
169
+ to: viem.Address | null;
171
170
  transactionIndex: number | null;
172
171
  typeHex: viem.Hex | null;
173
172
  v: bigint;
@@ -187,8 +186,8 @@ declare const CHAIN_ENV_TO_CHAIN: {
187
186
  v: bigint;
188
187
  value: bigint;
189
188
  gas: bigint;
190
- to: abitype.Address | null;
191
- from: abitype.Address;
189
+ to: viem.Address | null;
190
+ from: viem.Address;
192
191
  nonce: number;
193
192
  blockHash: `0x${string}` | null;
194
193
  blockNumber: bigint | null;
@@ -212,14 +211,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
212
211
  } | {
213
212
  blockHash: `0x${string}` | null;
214
213
  blockNumber: bigint | null;
215
- from: abitype.Address;
214
+ from: viem.Address;
216
215
  gas: bigint;
217
216
  hash: viem.Hash;
218
217
  input: viem.Hex;
219
218
  nonce: number;
220
219
  r: viem.Hex;
221
220
  s: viem.Hex;
222
- to: abitype.Address | null;
221
+ to: viem.Address | null;
223
222
  transactionIndex: number | null;
224
223
  typeHex: viem.Hex | null;
225
224
  v: bigint;
@@ -240,14 +239,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
240
239
  } | {
241
240
  blockHash: `0x${string}` | null;
242
241
  blockNumber: bigint | null;
243
- from: abitype.Address;
242
+ from: viem.Address;
244
243
  gas: bigint;
245
244
  hash: viem.Hash;
246
245
  input: viem.Hex;
247
246
  nonce: number;
248
247
  r: viem.Hex;
249
248
  s: viem.Hex;
250
- to: abitype.Address | null;
249
+ to: viem.Address | null;
251
250
  transactionIndex: number | null;
252
251
  typeHex: viem.Hex | null;
253
252
  v: bigint;
@@ -268,14 +267,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
268
267
  } | {
269
268
  blockHash: `0x${string}` | null;
270
269
  blockNumber: bigint | null;
271
- from: abitype.Address;
270
+ from: viem.Address;
272
271
  gas: bigint;
273
272
  hash: viem.Hash;
274
273
  input: viem.Hex;
275
274
  nonce: number;
276
275
  r: viem.Hex;
277
276
  s: viem.Hex;
278
- to: abitype.Address | null;
277
+ to: viem.Address | null;
279
278
  transactionIndex: number | null;
280
279
  typeHex: viem.Hex | null;
281
280
  v: bigint;
@@ -296,14 +295,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
296
295
  } | {
297
296
  blockHash: `0x${string}` | null;
298
297
  blockNumber: bigint | null;
299
- from: abitype.Address;
298
+ from: viem.Address;
300
299
  gas: bigint;
301
300
  hash: viem.Hash;
302
301
  input: viem.Hex;
303
302
  nonce: number;
304
303
  r: viem.Hex;
305
304
  s: viem.Hex;
306
- to: abitype.Address | null;
305
+ to: viem.Address | null;
307
306
  transactionIndex: number | null;
308
307
  typeHex: viem.Hex | null;
309
308
  v: bigint;
@@ -331,16 +330,16 @@ declare const CHAIN_ENV_TO_CHAIN: {
331
330
  blobGasUsed?: bigint | undefined;
332
331
  blockHash: viem.Hash;
333
332
  blockNumber: bigint;
334
- contractAddress: abitype.Address | null | undefined;
333
+ contractAddress: viem.Address | null | undefined;
335
334
  cumulativeGasUsed: bigint;
336
335
  effectiveGasPrice: bigint;
337
- from: abitype.Address;
336
+ from: viem.Address;
338
337
  gasUsed: bigint;
339
338
  logs: viem.Log<bigint, number, false>[];
340
339
  logsBloom: viem.Hex;
341
340
  root?: `0x${string}` | undefined;
342
341
  status: "success" | "reverted";
343
- to: abitype.Address | null;
342
+ to: viem.Address | null;
344
343
  transactionHash: viem.Hash;
345
344
  transactionIndex: number;
346
345
  type: viem.TransactionType;
@@ -443,7 +442,7 @@ declare const CHAIN_ENV_TO_CHAIN: {
443
442
  gasUsed: bigint;
444
443
  hash: `0x${string}` | null;
445
444
  logsBloom: `0x${string}` | null;
446
- miner: abitype.Address;
445
+ miner: viem.Address;
447
446
  mixHash: viem.Hash;
448
447
  nonce: `0x${string}` | null;
449
448
  number: bigint | null;
@@ -469,14 +468,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
469
468
  format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
470
469
  blockHash: `0x${string}` | null;
471
470
  blockNumber: bigint | null;
472
- from: abitype.Address;
471
+ from: viem.Address;
473
472
  gas: bigint;
474
473
  hash: viem.Hash;
475
474
  input: viem.Hex;
476
475
  nonce: number;
477
476
  r: viem.Hex;
478
477
  s: viem.Hex;
479
- to: abitype.Address | null;
478
+ to: viem.Address | null;
480
479
  transactionIndex: number | null;
481
480
  typeHex: viem.Hex | null;
482
481
  v: bigint;
@@ -496,8 +495,8 @@ declare const CHAIN_ENV_TO_CHAIN: {
496
495
  v: bigint;
497
496
  value: bigint;
498
497
  gas: bigint;
499
- to: abitype.Address | null;
500
- from: abitype.Address;
498
+ to: viem.Address | null;
499
+ from: viem.Address;
501
500
  nonce: number;
502
501
  blockHash: `0x${string}` | null;
503
502
  blockNumber: bigint | null;
@@ -521,14 +520,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
521
520
  } | {
522
521
  blockHash: `0x${string}` | null;
523
522
  blockNumber: bigint | null;
524
- from: abitype.Address;
523
+ from: viem.Address;
525
524
  gas: bigint;
526
525
  hash: viem.Hash;
527
526
  input: viem.Hex;
528
527
  nonce: number;
529
528
  r: viem.Hex;
530
529
  s: viem.Hex;
531
- to: abitype.Address | null;
530
+ to: viem.Address | null;
532
531
  transactionIndex: number | null;
533
532
  typeHex: viem.Hex | null;
534
533
  v: bigint;
@@ -549,14 +548,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
549
548
  } | {
550
549
  blockHash: `0x${string}` | null;
551
550
  blockNumber: bigint | null;
552
- from: abitype.Address;
551
+ from: viem.Address;
553
552
  gas: bigint;
554
553
  hash: viem.Hash;
555
554
  input: viem.Hex;
556
555
  nonce: number;
557
556
  r: viem.Hex;
558
557
  s: viem.Hex;
559
- to: abitype.Address | null;
558
+ to: viem.Address | null;
560
559
  transactionIndex: number | null;
561
560
  typeHex: viem.Hex | null;
562
561
  v: bigint;
@@ -577,14 +576,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
577
576
  } | {
578
577
  blockHash: `0x${string}` | null;
579
578
  blockNumber: bigint | null;
580
- from: abitype.Address;
579
+ from: viem.Address;
581
580
  gas: bigint;
582
581
  hash: viem.Hash;
583
582
  input: viem.Hex;
584
583
  nonce: number;
585
584
  r: viem.Hex;
586
585
  s: viem.Hex;
587
- to: abitype.Address | null;
586
+ to: viem.Address | null;
588
587
  transactionIndex: number | null;
589
588
  typeHex: viem.Hex | null;
590
589
  v: bigint;
@@ -605,14 +604,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
605
604
  } | {
606
605
  blockHash: `0x${string}` | null;
607
606
  blockNumber: bigint | null;
608
- from: abitype.Address;
607
+ from: viem.Address;
609
608
  gas: bigint;
610
609
  hash: viem.Hash;
611
610
  input: viem.Hex;
612
611
  nonce: number;
613
612
  r: viem.Hex;
614
613
  s: viem.Hex;
615
- to: abitype.Address | null;
614
+ to: viem.Address | null;
616
615
  transactionIndex: number | null;
617
616
  typeHex: viem.Hex | null;
618
617
  v: bigint;
@@ -640,16 +639,16 @@ declare const CHAIN_ENV_TO_CHAIN: {
640
639
  blobGasUsed?: bigint | undefined;
641
640
  blockHash: viem.Hash;
642
641
  blockNumber: bigint;
643
- contractAddress: abitype.Address | null | undefined;
642
+ contractAddress: viem.Address | null | undefined;
644
643
  cumulativeGasUsed: bigint;
645
644
  effectiveGasPrice: bigint;
646
- from: abitype.Address;
645
+ from: viem.Address;
647
646
  gasUsed: bigint;
648
647
  logs: viem.Log<bigint, number, false>[];
649
648
  logsBloom: viem.Hex;
650
649
  root?: `0x${string}` | undefined;
651
650
  status: "success" | "reverted";
652
- to: abitype.Address | null;
651
+ to: viem.Address | null;
653
652
  transactionHash: viem.Hash;
654
653
  transactionIndex: number;
655
654
  type: viem.TransactionType;
@@ -1,4 +1,3 @@
1
- import * as abitype from 'abitype';
2
1
  import * as viem_chains from 'viem/chains';
3
2
  import * as viem from 'viem';
4
3
  import { ChainEnv } from '../types/ChainEnv.js';
@@ -134,7 +133,7 @@ declare const CHAIN_ENV_TO_CHAIN: {
134
133
  gasUsed: bigint;
135
134
  hash: `0x${string}` | null;
136
135
  logsBloom: `0x${string}` | null;
137
- miner: abitype.Address;
136
+ miner: viem.Address;
138
137
  mixHash: viem.Hash;
139
138
  nonce: `0x${string}` | null;
140
139
  number: bigint | null;
@@ -160,14 +159,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
160
159
  format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
161
160
  blockHash: `0x${string}` | null;
162
161
  blockNumber: bigint | null;
163
- from: abitype.Address;
162
+ from: viem.Address;
164
163
  gas: bigint;
165
164
  hash: viem.Hash;
166
165
  input: viem.Hex;
167
166
  nonce: number;
168
167
  r: viem.Hex;
169
168
  s: viem.Hex;
170
- to: abitype.Address | null;
169
+ to: viem.Address | null;
171
170
  transactionIndex: number | null;
172
171
  typeHex: viem.Hex | null;
173
172
  v: bigint;
@@ -187,8 +186,8 @@ declare const CHAIN_ENV_TO_CHAIN: {
187
186
  v: bigint;
188
187
  value: bigint;
189
188
  gas: bigint;
190
- to: abitype.Address | null;
191
- from: abitype.Address;
189
+ to: viem.Address | null;
190
+ from: viem.Address;
192
191
  nonce: number;
193
192
  blockHash: `0x${string}` | null;
194
193
  blockNumber: bigint | null;
@@ -212,14 +211,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
212
211
  } | {
213
212
  blockHash: `0x${string}` | null;
214
213
  blockNumber: bigint | null;
215
- from: abitype.Address;
214
+ from: viem.Address;
216
215
  gas: bigint;
217
216
  hash: viem.Hash;
218
217
  input: viem.Hex;
219
218
  nonce: number;
220
219
  r: viem.Hex;
221
220
  s: viem.Hex;
222
- to: abitype.Address | null;
221
+ to: viem.Address | null;
223
222
  transactionIndex: number | null;
224
223
  typeHex: viem.Hex | null;
225
224
  v: bigint;
@@ -240,14 +239,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
240
239
  } | {
241
240
  blockHash: `0x${string}` | null;
242
241
  blockNumber: bigint | null;
243
- from: abitype.Address;
242
+ from: viem.Address;
244
243
  gas: bigint;
245
244
  hash: viem.Hash;
246
245
  input: viem.Hex;
247
246
  nonce: number;
248
247
  r: viem.Hex;
249
248
  s: viem.Hex;
250
- to: abitype.Address | null;
249
+ to: viem.Address | null;
251
250
  transactionIndex: number | null;
252
251
  typeHex: viem.Hex | null;
253
252
  v: bigint;
@@ -268,14 +267,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
268
267
  } | {
269
268
  blockHash: `0x${string}` | null;
270
269
  blockNumber: bigint | null;
271
- from: abitype.Address;
270
+ from: viem.Address;
272
271
  gas: bigint;
273
272
  hash: viem.Hash;
274
273
  input: viem.Hex;
275
274
  nonce: number;
276
275
  r: viem.Hex;
277
276
  s: viem.Hex;
278
- to: abitype.Address | null;
277
+ to: viem.Address | null;
279
278
  transactionIndex: number | null;
280
279
  typeHex: viem.Hex | null;
281
280
  v: bigint;
@@ -296,14 +295,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
296
295
  } | {
297
296
  blockHash: `0x${string}` | null;
298
297
  blockNumber: bigint | null;
299
- from: abitype.Address;
298
+ from: viem.Address;
300
299
  gas: bigint;
301
300
  hash: viem.Hash;
302
301
  input: viem.Hex;
303
302
  nonce: number;
304
303
  r: viem.Hex;
305
304
  s: viem.Hex;
306
- to: abitype.Address | null;
305
+ to: viem.Address | null;
307
306
  transactionIndex: number | null;
308
307
  typeHex: viem.Hex | null;
309
308
  v: bigint;
@@ -331,16 +330,16 @@ declare const CHAIN_ENV_TO_CHAIN: {
331
330
  blobGasUsed?: bigint | undefined;
332
331
  blockHash: viem.Hash;
333
332
  blockNumber: bigint;
334
- contractAddress: abitype.Address | null | undefined;
333
+ contractAddress: viem.Address | null | undefined;
335
334
  cumulativeGasUsed: bigint;
336
335
  effectiveGasPrice: bigint;
337
- from: abitype.Address;
336
+ from: viem.Address;
338
337
  gasUsed: bigint;
339
338
  logs: viem.Log<bigint, number, false>[];
340
339
  logsBloom: viem.Hex;
341
340
  root?: `0x${string}` | undefined;
342
341
  status: "success" | "reverted";
343
- to: abitype.Address | null;
342
+ to: viem.Address | null;
344
343
  transactionHash: viem.Hash;
345
344
  transactionIndex: number;
346
345
  type: viem.TransactionType;
@@ -443,7 +442,7 @@ declare const CHAIN_ENV_TO_CHAIN: {
443
442
  gasUsed: bigint;
444
443
  hash: `0x${string}` | null;
445
444
  logsBloom: `0x${string}` | null;
446
- miner: abitype.Address;
445
+ miner: viem.Address;
447
446
  mixHash: viem.Hash;
448
447
  nonce: `0x${string}` | null;
449
448
  number: bigint | null;
@@ -469,14 +468,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
469
468
  format: (args: viem_chains.OpStackRpcTransaction, action?: string | undefined) => ({
470
469
  blockHash: `0x${string}` | null;
471
470
  blockNumber: bigint | null;
472
- from: abitype.Address;
471
+ from: viem.Address;
473
472
  gas: bigint;
474
473
  hash: viem.Hash;
475
474
  input: viem.Hex;
476
475
  nonce: number;
477
476
  r: viem.Hex;
478
477
  s: viem.Hex;
479
- to: abitype.Address | null;
478
+ to: viem.Address | null;
480
479
  transactionIndex: number | null;
481
480
  typeHex: viem.Hex | null;
482
481
  v: bigint;
@@ -496,8 +495,8 @@ declare const CHAIN_ENV_TO_CHAIN: {
496
495
  v: bigint;
497
496
  value: bigint;
498
497
  gas: bigint;
499
- to: abitype.Address | null;
500
- from: abitype.Address;
498
+ to: viem.Address | null;
499
+ from: viem.Address;
501
500
  nonce: number;
502
501
  blockHash: `0x${string}` | null;
503
502
  blockNumber: bigint | null;
@@ -521,14 +520,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
521
520
  } | {
522
521
  blockHash: `0x${string}` | null;
523
522
  blockNumber: bigint | null;
524
- from: abitype.Address;
523
+ from: viem.Address;
525
524
  gas: bigint;
526
525
  hash: viem.Hash;
527
526
  input: viem.Hex;
528
527
  nonce: number;
529
528
  r: viem.Hex;
530
529
  s: viem.Hex;
531
- to: abitype.Address | null;
530
+ to: viem.Address | null;
532
531
  transactionIndex: number | null;
533
532
  typeHex: viem.Hex | null;
534
533
  v: bigint;
@@ -549,14 +548,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
549
548
  } | {
550
549
  blockHash: `0x${string}` | null;
551
550
  blockNumber: bigint | null;
552
- from: abitype.Address;
551
+ from: viem.Address;
553
552
  gas: bigint;
554
553
  hash: viem.Hash;
555
554
  input: viem.Hex;
556
555
  nonce: number;
557
556
  r: viem.Hex;
558
557
  s: viem.Hex;
559
- to: abitype.Address | null;
558
+ to: viem.Address | null;
560
559
  transactionIndex: number | null;
561
560
  typeHex: viem.Hex | null;
562
561
  v: bigint;
@@ -577,14 +576,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
577
576
  } | {
578
577
  blockHash: `0x${string}` | null;
579
578
  blockNumber: bigint | null;
580
- from: abitype.Address;
579
+ from: viem.Address;
581
580
  gas: bigint;
582
581
  hash: viem.Hash;
583
582
  input: viem.Hex;
584
583
  nonce: number;
585
584
  r: viem.Hex;
586
585
  s: viem.Hex;
587
- to: abitype.Address | null;
586
+ to: viem.Address | null;
588
587
  transactionIndex: number | null;
589
588
  typeHex: viem.Hex | null;
590
589
  v: bigint;
@@ -605,14 +604,14 @@ declare const CHAIN_ENV_TO_CHAIN: {
605
604
  } | {
606
605
  blockHash: `0x${string}` | null;
607
606
  blockNumber: bigint | null;
608
- from: abitype.Address;
607
+ from: viem.Address;
609
608
  gas: bigint;
610
609
  hash: viem.Hash;
611
610
  input: viem.Hex;
612
611
  nonce: number;
613
612
  r: viem.Hex;
614
613
  s: viem.Hex;
615
- to: abitype.Address | null;
614
+ to: viem.Address | null;
616
615
  transactionIndex: number | null;
617
616
  typeHex: viem.Hex | null;
618
617
  v: bigint;
@@ -640,16 +639,16 @@ declare const CHAIN_ENV_TO_CHAIN: {
640
639
  blobGasUsed?: bigint | undefined;
641
640
  blockHash: viem.Hash;
642
641
  blockNumber: bigint;
643
- contractAddress: abitype.Address | null | undefined;
642
+ contractAddress: viem.Address | null | undefined;
644
643
  cumulativeGasUsed: bigint;
645
644
  effectiveGasPrice: bigint;
646
- from: abitype.Address;
645
+ from: viem.Address;
647
646
  gasUsed: bigint;
648
647
  logs: viem.Log<bigint, number, false>[];
649
648
  logsBloom: viem.Hex;
650
649
  root?: `0x${string}` | undefined;
651
650
  status: "success" | "reverted";
652
- to: abitype.Address | null;
651
+ to: viem.Address | null;
653
652
  transactionHash: viem.Hash;
654
653
  transactionIndex: number;
655
654
  type: viem.TransactionType;
@@ -1,6 +1,5 @@
1
1
  export { CHAIN_ENV_TO_CHAIN, CHAIN_ID_TO_CHAIN_ENV } from './chainEnvToChain.cjs';
2
2
  export { NLP_PRODUCT_ID, QUOTE_PRODUCT_ID } from './productIds.cjs';
3
- import 'abitype';
4
3
  import 'viem/chains';
5
4
  import 'viem';
6
5
  import '../types/ChainEnv.cjs';
@@ -1,6 +1,5 @@
1
1
  export { CHAIN_ENV_TO_CHAIN, CHAIN_ID_TO_CHAIN_ENV } from './chainEnvToChain.js';
2
2
  export { NLP_PRODUCT_ID, QUOTE_PRODUCT_ID } from './productIds.js';
3
- import 'abitype';
4
3
  import 'viem/chains';
5
4
  import 'viem';
6
5
  import '../types/ChainEnv.js';
@@ -1,6 +1,6 @@
1
1
  import { Hex } from 'viem';
2
2
  import { BigDecimalish } from '../utils/math/bigDecimal.cjs';
3
- import { EIP712WithdrawCollateralParams, EIP712LiquidateSubaccountParams, EIP712OrderParams, EIP712ListTriggerOrdersParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LinkSignerParams, EIP712TransferQuoteParams, EIP712LeaderboardAuthenticationParams, EIP712MintNlpParams, EIP712BurnNlpParams } from './signatureParamTypes.cjs';
3
+ import { EIP712BurnNlpParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712CancelOrdersParams, EIP712OrderParams, EIP712CancelProductOrdersParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams } from './signatureParamTypes.cjs';
4
4
  import 'bignumber.js';
5
5
  import '../types/subaccountTypes.cjs';
6
6
  import '../types/bytes.cjs';
@@ -1,6 +1,6 @@
1
1
  import { Hex } from 'viem';
2
2
  import { BigDecimalish } from '../utils/math/bigDecimal.js';
3
- import { EIP712WithdrawCollateralParams, EIP712LiquidateSubaccountParams, EIP712OrderParams, EIP712ListTriggerOrdersParams, EIP712CancelOrdersParams, EIP712CancelProductOrdersParams, EIP712LinkSignerParams, EIP712TransferQuoteParams, EIP712LeaderboardAuthenticationParams, EIP712MintNlpParams, EIP712BurnNlpParams } from './signatureParamTypes.js';
3
+ import { EIP712BurnNlpParams, EIP712LeaderboardAuthenticationParams, EIP712LinkSignerParams, EIP712LiquidateSubaccountParams, EIP712ListTriggerOrdersParams, EIP712MintNlpParams, EIP712CancelOrdersParams, EIP712OrderParams, EIP712CancelProductOrdersParams, EIP712TransferQuoteParams, EIP712WithdrawCollateralParams } from './signatureParamTypes.js';
4
4
  import 'bignumber.js';
5
5
  import '../types/subaccountTypes.js';
6
6
  import '../types/bytes.js';
@@ -20,12 +20,21 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/encoding/encoding.ts
21
21
  var encoding_exports = {};
22
22
  __export(encoding_exports, {
23
+ SlowModeTxType: () => SlowModeTxType,
24
+ encodeClaimBuilderFeeTx: () => encodeClaimBuilderFeeTx,
23
25
  encodeSignedOrder: () => encodeSignedOrder,
24
26
  encodeSignedWithdrawCollateralTx: () => encodeSignedWithdrawCollateralTx
25
27
  });
26
28
  module.exports = __toCommonJS(encoding_exports);
27
29
  var import_viem = require("viem");
28
30
  var import_utils = require("../utils/index.cjs");
31
+ var SlowModeTxType = /* @__PURE__ */ ((SlowModeTxType2) => {
32
+ SlowModeTxType2[SlowModeTxType2["DepositCollateral"] = 1] = "DepositCollateral";
33
+ SlowModeTxType2[SlowModeTxType2["WithdrawCollateral"] = 2] = "WithdrawCollateral";
34
+ SlowModeTxType2[SlowModeTxType2["LinkSigner"] = 13] = "LinkSigner";
35
+ SlowModeTxType2[SlowModeTxType2["ClaimBuilderFee"] = 31] = "ClaimBuilderFee";
36
+ return SlowModeTxType2;
37
+ })(SlowModeTxType || {});
29
38
  function encodeSignedWithdrawCollateralTx(signed) {
30
39
  return (0, import_viem.encodeAbiParameters)(
31
40
  (0, import_viem.parseAbiParameters)(
@@ -65,8 +74,20 @@ function encodeSignedOrder(signed) {
65
74
  ]
66
75
  );
67
76
  }
77
+ function encodeClaimBuilderFeeTx(params) {
78
+ const txBytes = (0, import_viem.encodeAbiParameters)(
79
+ (0, import_viem.parseAbiParameters)("bytes32 sender, uint32 builderId"),
80
+ [params.sender, params.builderId]
81
+ );
82
+ return (0, import_viem.encodePacked)(
83
+ ["uint8", "bytes"],
84
+ [31 /* ClaimBuilderFee */, txBytes]
85
+ );
86
+ }
68
87
  // Annotate the CommonJS export names for ESM import in node:
69
88
  0 && (module.exports = {
89
+ SlowModeTxType,
90
+ encodeClaimBuilderFeeTx,
70
91
  encodeSignedOrder,
71
92
  encodeSignedWithdrawCollateralTx
72
93
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/encoding/encoding.ts"],"sourcesContent":["import { encodeAbiParameters, parseAbiParameters } from 'viem';\nimport {\n EIP712WithdrawCollateralParams,\n SignedEIP712OrderParams,\n SignedTx,\n} from '../eip712';\nimport { addDecimals, toBigInt } from '../utils';\n\nexport function encodeSignedWithdrawCollateralTx(\n signed: SignedTx<EIP712WithdrawCollateralParams>,\n) {\n return encodeAbiParameters(\n parseAbiParameters(\n '(tuple(address sender, string subaccountName, uint32 productId, uint128 amount, uint64 nonce), bytes signature)',\n ),\n [\n [\n [\n signed.tx.subaccountOwner,\n signed.tx.subaccountName,\n signed.tx.productId,\n signed.tx.amount,\n signed.tx.nonce,\n ],\n signed.signature,\n ],\n ],\n );\n}\n\nexport function encodeSignedOrder(signed: SignedEIP712OrderParams) {\n return encodeAbiParameters(\n parseAbiParameters(\n '(tuple(tuple(address sender, string subaccountName, int128 priceX18, int128 amount, uint64 expiration, uint64 nonce), bytes signature))',\n ),\n [\n [\n [\n signed.order.subaccountOwner,\n signed.order.subaccountName,\n toBigInt(addDecimals(signed.order.price)),\n signed.order.amount,\n signed.order.expiration,\n signed.order.nonce,\n ],\n signed.signature,\n ],\n ],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwD;AAMxD,mBAAsC;AAE/B,SAAS,iCACd,QACA;AACA,aAAO;AAAA,QACL;AAAA,MACE;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE;AAAA,UACE,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,QACZ;AAAA,QACA,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAEO,SAAS,kBAAkB,QAAiC;AACjE,aAAO;AAAA,QACL;AAAA,MACE;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE;AAAA,UACE,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,cACb,2BAAS,0BAAY,OAAO,MAAM,KAAK,CAAC;AAAA,UACxC,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,QACf;AAAA,QACA,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../../src/encoding/encoding.ts"],"sourcesContent":["import {\n encodeAbiParameters,\n encodePacked,\n parseAbiParameters,\n type Hex,\n} from 'viem';\nimport {\n EIP712WithdrawCollateralParams,\n SignedEIP712OrderParams,\n SignedTx,\n} from '../eip712';\nimport { addDecimals, toBigInt } from '../utils';\n\n/**\n * Transaction type identifiers for slow mode transactions.\n */\nexport enum SlowModeTxType {\n DepositCollateral = 1,\n WithdrawCollateral = 2,\n LinkSigner = 13,\n ClaimBuilderFee = 31,\n}\n\nexport function encodeSignedWithdrawCollateralTx(\n signed: SignedTx<EIP712WithdrawCollateralParams>,\n) {\n return encodeAbiParameters(\n parseAbiParameters(\n '(tuple(address sender, string subaccountName, uint32 productId, uint128 amount, uint64 nonce), bytes signature)',\n ),\n [\n [\n [\n signed.tx.subaccountOwner,\n signed.tx.subaccountName,\n signed.tx.productId,\n signed.tx.amount,\n signed.tx.nonce,\n ],\n signed.signature,\n ],\n ],\n );\n}\n\nexport function encodeSignedOrder(signed: SignedEIP712OrderParams) {\n return encodeAbiParameters(\n parseAbiParameters(\n '(tuple(tuple(address sender, string subaccountName, int128 priceX18, int128 amount, uint64 expiration, uint64 nonce), bytes signature))',\n ),\n [\n [\n [\n signed.order.subaccountOwner,\n signed.order.subaccountName,\n toBigInt(addDecimals(signed.order.price)),\n signed.order.amount,\n signed.order.expiration,\n signed.order.nonce,\n ],\n signed.signature,\n ],\n ],\n );\n}\n\nexport interface ClaimBuilderFeeParams {\n /** The sender subaccount as bytes32 */\n sender: Hex;\n /** The builder ID to claim fees for */\n builderId: number;\n}\n\n/**\n * Encodes a ClaimBuilderFee slow mode transaction.\n *\n * Format: [tx_type_byte] + [abi_encoded_params]\n *\n * @param params - The claim builder fee parameters\n * @returns The encoded transaction bytes ready to submit via endpoint.submitSlowModeTransaction\n */\nexport function encodeClaimBuilderFeeTx(params: ClaimBuilderFeeParams): Hex {\n const txBytes = encodeAbiParameters(\n parseAbiParameters('bytes32 sender, uint32 builderId'),\n [params.sender, params.builderId],\n );\n\n return encodePacked(\n ['uint8', 'bytes'],\n [SlowModeTxType.ClaimBuilderFee, txBytes],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKO;AAMP,mBAAsC;AAK/B,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gCAAA,uBAAoB,KAApB;AACA,EAAAA,gCAAA,wBAAqB,KAArB;AACA,EAAAA,gCAAA,gBAAa,MAAb;AACA,EAAAA,gCAAA,qBAAkB,MAAlB;AAJU,SAAAA;AAAA,GAAA;AAOL,SAAS,iCACd,QACA;AACA,aAAO;AAAA,QACL;AAAA,MACE;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE;AAAA,UACE,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,UACV,OAAO,GAAG;AAAA,QACZ;AAAA,QACA,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAEO,SAAS,kBAAkB,QAAiC;AACjE,aAAO;AAAA,QACL;AAAA,MACE;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,QACE;AAAA,UACE,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,cACb,2BAAS,0BAAY,OAAO,MAAM,KAAK,CAAC;AAAA,UACxC,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,UACb,OAAO,MAAM;AAAA,QACf;AAAA,QACA,OAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AACF;AAiBO,SAAS,wBAAwB,QAAoC;AAC1E,QAAM,cAAU;AAAA,QACd,gCAAmB,kCAAkC;AAAA,IACrD,CAAC,OAAO,QAAQ,OAAO,SAAS;AAAA,EAClC;AAEA,aAAO;AAAA,IACL,CAAC,SAAS,OAAO;AAAA,IACjB,CAAC,0BAAgC,OAAO;AAAA,EAC1C;AACF;","names":["SlowModeTxType"]}
@@ -1,11 +1,35 @@
1
- import { SignedTx, EIP712WithdrawCollateralParams, SignedEIP712OrderParams } from '../eip712/signatureParamTypes.cjs';
2
- import 'viem';
1
+ import { Hex } from 'viem';
2
+ import { SignedEIP712OrderParams, SignedTx, EIP712WithdrawCollateralParams } from '../eip712/signatureParamTypes.cjs';
3
3
  import '../types/subaccountTypes.cjs';
4
4
  import '../types/bytes.cjs';
5
5
  import '../utils/math/bigDecimal.cjs';
6
6
  import 'bignumber.js';
7
7
 
8
+ /**
9
+ * Transaction type identifiers for slow mode transactions.
10
+ */
11
+ declare enum SlowModeTxType {
12
+ DepositCollateral = 1,
13
+ WithdrawCollateral = 2,
14
+ LinkSigner = 13,
15
+ ClaimBuilderFee = 31
16
+ }
8
17
  declare function encodeSignedWithdrawCollateralTx(signed: SignedTx<EIP712WithdrawCollateralParams>): `0x${string}`;
9
18
  declare function encodeSignedOrder(signed: SignedEIP712OrderParams): `0x${string}`;
19
+ interface ClaimBuilderFeeParams {
20
+ /** The sender subaccount as bytes32 */
21
+ sender: Hex;
22
+ /** The builder ID to claim fees for */
23
+ builderId: number;
24
+ }
25
+ /**
26
+ * Encodes a ClaimBuilderFee slow mode transaction.
27
+ *
28
+ * Format: [tx_type_byte] + [abi_encoded_params]
29
+ *
30
+ * @param params - The claim builder fee parameters
31
+ * @returns The encoded transaction bytes ready to submit via endpoint.submitSlowModeTransaction
32
+ */
33
+ declare function encodeClaimBuilderFeeTx(params: ClaimBuilderFeeParams): Hex;
10
34
 
11
- export { encodeSignedOrder, encodeSignedWithdrawCollateralTx };
35
+ export { type ClaimBuilderFeeParams, SlowModeTxType, encodeClaimBuilderFeeTx, encodeSignedOrder, encodeSignedWithdrawCollateralTx };