@gardenfi/utils 2.0.6-beta.18 → 2.0.6-beta.19

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 (127) hide show
  1. package/dist/index101.cjs +1 -1
  2. package/dist/index101.js +8 -12
  3. package/dist/index102.cjs +1 -1
  4. package/dist/index102.js +10 -17
  5. package/dist/index103.cjs +1 -1
  6. package/dist/index103.js +18 -642
  7. package/dist/index104.cjs +1 -1
  8. package/dist/index104.js +10 -170
  9. package/dist/index105.cjs +1 -1
  10. package/dist/index105.js +639 -123
  11. package/dist/index106.cjs +1 -2
  12. package/dist/index106.js +173 -3
  13. package/dist/index107.cjs +1 -1
  14. package/dist/index107.js +17 -37
  15. package/dist/index108.cjs +2 -1
  16. package/dist/index108.js +3 -2
  17. package/dist/index109.cjs +1 -1
  18. package/dist/index109.js +128 -2
  19. package/dist/index110.cjs +1 -1
  20. package/dist/index110.js +34 -33
  21. package/dist/index111.cjs +1 -1
  22. package/dist/index111.js +2 -12
  23. package/dist/index112.cjs +1 -1
  24. package/dist/index112.js +2 -20
  25. package/dist/index113.cjs +1 -1
  26. package/dist/index113.js +37 -8
  27. package/dist/index116.cjs +1 -1
  28. package/dist/index116.js +2 -2
  29. package/dist/index117.cjs +1 -1
  30. package/dist/index117.js +1 -1
  31. package/dist/index20.cjs +1 -1
  32. package/dist/index20.js +1 -1
  33. package/dist/index21.cjs +1 -1
  34. package/dist/index21.js +2 -2
  35. package/dist/index22.cjs +1 -1
  36. package/dist/index22.js +1 -1
  37. package/dist/index23.cjs +1 -1
  38. package/dist/index23.js +3 -3
  39. package/dist/index32.cjs +1 -1
  40. package/dist/index32.js +1 -1
  41. package/dist/index33.cjs +1 -1
  42. package/dist/index33.js +1 -1
  43. package/dist/index35.cjs +1 -1
  44. package/dist/index35.js +1 -1
  45. package/dist/index36.cjs +1 -1
  46. package/dist/index36.js +2 -2
  47. package/dist/index37.cjs +1 -1
  48. package/dist/index37.js +2 -2
  49. package/dist/index38.cjs +1 -1
  50. package/dist/index38.js +1 -1
  51. package/dist/index39.cjs +1 -1
  52. package/dist/index39.js +2 -2
  53. package/dist/index40.cjs +1 -1
  54. package/dist/index40.js +8 -8
  55. package/dist/index41.cjs +1 -1
  56. package/dist/index41.js +1 -1
  57. package/dist/index42.cjs +1 -1
  58. package/dist/index42.js +1 -1
  59. package/dist/index44.cjs +1 -1
  60. package/dist/index44.js +1 -1
  61. package/dist/index49.cjs +1 -1
  62. package/dist/index49.js +1 -1
  63. package/dist/index60.cjs +1 -1
  64. package/dist/index60.js +1 -1
  65. package/dist/index61.cjs +1 -1
  66. package/dist/index61.js +1 -1
  67. package/dist/index62.cjs +1 -2
  68. package/dist/index62.js +110 -57
  69. package/dist/index63.cjs +1 -1
  70. package/dist/index63.js +16 -21
  71. package/dist/index64.cjs +1 -1
  72. package/dist/index64.js +219 -36
  73. package/dist/index65.cjs +1 -1
  74. package/dist/index65.js +40 -34
  75. package/dist/index66.cjs +1 -1
  76. package/dist/index66.js +34 -69
  77. package/dist/index67.cjs +1 -1
  78. package/dist/index67.js +66 -109
  79. package/dist/index68.cjs +1 -1
  80. package/dist/index68.js +2 -2
  81. package/dist/index70.cjs +1 -1
  82. package/dist/index70.js +228 -13
  83. package/dist/index71.cjs +2 -1
  84. package/dist/index71.js +56 -220
  85. package/dist/index72.cjs +1 -1
  86. package/dist/index72.js +18 -228
  87. package/dist/index73.cjs +1 -1
  88. package/dist/index73.js +3 -17
  89. package/dist/index74.cjs +1 -1
  90. package/dist/index74.js +3 -42
  91. package/dist/index75.cjs +1 -1
  92. package/dist/index75.js +8 -4
  93. package/dist/index76.cjs +1 -1
  94. package/dist/index76.js +104 -3
  95. package/dist/index77.cjs +1 -1
  96. package/dist/index77.js +17 -8
  97. package/dist/index78.cjs +1 -1
  98. package/dist/index78.js +8 -104
  99. package/dist/index79.cjs +1 -1
  100. package/dist/index79.js +9 -16
  101. package/dist/index80.cjs +1 -1
  102. package/dist/index80.js +11 -8
  103. package/dist/index81.cjs +1 -1
  104. package/dist/index81.js +13 -10
  105. package/dist/index82.cjs +1 -1
  106. package/dist/index82.js +18 -11
  107. package/dist/index83.cjs +1 -1
  108. package/dist/index83.js +6 -13
  109. package/dist/index84.cjs +1 -1
  110. package/dist/index84.js +42 -6
  111. package/dist/index85.cjs +1 -1
  112. package/dist/index85.js +6 -6
  113. package/dist/index88.cjs +1 -1
  114. package/dist/index88.js +4 -4
  115. package/dist/index89.cjs +1 -1
  116. package/dist/index89.js +1 -1
  117. package/dist/index91.cjs +1 -1
  118. package/dist/index91.js +1 -1
  119. package/dist/index93.cjs +1 -1
  120. package/dist/index93.js +2 -2
  121. package/dist/index94.cjs +1 -1
  122. package/dist/index94.js +1 -1
  123. package/dist/index98.cjs +1 -1
  124. package/dist/index98.js +3 -3
  125. package/dist/index99.cjs +1 -1
  126. package/dist/index99.js +1 -1
  127. package/package.json +1 -1
