@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.
- package/dist/consts/chainEnvToChain.d.cts +32 -33
- package/dist/consts/chainEnvToChain.d.ts +32 -33
- package/dist/consts/index.d.cts +0 -1
- package/dist/consts/index.d.ts +0 -1
- package/dist/eip712/eip712ValueTypes.d.cts +1 -1
- package/dist/eip712/eip712ValueTypes.d.ts +1 -1
- package/dist/encoding/encoding.cjs +21 -0
- package/dist/encoding/encoding.cjs.map +1 -1
- package/dist/encoding/encoding.d.cts +27 -3
- package/dist/encoding/encoding.d.ts +27 -3
- package/dist/encoding/encoding.js +24 -1
- package/dist/encoding/encoding.js.map +1 -1
- package/dist/encoding/index.d.cts +2 -2
- package/dist/encoding/index.d.ts +2 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/types/balanceTypes.d.cts +1 -1
- package/dist/types/balanceTypes.d.ts +1 -1
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/orderAppendixTypes.cjs.map +1 -1
- package/dist/types/orderAppendixTypes.d.cts +21 -1
- package/dist/types/orderAppendixTypes.d.ts +21 -1
- package/dist/types/viemTypes.d.cts +1 -1
- package/dist/types/viemTypes.d.ts +1 -1
- package/dist/utils/balanceValue.d.cts +1 -1
- package/dist/utils/balanceValue.d.ts +1 -1
- package/dist/utils/bytes32.d.cts +1 -1
- package/dist/utils/bytes32.d.ts +1 -1
- package/dist/utils/math/bigDecimal.cjs +4 -3
- package/dist/utils/math/bigDecimal.cjs.map +1 -1
- package/dist/utils/math/bigDecimal.js +4 -3
- package/dist/utils/math/bigDecimal.js.map +1 -1
- package/dist/utils/orders/appendix/orderAppendix.test.cjs +54 -0
- package/dist/utils/orders/appendix/orderAppendix.test.cjs.map +1 -1
- package/dist/utils/orders/appendix/orderAppendix.test.js +54 -0
- package/dist/utils/orders/appendix/orderAppendix.test.js.map +1 -1
- package/dist/utils/orders/appendix/packOrderAppendix.cjs +5 -1
- package/dist/utils/orders/appendix/packOrderAppendix.cjs.map +1 -1
- package/dist/utils/orders/appendix/packOrderAppendix.js +5 -1
- package/dist/utils/orders/appendix/packOrderAppendix.js.map +1 -1
- package/dist/utils/orders/appendix/types.cjs.map +1 -1
- package/dist/utils/orders/appendix/types.d.cts +6 -4
- package/dist/utils/orders/appendix/types.d.ts +6 -4
- package/dist/utils/orders/appendix/unpackOrderAppendix.cjs +19 -3
- package/dist/utils/orders/appendix/unpackOrderAppendix.cjs.map +1 -1
- package/dist/utils/orders/appendix/unpackOrderAppendix.js +19 -3
- package/dist/utils/orders/appendix/unpackOrderAppendix.js.map +1 -1
- package/dist/utils/productTypeFilter.d.cts +2 -2
- package/dist/utils/productTypeFilter.d.ts +2 -2
- package/dist/utils/toPrintableObject.cjs +2 -2
- package/dist/utils/toPrintableObject.cjs.map +1 -1
- package/dist/utils/toPrintableObject.d.cts +5 -1
- package/dist/utils/toPrintableObject.d.ts +5 -1
- package/dist/utils/toPrintableObject.js +2 -2
- package/dist/utils/toPrintableObject.js.map +1 -1
- package/package.json +6 -3
- package/src/encoding/encoding.ts +43 -1
- package/src/types/orderAppendixTypes.ts +21 -0
- package/src/utils/math/bigDecimal.ts +5 -3
- package/src/utils/orders/appendix/orderAppendix.test.ts +58 -0
- package/src/utils/orders/appendix/packOrderAppendix.ts +5 -1
- package/src/utils/orders/appendix/types.ts +7 -5
- package/src/utils/orders/appendix/unpackOrderAppendix.ts +18 -2
- 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:
|
|
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:
|
|
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:
|
|
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:
|
|
191
|
-
from:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
333
|
+
contractAddress: viem.Address | null | undefined;
|
|
335
334
|
cumulativeGasUsed: bigint;
|
|
336
335
|
effectiveGasPrice: bigint;
|
|
337
|
-
from:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
500
|
-
from:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
642
|
+
contractAddress: viem.Address | null | undefined;
|
|
644
643
|
cumulativeGasUsed: bigint;
|
|
645
644
|
effectiveGasPrice: bigint;
|
|
646
|
-
from:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
191
|
-
from:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
333
|
+
contractAddress: viem.Address | null | undefined;
|
|
335
334
|
cumulativeGasUsed: bigint;
|
|
336
335
|
effectiveGasPrice: bigint;
|
|
337
|
-
from:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
500
|
-
from:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
642
|
+
contractAddress: viem.Address | null | undefined;
|
|
644
643
|
cumulativeGasUsed: bigint;
|
|
645
644
|
effectiveGasPrice: bigint;
|
|
646
|
-
from:
|
|
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:
|
|
651
|
+
to: viem.Address | null;
|
|
653
652
|
transactionHash: viem.Hash;
|
|
654
653
|
transactionIndex: number;
|
|
655
654
|
type: viem.TransactionType;
|
package/dist/consts/index.d.cts
CHANGED
package/dist/consts/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Hex } from 'viem';
|
|
2
2
|
import { BigDecimalish } from '../utils/math/bigDecimal.cjs';
|
|
3
|
-
import {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
2
|
-
import '
|
|
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 };
|