@gardenfi/utils 2.1.0 → 2.1.2

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 (207) hide show
  1. package/dist/index100.cjs +1 -1
  2. package/dist/index100.js +3 -79
  3. package/dist/index101.cjs +1 -1
  4. package/dist/index101.js +10 -17
  5. package/dist/index102.cjs +1 -1
  6. package/dist/index102.js +19 -11
  7. package/dist/index103.cjs +1 -1
  8. package/dist/index103.js +8 -19
  9. package/dist/index104.cjs +1 -1
  10. package/dist/index104.js +16 -10
  11. package/dist/index105.cjs +1 -1
  12. package/dist/index105.js +638 -33
  13. package/dist/index106.cjs +1 -1
  14. package/dist/index106.js +173 -5
  15. package/dist/index107.cjs +1 -1
  16. package/dist/index107.js +12 -10
  17. package/dist/index108.cjs +1 -1
  18. package/dist/index108.js +128 -2
  19. package/dist/index109.cjs +2 -1
  20. package/dist/index109.js +3 -21
  21. package/dist/index110.cjs +1 -1
  22. package/dist/index110.js +2 -128
  23. package/dist/index111.cjs +1 -1
  24. package/dist/index111.js +2 -7
  25. package/dist/index112.cjs +1 -1
  26. package/dist/index112.js +38 -2
  27. package/dist/index113.cjs +1 -1
  28. package/dist/index113.js +34 -33
  29. package/dist/index114.cjs +1 -1
  30. package/dist/index114.js +5 -5
  31. package/dist/index115.cjs +1 -2
  32. package/dist/index115.js +11 -3
  33. package/dist/index116.cjs +1 -1
  34. package/dist/index116.js +6 -18
  35. package/dist/index117.cjs +1 -1
  36. package/dist/index117.js +15 -638
  37. package/dist/index118.cjs +1 -1
  38. package/dist/index118.js +5 -173
  39. package/dist/index15.cjs +1 -1
  40. package/dist/index15.js +2 -2
  41. package/dist/index18.cjs +1 -1
  42. package/dist/index18.js +11 -11
  43. package/dist/index19.cjs +1 -1
  44. package/dist/index19.js +9 -9
  45. package/dist/index20.cjs +1 -1
  46. package/dist/index20.js +18 -17
  47. package/dist/index21.cjs +16 -1
  48. package/dist/index21.js +112 -30
  49. package/dist/index22.cjs +1 -16
  50. package/dist/index22.js +30 -113
  51. package/dist/index23.cjs +1 -1
  52. package/dist/index23.js +41 -17
  53. package/dist/index24.cjs +1 -1
  54. package/dist/index24.js +44 -6
  55. package/dist/index25.cjs +1 -1
  56. package/dist/index25.js +24 -44
  57. package/dist/index26.cjs +1 -1
  58. package/dist/index26.js +6 -21
  59. package/dist/index27.cjs +1 -1
  60. package/dist/index27.js +13 -8
  61. package/dist/index28.cjs +1 -1
  62. package/dist/index28.js +15 -31
  63. package/dist/index29.cjs +1 -1
  64. package/dist/index29.js +5 -26
  65. package/dist/index30.cjs +1 -2
  66. package/dist/index30.js +13 -65
  67. package/dist/index31.cjs +1 -1
  68. package/dist/index31.js +10 -51
  69. package/dist/index32.cjs +1 -1
  70. package/dist/index32.js +12 -12
  71. package/dist/index33.cjs +1 -1
  72. package/dist/index33.js +11 -24
  73. package/dist/index34.cjs +1 -1
  74. package/dist/index34.js +13 -75
  75. package/dist/index35.cjs +1 -1
  76. package/dist/index35.js +2 -2
  77. package/dist/index36.cjs +1 -1
  78. package/dist/index36.js +55 -7
  79. package/dist/index37.cjs +1 -1
  80. package/dist/index37.js +16 -32
  81. package/dist/index38.cjs +1 -1
  82. package/dist/index38.js +5 -15
  83. package/dist/index39.cjs +1 -1
  84. package/dist/index39.js +9 -2
  85. package/dist/index40.cjs +1 -1
  86. package/dist/index40.js +171 -8
  87. package/dist/index41.cjs +1 -1
  88. package/dist/index41.js +102 -19
  89. package/dist/index42.cjs +1 -1
  90. package/dist/index42.js +21 -41
  91. package/dist/index43.cjs +1 -1
  92. package/dist/index43.js +17 -25
  93. package/dist/index44.cjs +1 -1
  94. package/dist/index44.js +7 -6
  95. package/dist/index45.cjs +1 -1
  96. package/dist/index45.js +20 -12
  97. package/dist/index46.cjs +1 -1
  98. package/dist/index46.js +8 -15
  99. package/dist/index47.cjs +1 -1
  100. package/dist/index47.js +31 -5
  101. package/dist/index48.cjs +1 -1
  102. package/dist/index48.js +26 -13
  103. package/dist/index49.cjs +2 -1
  104. package/dist/index49.js +65 -10
  105. package/dist/index50.cjs +1 -1
  106. package/dist/index50.js +51 -12
  107. package/dist/index51.cjs +1 -1
  108. package/dist/index51.js +12 -11
  109. package/dist/index52.cjs +1 -1
  110. package/dist/index52.js +24 -13
  111. package/dist/index53.cjs +1 -1
  112. package/dist/index53.js +75 -55
  113. package/dist/index54.cjs +1 -1
  114. package/dist/index54.js +7 -16
  115. package/dist/index55.cjs +1 -1
  116. package/dist/index55.js +32 -5
  117. package/dist/index56.cjs +1 -1
  118. package/dist/index56.js +15 -8
  119. package/dist/index57.cjs +1 -1
  120. package/dist/index57.js +2 -172
  121. package/dist/index58.cjs +1 -1
  122. package/dist/index58.js +7 -102
  123. package/dist/index59.cjs +1 -1
  124. package/dist/index59.js +20 -21
  125. package/dist/index60.cjs +1 -1
  126. package/dist/index60.js +38 -10
  127. package/dist/index61.cjs +1 -1
  128. package/dist/index61.js +32 -32
  129. package/dist/index62.cjs +1 -1
  130. package/dist/index62.js +69 -8
  131. package/dist/index63.cjs +1 -2
  132. package/dist/index63.js +110 -57
  133. package/dist/index64.cjs +1 -1
  134. package/dist/index64.js +68 -2
  135. package/dist/index65.cjs +1 -1
  136. package/dist/index65.js +2 -7
  137. package/dist/index66.cjs +1 -1
  138. package/dist/index66.js +16 -6
  139. package/dist/index67.cjs +1 -1
  140. package/dist/index67.js +223 -4
  141. package/dist/index68.cjs +1 -1
  142. package/dist/index68.js +230 -10
  143. package/dist/index69.cjs +1 -1
  144. package/dist/index69.js +12 -3
  145. package/dist/index70.cjs +1 -5
  146. package/dist/index70.js +29 -51
  147. package/dist/index71.cjs +2 -2
  148. package/dist/index71.js +57 -32
  149. package/dist/index72.cjs +1 -1
  150. package/dist/index72.js +21 -5
  151. package/dist/index73.cjs +1 -1
  152. package/dist/index73.js +18 -21
  153. package/dist/index74.cjs +1 -1
  154. package/dist/index74.js +42 -8
  155. package/dist/index75.cjs +1 -1
  156. package/dist/index75.js +8 -10
  157. package/dist/index76.cjs +1 -1
  158. package/dist/index76.js +104 -11
  159. package/dist/index77.cjs +1 -1
  160. package/dist/index77.js +3 -6
  161. package/dist/index78.cjs +1 -1
  162. package/dist/index78.js +17 -13
  163. package/dist/index79.cjs +1 -1
  164. package/dist/index79.js +8 -32
  165. package/dist/index80.cjs +1 -1
  166. package/dist/index80.js +10 -14
  167. package/dist/index81.cjs +1 -1
  168. package/dist/index81.js +11 -64
  169. package/dist/index82.cjs +1 -1
  170. package/dist/index82.js +12 -26
  171. package/dist/index83.cjs +1 -1
  172. package/dist/index83.js +7 -3
  173. package/dist/index84.cjs +1 -1
  174. package/dist/index84.js +78 -3
  175. package/dist/index85.cjs +1 -1
  176. package/dist/index85.js +14 -8
  177. package/dist/index86.cjs +1 -1
  178. package/dist/index86.js +16 -189
  179. package/dist/index87.cjs +1 -1
  180. package/dist/index87.js +191 -18
  181. package/dist/index88.cjs +1 -1
  182. package/dist/index88.js +63 -39
  183. package/dist/index89.cjs +1 -1
  184. package/dist/index89.js +4 -34
  185. package/dist/index9.cjs +1 -1
  186. package/dist/index9.js +51 -43
  187. package/dist/index90.cjs +1 -1
  188. package/dist/index90.js +2 -70
  189. package/dist/index91.cjs +1 -1
  190. package/dist/index91.js +5 -111
  191. package/dist/index92.cjs +1 -1
  192. package/dist/index92.js +11 -67
  193. package/dist/index93.cjs +5 -1
  194. package/dist/index93.js +57 -2
  195. package/dist/index94.cjs +2 -1
  196. package/dist/index94.js +33 -15
  197. package/dist/index95.cjs +1 -1
  198. package/dist/index95.js +5 -223
  199. package/dist/index96.cjs +1 -1
  200. package/dist/index96.js +3 -231
  201. package/dist/index97.cjs +1 -1
  202. package/dist/index97.js +6 -42
  203. package/dist/index98.cjs +1 -1
  204. package/dist/index98.js +30 -102
  205. package/dist/index99.cjs +1 -1
  206. package/dist/index99.js +26 -16
  207. package/package.json +1 -1