package/dist/index89.js CHANGED
@@ -2,7 +2,7 @@ import { BytesSizeMismatchError as m } from "./index93.js";
2
2
  import { InvalidAddressError as w } from "./index32.js";
3
3
  import { InvalidDomainError as E, InvalidPrimaryTypeError as z, InvalidStructTypeError as D } from "./index99.js";
4
4
  import { isAddress as T } from "./index33.js";
5
- import { size as y } from "./index75.js";
5
+ import { size as y } from "./index73.js";
6
6
  import { numberToHex as x } from "./index24.js";
7
7
  import { integerRegex as P, bytesRegex as S } from "./index100.js";
8
8
  function j(e) {
package/dist/index91.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index62.cjs");class i extends e.BaseError{constructor({chainId:r}){super(typeof r=="number"?`Chain ID "${r}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}exports.InvalidChainIdError=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index71.cjs");class i extends e.BaseError{constructor({chainId:r}){super(typeof r=="number"?`Chain ID "${r}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}exports.InvalidChainIdError=i;
package/dist/index91.js CHANGED
@@ -1,4 +1,4 @@
1
- import { BaseError as i } from "./index62.js";
1
+ import { BaseError as i } from "./index71.js";
2
2
  class o extends i {
3
3
  constructor({ chainId: r }) {
4
4
  super(typeof r == "number" ? `Chain ID "${r}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
package/dist/index93.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index75.cjs"),n=require("./index62.cjs");class o extends n.BaseError{constructor({expectedLength:r,givenLength:e,type:t}){super([`ABI encoding array length mismatch for type ${t}.`,`Expected length: ${r}`,`Given length: ${e}`].join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index73.cjs"),n=require("./index71.cjs");class o extends n.BaseError{constructor({expectedLength:r,givenLength:e,type:t}){super([`ABI encoding array length mismatch for type ${t}.`,`Expected length: ${r}`,`Given length: ${e}`].join(`
2
2
  `),{name:"AbiEncodingArrayLengthMismatchError"})}}class a extends n.BaseError{constructor({expectedSize:r,value:e}){super(`Size of bytes "${e}" (bytes${i.size(e)}) does not match expected size (bytes${r}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class c extends n.BaseError{constructor({expectedLength:r,givenLength:e}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${r}`,`Given length (values): ${e}`].join(`
3
3
  `),{name:"AbiEncodingLengthMismatchError"})}}class d extends n.BaseError{constructor({expectedSize:r,givenSize:e}){super(`Expected bytes${r}, got bytes${e}.`,{name:"BytesSizeMismatchError"})}}class E extends n.BaseError{constructor(r,{docsPath:e}){super([`Type "${r}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
4
4
  `),{docsPath:e,name:"InvalidAbiEncodingType"})}}class g extends n.BaseError{constructor(r){super([`Value "${r}" is not a valid array.`].join(`
package/dist/index93.js CHANGED
@@ -1,5 +1,5 @@
1
- import { size as i } from "./index75.js";
2
- import { BaseError as n } from "./index62.js";
1
+ import { size as i } from "./index73.js";
2
+ import { BaseError as n } from "./index71.js";
3
3
  class c extends n {
4
4
  constructor({ expectedLength: e, givenLength: r, type: s }) {
5
5
  super([
package/dist/index94.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index95.cjs"),t=require("./index62.cjs");class i extends t.BaseError{constructor({cause:r,maxFeePerGas:e}={}){super(`The fee cap (\`maxFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:r,name:"FeeCapTooHighError"})}}Object.defineProperty(i,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class n extends t.BaseError{constructor({cause:r,maxPriorityFeePerGas:e,maxFeePerGas:o}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${o?` = ${a.formatGwei(o)} gwei`:""}).`].join(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index95.cjs"),t=require("./index71.cjs");class i extends t.BaseError{constructor({cause:r,maxFeePerGas:e}={}){super(`The fee cap (\`maxFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:r,name:"FeeCapTooHighError"})}}Object.defineProperty(i,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class n extends t.BaseError{constructor({cause:r,maxPriorityFeePerGas:e,maxFeePerGas:o}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${e?` = ${a.formatGwei(e)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${o?` = ${a.formatGwei(o)} gwei`:""}).`].join(`
2
2
  `),{cause:r,name:"TipAboveFeeCapError"})}}Object.defineProperty(n,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});exports.FeeCapTooHighError=i;exports.TipAboveFeeCapError=n;
package/dist/index94.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { formatGwei as a } from "./index95.js";
2
- import { BaseError as o } from "./index62.js";
2
+ import { BaseError as o } from "./index71.js";
3
3
  class n extends o {
4
4
  constructor({ cause: r, maxFeePerGas: e } = {}) {
5
5
  super(`The fee cap (\`maxFeePerGas\`${e ? ` = ${a(e)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
package/dist/index98.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index118.cjs"),y=require("./index110.cjs"),u=require("./index105.cjs"),B=require("./index75.cjs"),h=require("./index36.cjs"),d=require("./index24.cjs");function f(t){const a=t.to??(typeof t.data=="string"?"hex":"bytes"),n=typeof t.data=="string"?h.hexToBytes(t.data):t.data,s=B.size(n);if(!s)throw new y.EmptyBlobError;if(s>o.maxBytesPerTransaction)throw new y.BlobSizeTooLargeError({maxSize:o.maxBytesPerTransaction,size:s});const r=[];let b=!0,i=0;for(;b;){const e=u.createCursor(new Uint8Array(o.bytesPerBlob));let l=0;for(;l<o.fieldElementsPerBlob;){const c=n.slice(i,i+(o.bytesPerFieldElement-1));if(e.pushByte(0),e.pushBytes(c),c.length<31){e.pushByte(128),b=!1;break}l++,i+=31}r.push(e)}return a==="bytes"?r.map(e=>e.bytes):r.map(e=>d.bytesToHex(e.bytes))}exports.toBlobs=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index118.cjs"),y=require("./index113.cjs"),u=require("./index109.cjs"),B=require("./index73.cjs"),h=require("./index36.cjs"),d=require("./index24.cjs");function f(t){const a=t.to??(typeof t.data=="string"?"hex":"bytes"),n=typeof t.data=="string"?h.hexToBytes(t.data):t.data,s=B.size(n);if(!s)throw new y.EmptyBlobError;if(s>o.maxBytesPerTransaction)throw new y.BlobSizeTooLargeError({maxSize:o.maxBytesPerTransaction,size:s});const r=[];let b=!0,i=0;for(;b;){const e=u.createCursor(new Uint8Array(o.bytesPerBlob));let l=0;for(;l<o.fieldElementsPerBlob;){const c=n.slice(i,i+(o.bytesPerFieldElement-1));if(e.pushByte(0),e.pushBytes(c),c.length<31){e.pushByte(128),b=!1;break}l++,i+=31}r.push(e)}return a==="bytes"?r.map(e=>e.bytes):r.map(e=>d.bytesToHex(e.bytes))}exports.toBlobs=f;
package/dist/index98.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { maxBytesPerTransaction as y, bytesPerBlob as a, fieldElementsPerBlob as f, bytesPerFieldElement as p } from "./index118.js";
2
- import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index110.js";
3
- import { createCursor as B } from "./index105.js";
4
- import { size as u } from "./index75.js";
2
+ import { EmptyBlobError as c, BlobSizeTooLargeError as h } from "./index113.js";
3
+ import { createCursor as B } from "./index109.js";
4
+ import { size as u } from "./index73.js";
5
5
  import { hexToBytes as x } from "./index36.js";
6
6
  import { bytesToHex as d } from "./index24.js";
7
7
  function S(e) {
package/dist/index99.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index57.cjs"),e=require("./index62.cjs");class i extends e.BaseError{constructor({domain:r}){super(`Invalid domain "${s.stringify(r)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class o extends e.BaseError{constructor({primaryType:r,types:a}){super(`Invalid primary type \`${r}\` must be one of \`${JSON.stringify(Object.keys(a))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class n extends e.BaseError{constructor({type:r}){super(`Struct type "${r}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}exports.InvalidDomainError=i;exports.InvalidPrimaryTypeError=o;exports.InvalidStructTypeError=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index57.cjs"),e=require("./index71.cjs");class i extends e.BaseError{constructor({domain:r}){super(`Invalid domain "${s.stringify(r)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class o extends e.BaseError{constructor({primaryType:r,types:a}){super(`Invalid primary type \`${r}\` must be one of \`${JSON.stringify(Object.keys(a))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class n extends e.BaseError{constructor({type:r}){super(`Struct type "${r}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}exports.InvalidDomainError=i;exports.InvalidPrimaryTypeError=o;exports.InvalidStructTypeError=n;
package/dist/index99.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { stringify as a } from "./index57.js";
2
- import { BaseError as t } from "./index62.js";
2
+ import { BaseError as t } from "./index71.js";
3
3
  class n extends t {
4
4
  constructor({ domain: r }) {
5
5
  super(`Invalid domain "${a(r)}".`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gardenfi/utils",
3
- "version": "2.0.6-beta.18",
3
+ "version": "2.0.6-beta.19",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "vite build",