viem 0.0.0-main.20240403T065700 → 0.0.0-main.20240403T202700
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/_cjs/errors/version.js +1 -1
- package/_cjs/utils/formatters/transactionRequest.js +15 -4
- package/_cjs/utils/formatters/transactionRequest.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/utils/formatters/transactionRequest.js +15 -4
- package/_esm/utils/formatters/transactionRequest.js.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts.map +1 -1
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/utils/formatters/transactionRequest.ts +13 -6
package/_cjs/errors/version.js
CHANGED
@@ -10,10 +10,19 @@ exports.rpcTransactionType = {
|
|
10
10
|
eip4844: '0x3',
|
11
11
|
};
|
12
12
|
function formatTransactionRequest(request) {
|
13
|
-
const rpcRequest = {
|
14
|
-
if (typeof request.
|
15
|
-
|
16
|
-
|
13
|
+
const rpcRequest = {};
|
14
|
+
if (typeof request.accessList !== 'undefined')
|
15
|
+
rpcRequest.accessList = request.accessList;
|
16
|
+
if (typeof request.blobs !== 'undefined') {
|
17
|
+
if (typeof request.blobs[0] !== 'string')
|
18
|
+
rpcRequest.blobs = request.blobs.map((x) => (0, toHex_js_1.bytesToHex)(x));
|
19
|
+
else
|
20
|
+
rpcRequest.blobs = request.blobs;
|
21
|
+
}
|
22
|
+
if (typeof request.data !== 'undefined')
|
23
|
+
rpcRequest.data = request.data;
|
24
|
+
if (typeof request.from !== 'undefined')
|
25
|
+
rpcRequest.from = request.from;
|
17
26
|
if (typeof request.gas !== 'undefined')
|
18
27
|
rpcRequest.gas = (0, toHex_js_1.numberToHex)(request.gas);
|
19
28
|
if (typeof request.gasPrice !== 'undefined')
|
@@ -26,6 +35,8 @@ function formatTransactionRequest(request) {
|
|
26
35
|
rpcRequest.maxPriorityFeePerGas = (0, toHex_js_1.numberToHex)(request.maxPriorityFeePerGas);
|
27
36
|
if (typeof request.nonce !== 'undefined')
|
28
37
|
rpcRequest.nonce = (0, toHex_js_1.numberToHex)(request.nonce);
|
38
|
+
if (typeof request.to !== 'undefined')
|
39
|
+
rpcRequest.to = request.to;
|
29
40
|
if (typeof request.type !== 'undefined')
|
30
41
|
rpcRequest.type = exports.rpcTransactionType[request.type];
|
31
42
|
if (typeof request.value !== 'undefined')
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionRequest.js","sourceRoot":"","sources":["../../../utils/formatters/transactionRequest.ts"],"names":[],"mappings":";;;AASA,mDAA8D;AAC9D,iDAA+E;AAUlE,QAAA,kBAAkB,GAAG;IAChC,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;CACN,CAAA;AAIV,SAAgB,wBAAwB,CACtC,OAAyC;IAEzC,MAAM,UAAU,GAAG,
|
1
|
+
{"version":3,"file":"transactionRequest.js","sourceRoot":"","sources":["../../../utils/formatters/transactionRequest.ts"],"names":[],"mappings":";;;AASA,mDAA8D;AAC9D,iDAA+E;AAUlE,QAAA,kBAAkB,GAAG;IAChC,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;CACN,CAAA;AAIV,SAAgB,wBAAwB,CACtC,OAAyC;IAEzC,MAAM,UAAU,GAAG,EAA2B,CAAA;IAE9C,IAAI,OAAO,OAAO,CAAC,UAAU,KAAK,WAAW;QAC3C,UAAU,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;IAC5C,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;QACzC,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ;YACtC,UAAU,CAAC,KAAK,GAAI,OAAO,CAAC,KAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE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AO,CAAC,IAAI,KAAK,WAAW;QACrC,UAAU,CAAC,IAAI,GAAG,0BAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACpD,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW;QACtC,UAAU,CAAC,KAAK,GAAG,IAAA,sBAAW,EAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAE/C,OAAO,UAAU,CAAA;AACnB,CAAC;AAnCD,4DAmCC;AAMY,QAAA,wBAAwB,GAAiB,IAAA,8BAAe,EACnE,oBAAoB,EACpB,wBAAwB,CACzB,CAAA"}
|
package/_esm/errors/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const version = '0.0.0-main.
|
1
|
+
export const version = '0.0.0-main.20240403T202700';
|
2
2
|
//# sourceMappingURL=version.js.map
|
@@ -7,10 +7,19 @@ export const rpcTransactionType = {
|
|
7
7
|
eip4844: '0x3',
|
8
8
|
};
|
9
9
|
export function formatTransactionRequest(request) {
|
10
|
-
const rpcRequest = {
|
11
|
-
if (typeof request.
|
12
|
-
|
13
|
-
|
10
|
+
const rpcRequest = {};
|
11
|
+
if (typeof request.accessList !== 'undefined')
|
12
|
+
rpcRequest.accessList = request.accessList;
|
13
|
+
if (typeof request.blobs !== 'undefined') {
|
14
|
+
if (typeof request.blobs[0] !== 'string')
|
15
|
+
rpcRequest.blobs = request.blobs.map((x) => bytesToHex(x));
|
16
|
+
else
|
17
|
+
rpcRequest.blobs = request.blobs;
|
18
|
+
}
|
19
|
+
if (typeof request.data !== 'undefined')
|
20
|
+
rpcRequest.data = request.data;
|
21
|
+
if (typeof request.from !== 'undefined')
|
22
|
+
rpcRequest.from = request.from;
|
14
23
|
if (typeof request.gas !== 'undefined')
|
15
24
|
rpcRequest.gas = numberToHex(request.gas);
|
16
25
|
if (typeof request.gasPrice !== 'undefined')
|
@@ -23,6 +32,8 @@ export function formatTransactionRequest(request) {
|
|
23
32
|
rpcRequest.maxPriorityFeePerGas = numberToHex(request.maxPriorityFeePerGas);
|
24
33
|
if (typeof request.nonce !== 'undefined')
|
25
34
|
rpcRequest.nonce = numberToHex(request.nonce);
|
35
|
+
if (typeof request.to !== 'undefined')
|
36
|
+
rpcRequest.to = request.to;
|
26
37
|
if (typeof request.type !== 'undefined')
|
27
38
|
rpcRequest.type = rpcTransactionType[request.type];
|
28
39
|
if (typeof request.value !== 'undefined')
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionRequest.js","sourceRoot":"","sources":["../../../utils/formatters/transactionRequest.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAiC,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAU/E,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;CACN,CAAA;AAIV,MAAM,UAAU,wBAAwB,CACtC,OAAyC;IAEzC,MAAM,UAAU,GAAG,
|
1
|
+
{"version":3,"file":"transactionRequest.js","sourceRoot":"","sources":["../../../utils/formatters/transactionRequest.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAiC,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAU/E,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,KAAK;CACN,CAAA;AAIV,MAAM,UAAU,wBAAwB,CACtC,OAAyC;IAEzC,MAAM,UAAU,GAAG,EAA2B,CAAA;IAE9C,IAAI,OAAO,OAAO,CAAC,UAAU,KAAK,WAAW;QAC3C,UAAU,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;IAC5C,IAAI,OAAO,OAAO,CAAC,KAAK,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,CAAA;IAC/C,IAAI,OAAO,OAAO,CAAC,EAAE,KAAK,WAAW;QAAE,UAAU,CAAC,EAAE,GAAG,OAAO,CAAC,EAAE,CAAA;IACjE,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,WAAW;QACrC,UAAU,CAAC,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACpD,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,WAAW;QACtC,UAAU,CAAC,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IAE/C,OAAO,UAAU,CAAA;AACnB,CAAC;AAMD,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAC,eAAe,CACnE,oBAAoB,EACpB,wBAAwB,CACzB,CAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "0.0.0-main.
|
1
|
+
export declare const version = "0.0.0-main.20240403T202700";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionRequest.d.ts","sourceRoot":"","sources":["../../../utils/formatters/transactionRequest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EACV,KAAK,EACL,+BAA+B,EAChC,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,OAAO,EAAE,KAAK,wBAAwB,EAAmB,MAAM,gBAAgB,CAAA;AAE/E,MAAM,MAAM,2BAA2B,CACrC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAClD,+BAA+B,CACjC,MAAM,EACN,oBAAoB,EACpB,kBAAkB,CACn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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGpC,CAAA"}
|
package/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '0.0.0-main.
|
1
|
+
export const version = '0.0.0-main.20240403T202700'
|
package/package.json
CHANGED
@@ -30,13 +30,19 @@ export type FormatTransactionRequestErrorType = ErrorType
|
|
30
30
|
export function formatTransactionRequest(
|
31
31
|
request: ExactPartial<TransactionRequest>,
|
32
32
|
) {
|
33
|
-
const rpcRequest = {
|
33
|
+
const rpcRequest = {} as RpcTransactionRequest
|
34
34
|
|
35
|
-
if (
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
if (typeof request.accessList !== 'undefined')
|
36
|
+
rpcRequest.accessList = request.accessList
|
37
|
+
if (typeof request.blobs !== 'undefined') {
|
38
|
+
if (typeof request.blobs[0] !== 'string')
|
39
|
+
rpcRequest.blobs = (request.blobs as ByteArray[]).map((x) =>
|
40
|
+
bytesToHex(x),
|
41
|
+
)
|
42
|
+
else rpcRequest.blobs = request.blobs
|
43
|
+
}
|
44
|
+
if (typeof request.data !== 'undefined') rpcRequest.data = request.data
|
45
|
+
if (typeof request.from !== 'undefined') rpcRequest.from = request.from
|
40
46
|
if (typeof request.gas !== 'undefined')
|
41
47
|
rpcRequest.gas = numberToHex(request.gas)
|
42
48
|
if (typeof request.gasPrice !== 'undefined')
|
@@ -49,6 +55,7 @@ export function formatTransactionRequest(
|
|
49
55
|
rpcRequest.maxPriorityFeePerGas = numberToHex(request.maxPriorityFeePerGas)
|
50
56
|
if (typeof request.nonce !== 'undefined')
|
51
57
|
rpcRequest.nonce = numberToHex(request.nonce)
|
58
|
+
if (typeof request.to !== 'undefined') rpcRequest.to = request.to
|
52
59
|
if (typeof request.type !== 'undefined')
|
53
60
|
rpcRequest.type = rpcTransactionType[request.type]
|
54
61
|
if (typeof request.value !== 'undefined')
|