package/dist/index48.js CHANGED
@@ -1,16 +1,29 @@
1
- import { keccak256 as e } from "./index56.js";
2
- import { serializeTransaction as o } from "./index57.js";
3
- import { sign as c } from "./index45.js";
4
- async function u(n) {
5
- const { privateKey: a, transaction: r, serializer: i = o } = n, t = r.type === "eip4844" ? {
6
- ...r,
7
- sidecars: !1
8
- } : r, s = await c({
9
- hash: e(i(t)),
10
- privateKey: a
11
- });
12
- return i(r, s);
1
+ import { TransactionNotFoundError as p } from "./index49.js";
2
+ import { numberToHex as s } from "./index24.js";
3
+ import { formatTransaction as T } from "./index50.js";
4
+ async function h(e, { blockHash: a, blockNumber: r, blockTag: c, hash: o, index: n }) {
5
+ var i, u, f;
6
+ const m = c || "latest", d = r !== void 0 ? s(r) : void 0;
7
+ let t = null;
8
+ if (o ? t = await e.request({
9
+ method: "eth_getTransactionByHash",
10
+ params: [o]
11
+ }, { dedupe: !0 }) : a ? t = await e.request({
12
+ method: "eth_getTransactionByBlockHashAndIndex",
13
+ params: [a, s(n)]
14
+ }, { dedupe: !0 }) : t = await e.request({
15
+ method: "eth_getTransactionByBlockNumberAndIndex",
16
+ params: [d || m, s(n)]
17
+ }, { dedupe: !!d }), !t)
18
+ throw new p({
19
+ blockHash: a,
20
+ blockNumber: r,
21
+ blockTag: m,
22
+ hash: o,
23
+ index: n
24
+ });
25
+ return (((f = (u = (i = e.chain) == null ? void 0 : i.formatters) == null ? void 0 : u.transaction) == null ? void 0 : f.format) || T)(t);
13
26
  }
14
27
  export {
15
- u as signTransaction
28
+ h as getTransaction
16
29
  };
package/dist/index49.cjs CHANGED
@@ -1 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index58.cjs"),s=require("./index45.cjs");async function i(e){const{privateKey:t,...a}=e;return await s.sign({hash:n.hashTypedData(a),privateKey:t,to:"hex"})}exports.signTypedData=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index71.cjs");function c(t){const r=Object.entries(t).map(([a,e])=>e===void 0||e===!1?null:[a,e]).filter(Boolean),s=r.reduce((a,[e])=>Math.max(a,e.length),0);return r.map(([a,e])=>` ${`${a}:`.padEnd(s+1)} ${e}`).join(`
2
+ `)}class d extends o.BaseError{constructor({v:r}){super(`Invalid \`v\` value "${r}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class l extends o.BaseError{constructor({transaction:r}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",c(r),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class u extends o.BaseError{constructor({storageKey:r}){super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class T extends o.BaseError{constructor({blockHash:r,blockNumber:s,blockTag:a,hash:e,index:n}){let i="Transaction";a&&n!==void 0&&(i=`Transaction at block time "${a}" at index "${n}"`),r&&n!==void 0&&(i=`Transaction at block hash "${r}" at index "${n}"`),s&&n!==void 0&&(i=`Transaction at block number "${s}" at index "${n}"`),e&&(i=`Transaction with hash "${e}"`),super(`${i} could not be found.`,{name:"TransactionNotFoundError"})}}class E extends o.BaseError{constructor({hash:r}){super(`Transaction receipt with hash "${r}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class p extends o.BaseError{constructor({hash:r}){super(`Timed out while waiting for transaction with hash "${r}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}exports.InvalidLegacyVError=d;exports.InvalidSerializableTransactionError=l;exports.InvalidStorageKeySizeError=u;exports.TransactionNotFoundError=T;exports.TransactionReceiptNotFoundError=E;exports.WaitForTransactionReceiptTimeoutError=p;exports.prettyPrint=c;
package/dist/index49.js CHANGED
@@ -1,13 +1,68 @@
1
- import { hashTypedData as o } from "./index58.js";
2
- import { sign as r } from "./index45.js";
3
- async function p(t) {
4
- const { privateKey: a, ...e } = t;
5
- return await r({
6
- hash: o(e),
7
- privateKey: a,
8
- to: "hex"
9
- });
1
+ import { BaseError as o } from "./index71.js";
2
+ function c(e) {
3
+ const r = Object.entries(e).map(([t, n]) => n === void 0 || n === !1 ? null : [t, n]).filter(Boolean), s = r.reduce((t, [n]) => Math.max(t, n.length), 0);
4
+ return r.map(([t, n]) => ` ${`${t}:`.padEnd(s + 1)} ${n}`).join(`
5
+ `);
6
+ }
7
+ class u extends o {
8
+ constructor({ v: r }) {
9
+ super(`Invalid \`v\` value "${r}". Expected 27 or 28.`, {
10
+ name: "InvalidLegacyVError"
11
+ });
12
+ }
13
+ }
14
+ class l extends o {
15
+ constructor({ transaction: r }) {
16
+ super("Cannot infer a transaction type from provided transaction.", {
17
+ metaMessages: [
18
+ "Provided Transaction:",
19
+ "{",
20
+ c(r),
21
+ "}",
22
+ "",
23
+ "To infer the type, either provide:",
24
+ "- a `type` to the Transaction, or",
25
+ "- an EIP-1559 Transaction with `maxFeePerGas`, or",
26
+ "- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
27
+ "- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
28
+ "- an EIP-7702 Transaction with `authorizationList`, or",
29
+ "- a Legacy Transaction with `gasPrice`"
30
+ ],
31
+ name: "InvalidSerializableTransactionError"
32
+ });
33
+ }
34
+ }
35
+ class T extends o {
36
+ constructor({ storageKey: r }) {
37
+ super(`Size for storage key "${r}" is invalid. Expected 32 bytes. Got ${Math.floor((r.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
38
+ }
39
+ }
40
+ class h extends o {
41
+ constructor({ blockHash: r, blockNumber: s, blockTag: t, hash: n, index: a }) {
42
+ let i = "Transaction";
43
+ t && a !== void 0 && (i = `Transaction at block time "${t}" at index "${a}"`), r && a !== void 0 && (i = `Transaction at block hash "${r}" at index "${a}"`), s && a !== void 0 && (i = `Transaction at block number "${s}" at index "${a}"`), n && (i = `Transaction with hash "${n}"`), super(`${i} could not be found.`, {
44
+ name: "TransactionNotFoundError"
45
+ });
46
+ }
47
+ }
48
+ class p extends o {
49
+ constructor({ hash: r }) {
50
+ super(`Transaction receipt with hash "${r}" could not be found. The Transaction may not be processed on a block yet.`, {
51
+ name: "TransactionReceiptNotFoundError"
52
+ });
53
+ }
54
+ }
55
+ class f extends o {
56
+ constructor({ hash: r }) {
57
+ super(`Timed out while waiting for transaction with hash "${r}" to be confirmed.`, { name: "WaitForTransactionReceiptTimeoutError" });
58
+ }
10
59
  }
11
60
  export {
12
- p as signTypedData
61
+ u as InvalidLegacyVError,
62
+ l as InvalidSerializableTransactionError,
63
+ T as InvalidStorageKeySizeError,
64
+ h as TransactionNotFoundError,
65
+ p as TransactionReceiptNotFoundError,
66
+ f as WaitForTransactionReceiptTimeoutError,
67
+ c as prettyPrint
13
68
  };
package/dist/index50.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index63.cjs");class r extends s.BaseError{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}exports.InvalidAddressError=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index35.cjs"),i={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function u(e){const d={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?r.hexToNumber(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?r.hexToNumber(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?i[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(d.authorizationList=l(e.authorizationList)),d.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof d.v=="bigint"){if(d.v===0n||d.v===27n)return 0;if(d.v===1n||d.v===28n)return 1;if(d.v>=35n)return d.v%2n===0n?1:0}})(),d.type==="legacy"&&(delete d.accessList,delete d.maxFeePerBlobGas,delete d.maxFeePerGas,delete d.maxPriorityFeePerGas,delete d.yParity),d.type==="eip2930"&&(delete d.maxFeePerBlobGas,delete d.maxFeePerGas,delete d.maxPriorityFeePerGas),d.type==="eip1559"&&delete d.maxFeePerBlobGas,d}function l(e){return e.map(d=>({address:d.address,chainId:Number(d.chainId),nonce:Number(d.nonce),r:d.r,s:d.s,yParity:Number(d.yParity)}))}exports.formatTransaction=u;exports.transactionType=i;
package/dist/index50.js CHANGED
@@ -1,15 +1,54 @@
1
- import { BaseError as r } from "./index63.js";
2
- class d extends r {
3
- constructor({ address: s }) {
4
- super(`Address "${s}" is invalid.`, {
5
- metaMessages: [
6
- "- Address must be a hex value of 20 bytes (40 hex characters).",
7
- "- Address must match its checksum counterpart."
8
- ],
9
- name: "InvalidAddressError"
10
- });
11
- }
1
+ import { hexToNumber as i } from "./index35.js";
2
+ const r = {
3
+ "0x0": "legacy",
4
+ "0x1": "eip2930",
5
+ "0x2": "eip1559",
6
+ "0x3": "eip4844",
7
+ "0x4": "eip7702"
8
+ };
9
+ function m(e) {
10
+ const d = {
11
+ ...e,
12
+ blockHash: e.blockHash ? e.blockHash : null,
13
+ blockNumber: e.blockNumber ? BigInt(e.blockNumber) : null,
14
+ chainId: e.chainId ? i(e.chainId) : void 0,
15
+ gas: e.gas ? BigInt(e.gas) : void 0,
16
+ gasPrice: e.gasPrice ? BigInt(e.gasPrice) : void 0,
17
+ maxFeePerBlobGas: e.maxFeePerBlobGas ? BigInt(e.maxFeePerBlobGas) : void 0,
18
+ maxFeePerGas: e.maxFeePerGas ? BigInt(e.maxFeePerGas) : void 0,
19
+ maxPriorityFeePerGas: e.maxPriorityFeePerGas ? BigInt(e.maxPriorityFeePerGas) : void 0,
20
+ nonce: e.nonce ? i(e.nonce) : void 0,
21
+ to: e.to ? e.to : null,
22
+ transactionIndex: e.transactionIndex ? Number(e.transactionIndex) : null,
23
+ type: e.type ? r[e.type] : void 0,
24
+ typeHex: e.type ? e.type : void 0,
25
+ value: e.value ? BigInt(e.value) : void 0,
26
+ v: e.v ? BigInt(e.v) : void 0
27
+ };
28
+ return e.authorizationList && (d.authorizationList = u(e.authorizationList)), d.yParity = (() => {
29
+ if (e.yParity)
30
+ return Number(e.yParity);
31
+ if (typeof d.v == "bigint") {
32
+ if (d.v === 0n || d.v === 27n)
33
+ return 0;
34
+ if (d.v === 1n || d.v === 28n)
35
+ return 1;
36
+ if (d.v >= 35n)
37
+ return d.v % 2n === 0n ? 1 : 0;
38
+ }
39
+ })(), d.type === "legacy" && (delete d.accessList, delete d.maxFeePerBlobGas, delete d.maxFeePerGas, delete d.maxPriorityFeePerGas, delete d.yParity), d.type === "eip2930" && (delete d.maxFeePerBlobGas, delete d.maxFeePerGas, delete d.maxPriorityFeePerGas), d.type === "eip1559" && delete d.maxFeePerBlobGas, d;
40
+ }
41
+ function u(e) {
42
+ return e.map((d) => ({
43
+ address: d.address,
44
+ chainId: Number(d.chainId),
45
+ nonce: Number(d.nonce),
46
+ r: d.r,
47
+ s: d.s,
48
+ yParity: Number(d.yParity)
49
+ }));
12
50
  }
13
51
  export {
14
- d as InvalidAddressError
52
+ m as formatTransaction,
53
+ r as transactionType
15
54
  };
package/dist/index51.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index73.cjs"),i=require("./index59.cjs"),o=/^0x[a-fA-F0-9]{40}$/,t=new c.LruMap(8192);function f(e,n){const{strict:s=!0}=n??{},r=`${e}.${s}`;if(t.has(r))return t.get(r);const u=o.test(e)?e.toLowerCase()===e?!0:s?i.checksumAddress(e)===e:!0:!1;return t.set(r,u),u}exports.isAddress=f;exports.isAddressCache=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index49.cjs"),i=require("./index52.cjs");async function s(t,{hash:e}){var a,n,o;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new c.TransactionReceiptNotFoundError({hash:e});return(((o=(n=(a=t.chain)==null?void 0:a.formatters)==null?void 0:n.transactionReceipt)==null?void 0:o.format)||i.formatTransactionReceipt)(r)}exports.getTransactionReceipt=s;
package/dist/index51.js CHANGED
@@ -1,14 +1,15 @@
1
- import { LruMap as u } from "./index73.js";
2
- import { checksumAddress as c } from "./index59.js";
3
- const i = /^0x[a-fA-F0-9]{40}$/, r = /* @__PURE__ */ new u(8192);
4
- function h(t, s) {
5
- const { strict: n = !0 } = s ?? {}, e = `${t}.${n}`;
6
- if (r.has(e))
7
- return r.get(e);
8
- const o = i.test(t) ? t.toLowerCase() === t ? !0 : n ? c(t) === t : !0 : !1;
9
- return r.set(e, o), o;
1
+ import { TransactionReceiptNotFoundError as i } from "./index49.js";
2
+ import { formatTransactionReceipt as c } from "./index52.js";
3
+ async function f(t, { hash: r }) {
4
+ var o, a, n;
5
+ const e = await t.request({
6
+ method: "eth_getTransactionReceipt",
7
+ params: [r]
8
+ }, { dedupe: !0 });
9
+ if (!e)
10
+ throw new i({ hash: r });
11
+ return (((n = (a = (o = t.chain) == null ? void 0 : o.formatters) == null ? void 0 : a.transactionReceipt) == null ? void 0 : n.format) || c)(e);
10
12
  }
11
13
  export {
12
- h as isAddress,
13
- r as isAddressCache
14
+ f as getTransactionReceipt
14
15
  };
package/dist/index52.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index42.cjs"),n=require("./index35.cjs"),a=require("./index53.cjs");function g({r:i,s:o,to:u="hex",v:e,yParity:r}){const s=(()=>{if(r===0||r===1)return r;if(e&&(e===27n||e===28n||e>=35n))return e%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),t=`0x${new c.secp256k1.Signature(n.hexToBigInt(i),n.hexToBigInt(o)).toCompactHex()}${s===0?"1b":"1c"}`;return u==="hex"?t:a.hexToBytes(t)}exports.serializeSignature=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index35.cjs"),d=require("./index92.cjs"),r=require("./index50.cjs"),u={"0x0":"reverted","0x1":"success"};function o(l){const s={...l,blockNumber:l.blockNumber?BigInt(l.blockNumber):null,contractAddress:l.contractAddress?l.contractAddress:null,cumulativeGasUsed:l.cumulativeGasUsed?BigInt(l.cumulativeGasUsed):null,effectiveGasPrice:l.effectiveGasPrice?BigInt(l.effectiveGasPrice):null,gasUsed:l.gasUsed?BigInt(l.gasUsed):null,logs:l.logs?l.logs.map(e=>d.formatLog(e)):null,to:l.to?l.to:null,transactionIndex:l.transactionIndex?b.hexToNumber(l.transactionIndex):null,status:l.status?u[l.status]:null,type:l.type?r.transactionType[l.type]||l.type:null};return l.blobGasPrice&&(s.blobGasPrice=BigInt(l.blobGasPrice)),l.blobGasUsed&&(s.blobGasUsed=BigInt(l.blobGasUsed)),s}exports.formatTransactionReceipt=o;exports.receiptStatuses=u;
package/dist/index52.js CHANGED
@@ -1,16 +1,27 @@
1
- import { secp256k1 as f } from "./index42.js";
2
- import { hexToBigInt as t } from "./index35.js";
3
- import { hexToBytes as m } from "./index53.js";
4
- function s({ r: o, s: i, to: u = "hex", v: r, yParity: e }) {
5
- const a = (() => {
6
- if (e === 0 || e === 1)
7
- return e;
8
- if (r && (r === 27n || r === 28n || r >= 35n))
9
- return r % 2n === 0n ? 1 : 0;
10
- throw new Error("Invalid `v` or `yParity` value");
11
- })(), n = `0x${new f.Signature(t(o), t(i)).toCompactHex()}${a === 0 ? "1b" : "1c"}`;
12
- return u === "hex" ? n : m(n);
1
+ import { hexToNumber as b } from "./index35.js";
2
+ import { formatLog as d } from "./index92.js";
3
+ import { transactionType as m } from "./index50.js";
4
+ const f = {
5
+ "0x0": "reverted",
6
+ "0x1": "success"
7
+ };
8
+ function r(l) {
9
+ const u = {
10
+ ...l,
11
+ blockNumber: l.blockNumber ? BigInt(l.blockNumber) : null,
12
+ contractAddress: l.contractAddress ? l.contractAddress : null,
13
+ cumulativeGasUsed: l.cumulativeGasUsed ? BigInt(l.cumulativeGasUsed) : null,
14
+ effectiveGasPrice: l.effectiveGasPrice ? BigInt(l.effectiveGasPrice) : null,
15
+ gasUsed: l.gasUsed ? BigInt(l.gasUsed) : null,
16
+ logs: l.logs ? l.logs.map((s) => d(s)) : null,
17
+ to: l.to ? l.to : null,
18
+ transactionIndex: l.transactionIndex ? b(l.transactionIndex) : null,
19
+ status: l.status ? f[l.status] : null,
20
+ type: l.type ? m[l.type] || l.type : null
21
+ };
22
+ return l.blobGasPrice && (u.blobGasPrice = BigInt(l.blobGasPrice)), l.blobGasUsed && (u.blobGasUsed = BigInt(l.blobGasUsed)), u;
13
23
  }
14
24
  export {
15
- s as serializeSignature
25
+ r as formatTransactionReceipt,
26
+ f as receiptStatuses
16
27
  };
package/dist/index53.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index63.cjs"),l=require("./index84.cjs"),u=require("./index61.cjs"),f=require("./index35.cjs"),m=require("./index25.cjs"),h=new TextEncoder;function A(e,n={}){return typeof e=="number"||typeof e=="bigint"?B(e,n):typeof e=="boolean"?x(e,n):l.isHex(e)?c(e,n):T(e,n)}function x(e,n={}){const t=new Uint8Array(1);return t[0]=Number(e),typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{size:n.size})):t}const i={zero:48,nine:57,A:65,F:70,a:97,f:102};function g(e){if(e>=i.zero&&e<=i.nine)return e-i.zero;if(e>=i.A&&e<=i.F)return e-(i.A-10);if(e>=i.a&&e<=i.f)return e-(i.a-10)}function c(e,n={}){let t=e;n.size&&(f.assertSize(t,{size:n.size}),t=u.pad(t,{dir:"right",size:n.size}));let r=t.slice(2);r.length%2&&(r=`0${r}`);const d=r.length/2,y=new Uint8Array(d);for(let s=0,o=0;s<d;s++){const b=g(r.charCodeAt(o++)),z=g(r.charCodeAt(o++));if(b===void 0||z===void 0)throw new a.BaseError(`Invalid byte sequence ("${r[o-2]}${r[o-1]}" in "${r}").`);y[s]=b*16+z}return y}function B(e,n){const t=m.numberToHex(e,n);return c(t)}function T(e,n={}){const t=h.encode(e);return typeof n.size=="number"?(f.assertSize(t,{size:n.size}),u.pad(t,{dir:"right",size:n.size})):t}exports.boolToBytes=x;exports.hexToBytes=c;exports.numberToBytes=B;exports.stringToBytes=T;exports.toBytes=A;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index35.cjs"),d=require("./index54.cjs"),y=require("./index55.cjs"),h=require("./index56.cjs"),B=require("./index57.cjs"),m=require("./index46.cjs");function q(t,{emitOnBegin:b=!1,emitMissed:l=!1,onBlockNumber:p,onError:a,poll:k,pollingInterval:i=t.pollingInterval}){const g=typeof k<"u"?k:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket");let r;return g?(()=>{const f=B.stringify(["watchBlockNumber",t.uid,b,l,i]);return y.observe(f,{onBlockNumber:p,onError:a},o=>h.poll(async()=>{var c;try{const e=await d.getAction(t,m.getBlockNumber,"getBlockNumber")({cacheTime:0});if(r){if(e===r)return;if(e-r>1&&l)for(let s=r+1n;s<e;s++)o.onBlockNumber(s,r),r=s}(!r||e>r)&&(o.onBlockNumber(e,r),r=e)}catch(e){(c=o.onError)==null||c.call(o,e)}},{emitOnBegin:b,interval:i}))})():(()=>{const f=B.stringify(["watchBlockNumber",t.uid,b,l]);return y.observe(f,{onBlockNumber:p,onError:a},o=>{let c=!0,e=()=>c=!1;return(async()=>{try{const s=(()=>{if(t.transport.type==="fallback"){const n=t.transport.transports.find(u=>u.config.type==="webSocket");return n?n.value:t.transport}return t.transport})(),{unsubscribe:v}=await s.subscribe({params:["newHeads"],onData(n){var N;if(!c)return;const u=w.hexToBigInt((N=n.result)==null?void 0:N.number);o.onBlockNumber(u,r),r=u},onError(n){var u;(u=o.onError)==null||u.call(o,n)}});e=v,c||e()}catch(s){a==null||a(s)}})(),()=>e()})})()}exports.watchBlockNumber=q;
package/dist/index53.js CHANGED
@@ -1,58 +1,78 @@
1
- import { BaseError as g } from "./index63.js";
2
- import { isHex as x } from "./index84.js";
3
- import { pad as s } from "./index61.js";
4
- import { assertSize as u } from "./index35.js";
5
- import { numberToHex as h } from "./index25.js";
6
- const A = /* @__PURE__ */ new TextEncoder();
7
- function F(e, n = {}) {
8
- return typeof e == "number" || typeof e == "bigint" ? T(e, n) : typeof e == "boolean" ? B(e, n) : x(e) ? y(e, n) : l(e, n);
9
- }
10
- function B(e, n = {}) {
11
- const r = new Uint8Array(1);
12
- return r[0] = Number(e), typeof n.size == "number" ? (u(r, { size: n.size }), s(r, { size: n.size })) : r;
13
- }
14
- const t = {
15
- zero: 48,
16
- nine: 57,
17
- A: 65,
18
- F: 70,
19
- a: 97,
20
- f: 102
21
- };
22
- function m(e) {
23
- if (e >= t.zero && e <= t.nine)
24
- return e - t.zero;
25
- if (e >= t.A && e <= t.F)
26
- return e - (t.A - 10);
27
- if (e >= t.a && e <= t.f)
28
- return e - (t.a - 10);
29
- }
30
- function y(e, n = {}) {
31
- let r = e;
32
- n.size && (u(r, { size: n.size }), r = s(r, { dir: "right", size: n.size }));
33
- let i = r.slice(2);
34
- i.length % 2 && (i = `0${i}`);
35
- const z = i.length / 2, d = new Uint8Array(z);
36
- for (let f = 0, o = 0; f < z; f++) {
37
- const b = m(i.charCodeAt(o++)), c = m(i.charCodeAt(o++));
38
- if (b === void 0 || c === void 0)
39
- throw new g(`Invalid byte sequence ("${i[o - 2]}${i[o - 1]}" in "${i}").`);
40
- d[f] = b * 16 + c;
41
- }
42
- return d;
43
- }
44
- function T(e, n) {
45
- const r = h(e, n);
46
- return y(r);
47
- }
48
- function l(e, n = {}) {
49
- const r = A.encode(e);
50
- return typeof n.size == "number" ? (u(r, { size: n.size }), s(r, { dir: "right", size: n.size })) : r;
1
+ import { hexToBigInt as h } from "./index35.js";
2
+ import { getAction as v } from "./index54.js";
3
+ import { observe as i } from "./index55.js";
4
+ import { poll as d } from "./index56.js";
5
+ import { stringify as y } from "./index57.js";
6
+ import { getBlockNumber as g } from "./index46.js";
7
+ function j(t, { emitOnBegin: b = !1, emitMissed: f = !1, onBlockNumber: p, onError: n, poll: k, pollingInterval: m = t.pollingInterval }) {
8
+ const B = typeof k < "u" ? k : !(t.transport.type === "webSocket" || t.transport.type === "fallback" && t.transport.transports[0].config.type === "webSocket");
9
+ let r;
10
+ return B ? (() => {
11
+ const l = y([
12
+ "watchBlockNumber",
13
+ t.uid,
14
+ b,
15
+ f,
16
+ m
17
+ ]);
18
+ return i(l, { onBlockNumber: p, onError: n }, (e) => d(async () => {
19
+ var a;
20
+ try {
21
+ const o = await v(t, g, "getBlockNumber")({ cacheTime: 0 });
22
+ if (r) {
23
+ if (o === r)
24
+ return;
25
+ if (o - r > 1 && f)
26
+ for (let s = r + 1n; s < o; s++)
27
+ e.onBlockNumber(s, r), r = s;
28
+ }
29
+ (!r || o > r) && (e.onBlockNumber(o, r), r = o);
30
+ } catch (o) {
31
+ (a = e.onError) == null || a.call(e, o);
32
+ }
33
+ }, {
34
+ emitOnBegin: b,
35
+ interval: m
36
+ }));
37
+ })() : (() => {
38
+ const l = y([
39
+ "watchBlockNumber",
40
+ t.uid,
41
+ b,
42
+ f
43
+ ]);
44
+ return i(l, { onBlockNumber: p, onError: n }, (e) => {
45
+ let a = !0, o = () => a = !1;
46
+ return (async () => {
47
+ try {
48
+ const s = (() => {
49
+ if (t.transport.type === "fallback") {
50
+ const c = t.transport.transports.find((u) => u.config.type === "webSocket");
51
+ return c ? c.value : t.transport;
52
+ }
53
+ return t.transport;
54
+ })(), { unsubscribe: w } = await s.subscribe({
55
+ params: ["newHeads"],
56
+ onData(c) {
57
+ var N;
58
+ if (!a)
59
+ return;
60
+ const u = h((N = c.result) == null ? void 0 : N.number);
61
+ e.onBlockNumber(u, r), r = u;
62
+ },
63
+ onError(c) {
64
+ var u;
65
+ (u = e.onError) == null || u.call(e, c);
66
+ }
67
+ });
68
+ o = w, a || o();
69
+ } catch (s) {
70
+ n == null || n(s);
71
+ }
72
+ })(), () => o();
73
+ });
74
+ })();
51
75
  }
52
76
  export {
53
- B as boolToBytes,
54
- y as hexToBytes,
55
- T as numberToBytes,
56
- l as stringToBytes,
57
- F as toBytes
77
+ j as watchBlockNumber
58
78
  };
package/dist/index54.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index87.cjs"),u=require("./index53.cjs"),c=require("./index25.cjs"),a=require("./index97.cjs"),h=require("./index56.cjs");function d(e){const{chainId:t,nonce:o,to:r}=e,s=e.contractAddress??e.address,n=h.keccak256(i.concatHex(["0x05",a.toRlp([t?c.numberToHex(t):"0x",s,o?c.numberToHex(o):"0x"])]));return r==="bytes"?u.hexToBytes(n):n}exports.hashAuthorization=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(t,e,o){const i=t[e.name];if(typeof i=="function")return i;const n=t[o];return typeof n=="function"?n:c=>e(t,c)}exports.getAction=r;
package/dist/index54.js CHANGED
@@ -1,19 +1,10 @@
1
- import { concatHex as i } from "./index87.js";
2
- import { hexToBytes as m } from "./index53.js";
3
- import { numberToHex as c } from "./index25.js";
4
- import { toRlp as d } from "./index97.js";
5
- import { keccak256 as f } from "./index56.js";
6
- function b(o) {
7
- const { chainId: t, nonce: r, to: s } = o, e = o.contractAddress ?? o.address, n = f(i([
8
- "0x05",
9
- d([
10
- t ? c(t) : "0x",
11
- e,
12
- r ? c(r) : "0x"
13
- ])
14
- ]));
15
- return s === "bytes" ? m(n) : n;
1
+ function f(t, n, c) {
2
+ const i = t[n.name];
3
+ if (typeof i == "function")
4
+ return i;
5
+ const o = t[c];
6
+ return typeof o == "function" ? o : (e) => n(t, e);
16
7
  }
17
8
  export {
18
- b as hashAuthorization
9
+ f as getAction
19
10
  };
package/dist/index55.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index56.cjs"),t=require("./index85.cjs");function a(e,s){return r.keccak256(t.toPrefixedMessage(e),s)}exports.hashMessage=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=new Map,r=new Map;let m=0;function w(n,u,C){const o=++m,s=()=>i.get(n)||[],y=()=>{const t=s();i.set(n,t.filter(e=>e.id!==o))},a=()=>{const t=s();if(!t.some(c=>c.id===o))return;const e=r.get(n);t.length===1&&e&&e(),y()},l=s();if(i.set(n,[...l,{id:o,fns:u}]),l&&l.length>0)return a;const f={};for(const t in u)f[t]=(...e)=>{var h,p;const c=s();if(c.length!==0)for(const b of c)(p=(h=b.fns)[t])==null||p.call(h,...e)};const g=C(f);return typeof g=="function"&&r.set(n,g),a}exports.cleanupCache=r;exports.listenersCache=i;exports.observe=w;
package/dist/index55.js CHANGED
@@ -1,8 +1,35 @@
1
- import { keccak256 as o } from "./index56.js";
2
- import { toPrefixedMessage as t } from "./index85.js";
3
- function f(e, r) {
4
- return o(t(e), r);
1
+ const l = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
2
+ let m = 0;
3
+ function y(e, f, w) {
4
+ const i = ++m, s = () => l.get(e) || [], C = () => {
5
+ const n = s();
6
+ l.set(e, n.filter((t) => t.id !== i));
7
+ }, r = () => {
8
+ const n = s();
9
+ if (!n.some((c) => c.id === i))
10
+ return;
11
+ const t = h.get(e);
12
+ n.length === 1 && t && t(), C();
13
+ }, o = s();
14
+ if (l.set(e, [
15
+ ...o,
16
+ { id: i, fns: f }
17
+ ]), o && o.length > 0)
18
+ return r;
19
+ const u = {};
20
+ for (const n in f)
21
+ u[n] = (...t) => {
22
+ var p, g;
23
+ const c = s();
24
+ if (c.length !== 0)
25
+ for (const k of c)
26
+ (g = (p = k.fns)[n]) == null || g.call(p, ...t);
27
+ };
28
+ const a = w(u);
29
+ return typeof a == "function" && h.set(e, a), r;
5
30
  }
6
31
  export {
7
- f as hashMessage
32
+ h as cleanupCache,
33
+ l as listenersCache,
34
+ y as observe
8
35
  };
package/dist/index56.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index98.cjs"),o=require("./index84.cjs"),i=require("./index53.cjs"),n=require("./index25.cjs");function u(e,r){const s=r||"hex",t=c.keccak_256(o.isHex(e,{strict:!1})?i.toBytes(e):e);return s==="bytes"?t:n.toHex(t)}exports.keccak256=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./index96.cjs");function s(o,{emitOnBegin:w,initialWaitTime:t,interval:c}){let e=!0;const a=()=>e=!1;return(async()=>{let n;w&&(n=await o({unpoll:a}));const r=await(t==null?void 0:t(n))??c;await u.wait(r);const l=async()=>{e&&(await o({unpoll:a}),await u.wait(c),l())};l()})(),a}exports.poll=s;
package/dist/index56.js CHANGED
@@ -1,11 +1,18 @@
1
- import { keccak_256 as c } from "./index98.js";
2
- import { isHex as i } from "./index84.js";
3
- import { toBytes as m } from "./index53.js";
4
- import { toHex as s } from "./index25.js";
5
- function x(t, r) {
6
- const e = r || "hex", o = c(i(t, { strict: !1 }) ? m(t) : t);
7
- return e === "bytes" ? o : s(o);
1
+ import { wait as l } from "./index96.js";
2
+ function f(o, { emitOnBegin: r, initialWaitTime: t, interval: c }) {
3
+ let n = !0;
4
+ const a = () => n = !1;
5
+ return (async () => {
6
+ let w;
7
+ r && (w = await o({ unpoll: a }));
8
+ const s = await (t == null ? void 0 : t(w)) ?? c;
9
+ await l(s);
10
+ const u = async () => {
11
+ n && (await o({ unpoll: a }), await l(c), u());
12
+ };
13
+ u();
14
+ })(), a;
8
15
  }
9
16
  export {
10
- x as keccak256
17
+ f as poll
11
18
  };
package/dist/index57.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./index30.cjs"),G=require("./index99.cjs"),R=require("./index74.cjs"),S=require("./index75.cjs"),B=require("./index76.cjs"),V=require("./index78.cjs"),L=require("./index87.cjs"),h=require("./index66.cjs"),t=require("./index25.cjs"),b=require("./index97.cjs"),z=require("./index100.cjs"),C=require("./index80.cjs"),v=require("./index101.cjs");function k(e,o){const s=C.getTransactionType(e);return s==="eip1559"?_(e,o):s==="eip2930"?j(e,o):s==="eip4844"?Y(e,o):s==="eip7702"?w(e,o):M(e,o)}function w(e,o){const{authorizationList:s,chainId:i,gas:r,nonce:c,to:a,value:x,maxFeePerGas:l,maxPriorityFeePerGas:n,accessList:H,data:d}=e;z.assertTransactionEIP7702(e);const f=v.serializeAccessList(H),u=G.serializeAuthorizationList(s);return L.concatHex(["0x04",b.toRlp([t.toHex(i),c?t.toHex(c):"0x",n?t.toHex(n):"0x",l?t.toHex(l):"0x",r?t.toHex(r):"0x",a??"0x",x?t.toHex(x):"0x",d??"0x",f,u,...T(e,o)])])}function Y(e,o){const{chainId:s,gas:i,nonce:r,to:c,value:a,maxFeePerBlobGas:x,maxFeePerGas:l,maxPriorityFeePerGas:n,accessList:H,data:d}=e;z.assertTransactionEIP4844(e);let f=e.blobVersionedHashes,u=e.sidecars;if(e.blobs&&(typeof f>"u"||typeof u>"u")){const m=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(y=>t.bytesToHex(y)),P=e.kzg,p=R.blobsToCommitments({blobs:m,kzg:P});if(typeof f>"u"&&(f=B.commitmentsToVersionedHashes({commitments:p})),typeof u>"u"){const y=S.blobsToProofs({blobs:m,commitments:p,kzg:P});u=V.toBlobSidecars({blobs:m,commitments:p,proofs:y})}}const I=v.serializeAccessList(H),A=[t.toHex(s),r?t.toHex(r):"0x",n?t.toHex(n):"0x",l?t.toHex(l):"0x",i?t.toHex(i):"0x",c??"0x",a?t.toHex(a):"0x",d??"0x",I,x?t.toHex(x):"0x",f??[],...T(e,o)],q=[],g=[],E=[];if(u)for(let m=0;m<u.length;m++){const{blob:P,commitment:p,proof:y}=u[m];q.push(P),g.push(p),E.push(y)}return L.concatHex(["0x03",u?b.toRlp([A,q,g,E]):b.toRlp(A)])}function _(e,o){const{chainId:s,gas:i,nonce:r,to:c,value:a,maxFeePerGas:x,maxPriorityFeePerGas:l,accessList:n,data:H}=e;z.assertTransactionEIP1559(e);const d=v.serializeAccessList(n),f=[t.toHex(s),r?t.toHex(r):"0x",l?t.toHex(l):"0x",x?t.toHex(x):"0x",i?t.toHex(i):"0x",c??"0x",a?t.toHex(a):"0x",H??"0x",d,...T(e,o)];return L.concatHex(["0x02",b.toRlp(f)])}function j(e,o){const{chainId:s,gas:i,data:r,nonce:c,to:a,value:x,accessList:l,gasPrice:n}=e;z.assertTransactionEIP2930(e);const H=v.serializeAccessList(l),d=[t.toHex(s),c?t.toHex(c):"0x",n?t.toHex(n):"0x",i?t.toHex(i):"0x",a??"0x",x?t.toHex(x):"0x",r??"0x",H,...T(e,o)];return L.concatHex(["0x01",b.toRlp(d)])}function M(e,o){const{chainId:s=0,gas:i,data:r,nonce:c,to:a,value:x,gasPrice:l}=e;z.assertTransactionLegacy(e);let n=[c?t.toHex(c):"0x",l?t.toHex(l):"0x",i?t.toHex(i):"0x",a??"0x",x?t.toHex(x):"0x",r??"0x"];if(o){const H=(()=>{if(o.v>=35n)return(o.v-35n)/2n>0?o.v:27n+(o.v===35n?0n:1n);if(s>0)return BigInt(s*2)+BigInt(35n+o.v-27n);const u=27n+(o.v===27n?0n:1n);if(o.v!==u)throw new F.InvalidLegacyVError({v:o.v});return u})(),d=h.trim(o.r),f=h.trim(o.s);n=[...n,t.toHex(H),d==="0x00"?"0x":d,f==="0x00"?"0x":f]}else s>0&&(n=[...n,t.toHex(s),"0x","0x"]);return b.toRlp(n)}function T(e,o){const s=o??e,{v:i,yParity:r}=s;if(typeof s.r>"u")return[];if(typeof s.s>"u")return[];if(typeof i>"u"&&typeof r>"u")return[];const c=h.trim(s.r),a=h.trim(s.s);return[typeof r=="number"?r?t.toHex(1):"0x":i===0n?"0x":i===1n?t.toHex(1):i===27n?"0x":t.toHex(1),c==="0x00"?"0x":c,a==="0x00"?"0x":a]}exports.serializeTransaction=k;exports.toYParitySignatureArray=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=(e,n,i)=>JSON.stringify(e,(o,t)=>typeof t=="bigint"?t.toString():t,i);exports.stringify=r;