@pufferfinance/puffer-sdk 1.30.2 → 1.31.1

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 (155) hide show
  1. package/dist/api/puffer-client-helpers.cjs +1 -1
  2. package/dist/api/puffer-client-helpers.cjs.map +1 -1
  3. package/dist/api/puffer-client-helpers.js +42 -42
  4. package/dist/api/puffer-client-helpers.js.map +1 -1
  5. package/dist/api/puffer-client.cjs +1 -1
  6. package/dist/api/puffer-client.js +2 -2
  7. package/dist/ccip-DLz1DupU.cjs +2 -0
  8. package/dist/ccip-DLz1DupU.cjs.map +1 -0
  9. package/dist/ccip-oHxlHOaH.js +158 -0
  10. package/dist/ccip-oHxlHOaH.js.map +1 -0
  11. package/dist/chains/constants.cjs +1 -1
  12. package/dist/chains/constants.d.ts +2 -1
  13. package/dist/chains/constants.js +1 -1
  14. package/dist/constants-C-rrOSfg.js +3837 -0
  15. package/dist/constants-C-rrOSfg.js.map +1 -0
  16. package/dist/constants-PXB3A4Yl.cjs +38 -0
  17. package/dist/constants-PXB3A4Yl.cjs.map +1 -0
  18. package/dist/contracts/abis/mainnet/Teller.cjs +1 -1
  19. package/dist/contracts/abis/mainnet/Teller.cjs.map +1 -1
  20. package/dist/contracts/abis/mainnet/Teller.d.ts +234 -18
  21. package/dist/contracts/abis/mainnet/Teller.js +165 -13
  22. package/dist/contracts/abis/mainnet/Teller.js.map +1 -1
  23. package/dist/contracts/addresses.cjs +1 -1
  24. package/dist/contracts/addresses.js +1 -1
  25. package/dist/contracts/handlers/carrot-staking-handler.cjs +1 -1
  26. package/dist/contracts/handlers/carrot-staking-handler.d.ts +1549 -5281
  27. package/dist/contracts/handlers/carrot-staking-handler.js +2 -2
  28. package/dist/contracts/handlers/carrot-vesting-handler.cjs +1 -1
  29. package/dist/contracts/handlers/carrot-vesting-handler.d.ts +1549 -5281
  30. package/dist/contracts/handlers/carrot-vesting-handler.js +2 -2
  31. package/dist/contracts/handlers/concrete-vault-handler.cjs +1 -1
  32. package/dist/contracts/handlers/concrete-vault-handler.d.ts +1549 -5281
  33. package/dist/contracts/handlers/concrete-vault-handler.js +2 -2
  34. package/dist/contracts/handlers/distributor-handler.cjs +1 -1
  35. package/dist/contracts/handlers/distributor-handler.d.ts +1549 -5281
  36. package/dist/contracts/handlers/distributor-handler.js +2 -2
  37. package/dist/contracts/handlers/erc20-permit-handler.cjs +1 -1
  38. package/dist/contracts/handlers/erc20-permit-handler.cjs.map +1 -1
  39. package/dist/contracts/handlers/erc20-permit-handler.d.ts +1549 -5281
  40. package/dist/contracts/handlers/erc20-permit-handler.js +3 -3
  41. package/dist/contracts/handlers/erc20-permit-handler.js.map +1 -1
  42. package/dist/contracts/handlers/gauge-registry-handler.cjs +1 -1
  43. package/dist/contracts/handlers/gauge-registry-handler.d.ts +1549 -5281
  44. package/dist/contracts/handlers/gauge-registry-handler.js +2 -2
  45. package/dist/contracts/handlers/guardian-module-handler.cjs +1 -1
  46. package/dist/contracts/handlers/guardian-module-handler.d.ts +1549 -5281
  47. package/dist/contracts/handlers/guardian-module-handler.js +2 -2
  48. package/dist/contracts/handlers/institutional-access-manager-handler.cjs +1 -1
  49. package/dist/contracts/handlers/institutional-access-manager-handler.cjs.map +1 -1
  50. package/dist/contracts/handlers/institutional-access-manager-handler.d.ts +1549 -5281
  51. package/dist/contracts/handlers/institutional-access-manager-handler.js +48 -49
  52. package/dist/contracts/handlers/institutional-access-manager-handler.js.map +1 -1
  53. package/dist/contracts/handlers/institutional-vault-handler.cjs +1 -1
  54. package/dist/contracts/handlers/institutional-vault-handler.d.ts +1549 -5281
  55. package/dist/contracts/handlers/institutional-vault-handler.js +2 -2
  56. package/dist/contracts/handlers/l1-reward-manager-handler.cjs +1 -1
  57. package/dist/contracts/handlers/l1-reward-manager-handler.d.ts +1549 -5281
  58. package/dist/contracts/handlers/l1-reward-manager-handler.js +2 -2
  59. package/dist/contracts/handlers/l2-reward-manager-handler.cjs +1 -1
  60. package/dist/contracts/handlers/l2-reward-manager-handler.d.ts +1549 -5281
  61. package/dist/contracts/handlers/l2-reward-manager-handler.js +2 -2
  62. package/dist/contracts/handlers/lagoon-vault-handler.cjs +1 -1
  63. package/dist/contracts/handlers/lagoon-vault-handler.d.ts +1549 -5281
  64. package/dist/contracts/handlers/lagoon-vault-handler.js +2 -2
  65. package/dist/contracts/handlers/mtw-carrot-handler.cjs +1 -1
  66. package/dist/contracts/handlers/mtw-carrot-handler.d.ts +1549 -5281
  67. package/dist/contracts/handlers/mtw-carrot-handler.js +2 -2
  68. package/dist/contracts/handlers/non-restaking-withdrawal-credentials-handler.cjs +1 -1
  69. package/dist/contracts/handlers/non-restaking-withdrawal-credentials-handler.d.ts +1549 -5281
  70. package/dist/contracts/handlers/non-restaking-withdrawal-credentials-handler.js +2 -2
  71. package/dist/contracts/handlers/nucleus-accountant-handler.cjs +1 -1
  72. package/dist/contracts/handlers/nucleus-accountant-handler.d.ts +1549 -5281
  73. package/dist/contracts/handlers/nucleus-accountant-handler.js +1 -1
  74. package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs +1 -1
  75. package/dist/contracts/handlers/nucleus-atomic-queue-handler.d.ts +1549 -5281
  76. package/dist/contracts/handlers/nucleus-atomic-queue-handler.js +2 -2
  77. package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs +1 -1
  78. package/dist/contracts/handlers/nucleus-boring-vault-handler.d.ts +1549 -5281
  79. package/dist/contracts/handlers/nucleus-boring-vault-handler.js +2 -2
  80. package/dist/contracts/handlers/nucleus-teller-handler.cjs +1 -1
  81. package/dist/contracts/handlers/nucleus-teller-handler.cjs.map +1 -1
  82. package/dist/contracts/handlers/nucleus-teller-handler.d.ts +1820 -5316
  83. package/dist/contracts/handlers/nucleus-teller-handler.js +63 -48
  84. package/dist/contracts/handlers/nucleus-teller-handler.js.map +1 -1
  85. package/dist/contracts/handlers/puf-locker-handler.cjs +1 -1
  86. package/dist/contracts/handlers/puf-locker-handler.d.ts +1549 -5281
  87. package/dist/contracts/handlers/puf-locker-handler.js +2 -2
  88. package/dist/contracts/handlers/puffer-depositor-handler.cjs +1 -1
  89. package/dist/contracts/handlers/puffer-depositor-handler.d.ts +1549 -5281
  90. package/dist/contracts/handlers/puffer-depositor-handler.js +2 -2
  91. package/dist/contracts/handlers/puffer-l2-depositor-handler.cjs +1 -1
  92. package/dist/contracts/handlers/puffer-l2-depositor-handler.d.ts +1549 -5281
  93. package/dist/contracts/handlers/puffer-l2-depositor-handler.js +2 -2
  94. package/dist/contracts/handlers/puffer-oracle-v2-handler.cjs +1 -1
  95. package/dist/contracts/handlers/puffer-oracle-v2-handler.d.ts +1549 -5281
  96. package/dist/contracts/handlers/puffer-oracle-v2-handler.js +2 -2
  97. package/dist/contracts/handlers/puffer-protocol-handler.cjs +1 -1
  98. package/dist/contracts/handlers/puffer-protocol-handler.d.ts +1549 -5281
  99. package/dist/contracts/handlers/puffer-protocol-handler.js +2 -2
  100. package/dist/contracts/handlers/puffer-vault-handler.cjs +1 -1
  101. package/dist/contracts/handlers/puffer-vault-handler.d.ts +1549 -5281
  102. package/dist/contracts/handlers/puffer-vault-handler.js +2 -2
  103. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.cjs +1 -1
  104. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.d.ts +1549 -5281
  105. package/dist/contracts/handlers/puffer-withdrawal-manager-handler.js +2 -2
  106. package/dist/contracts/handlers/validator-ticket-handler.cjs +1 -1
  107. package/dist/contracts/handlers/validator-ticket-handler.d.ts +1549 -5281
  108. package/dist/contracts/handlers/validator-ticket-handler.js +2 -2
  109. package/dist/contracts/handlers/vl-puffer-handler.cjs +1 -1
  110. package/dist/contracts/handlers/vl-puffer-handler.d.ts +1549 -5281
  111. package/dist/contracts/handlers/vl-puffer-handler.js +2 -2
  112. package/dist/contracts/tokens.cjs +1 -1
  113. package/dist/contracts/tokens.js +1 -1
  114. package/dist/contracts/vaults-addresses.cjs +1 -1
  115. package/dist/contracts/vaults-addresses.js +1 -1
  116. package/dist/{getContract-Cgkj3G1g.cjs → getContract-BL-M-dQc.cjs} +2 -2
  117. package/dist/{getContract-Cgkj3G1g.cjs.map → getContract-BL-M-dQc.cjs.map} +1 -1
  118. package/dist/{getContract-Dxh0At3n.js → getContract-BVdsHXdp.js} +11 -11
  119. package/dist/{getContract-Dxh0At3n.js.map → getContract-BVdsHXdp.js.map} +1 -1
  120. package/dist/http-BtVgpo6v.cjs +5 -0
  121. package/dist/http-BtVgpo6v.cjs.map +1 -0
  122. package/dist/{http-Clq2Hoy9.js → http-CJGQ2e7o.js} +1687 -1533
  123. package/dist/http-CJGQ2e7o.js.map +1 -0
  124. package/dist/{localBatchGatewayRequest-Dm7yXllz.js → localBatchGatewayRequest-BchhbxQ2.js} +18 -18
  125. package/dist/{localBatchGatewayRequest-Dm7yXllz.js.map → localBatchGatewayRequest-BchhbxQ2.js.map} +1 -1
  126. package/dist/{localBatchGatewayRequest-CuvkLo7E.cjs → localBatchGatewayRequest-Bz0YuhIJ.cjs} +2 -2
  127. package/dist/{localBatchGatewayRequest-CuvkLo7E.cjs.map → localBatchGatewayRequest-Bz0YuhIJ.cjs.map} +1 -1
  128. package/dist/main.cjs +1 -1
  129. package/dist/main.js +1 -1
  130. package/dist/{secp256k1-BbMQ_WWG.js → secp256k1-Bm3EstvG.js} +62 -62
  131. package/dist/{secp256k1-BbMQ_WWG.js.map → secp256k1-Bm3EstvG.js.map} +1 -1
  132. package/dist/{secp256k1-DrUar53F.cjs → secp256k1-cRXUqGNw.cjs} +2 -2
  133. package/dist/{secp256k1-DrUar53F.cjs.map → secp256k1-cRXUqGNw.cjs.map} +1 -1
  134. package/dist/utils/version.cjs +1 -1
  135. package/dist/utils/version.js +1 -1
  136. package/dist/writeContract-D9xqoPDa.js +3527 -0
  137. package/dist/writeContract-D9xqoPDa.js.map +1 -0
  138. package/dist/writeContract-Gli_t0c1.cjs +6 -0
  139. package/dist/writeContract-Gli_t0c1.cjs.map +1 -0
  140. package/package.json +13 -13
  141. package/dist/ccip-BTVr5-VZ.js +0 -150
  142. package/dist/ccip-BTVr5-VZ.js.map +0 -1
  143. package/dist/ccip-DNgt9tzv.cjs +0 -2
  144. package/dist/ccip-DNgt9tzv.cjs.map +0 -1
  145. package/dist/constants-CUYeD71n.js +0 -2491
  146. package/dist/constants-CUYeD71n.js.map +0 -1
  147. package/dist/constants-Dhpa19or.cjs +0 -8
  148. package/dist/constants-Dhpa19or.cjs.map +0 -1
  149. package/dist/http-C-TIpf-V.cjs +0 -5
  150. package/dist/http-C-TIpf-V.cjs.map +0 -1
  151. package/dist/http-Clq2Hoy9.js.map +0 -1
  152. package/dist/writeContract-Bq8HaVjW.js +0 -4618
  153. package/dist/writeContract-Bq8HaVjW.js.map +0 -1
  154. package/dist/writeContract-PoCaxmyT.cjs +0 -36
  155. package/dist/writeContract-PoCaxmyT.cjs.map +0 -1
@@ -1,14 +1,14 @@
1
- import { t as w, n as b, A as y, o as A, p as g, q as l, u as F, l as E, v as m, x as N, I as P, y as f, z as I } from "./writeContract-Bq8HaVjW.js";
2
- import { d as h, e as R } from "./constants-CUYeD71n.js";
1
+ import { h as f } from "./writeContract-D9xqoPDa.js";
2
+ import { m as l, o as w, q as b, A as y, r as A, u as g, v as m, w as F, i as E, x as N, y as h, z as P, I, D as R } from "./constants-C-rrOSfg.js";
3
3
  function q(n) {
4
- const { abi: r, data: a } = n, e = h(a, 0, 4), t = r.find((o) => o.type === "function" && e === w(b(o)));
4
+ const { abi: r, data: a } = n, e = l(a, 0, 4), t = r.find((o) => o.type === "function" && e === w(b(o)));
5
5
  if (!t)
6
6
  throw new y(e, {
7
7
  docsPath: "/docs/contract/decodeFunctionData"
8
8
  });
9
9
  return {
10
10
  functionName: t.name,
11
- args: "inputs" in t && t.inputs && t.inputs.length > 0 ? A(t.inputs, h(a, 4)) : void 0
11
+ args: "inputs" in t && t.inputs && t.inputs.length > 0 ? A(t.inputs, l(a, 4)) : void 0
12
12
  };
13
13
  }
14
14
  const u = "/docs/contract/encodeErrorResult";
@@ -18,11 +18,11 @@ function p(n) {
18
18
  if (a) {
19
19
  const c = g({ abi: r, args: e, name: a });
20
20
  if (!c)
21
- throw new l(a, { docsPath: u });
21
+ throw new m(a, { docsPath: u });
22
22
  t = c;
23
23
  }
24
24
  if (t.type !== "error")
25
- throw new l(void 0, { docsPath: u });
25
+ throw new m(void 0, { docsPath: u });
26
26
  const o = b(t), s = w(o);
27
27
  let i = "0x";
28
28
  if (e && e.length > 0) {
@@ -30,7 +30,7 @@ function p(n) {
30
30
  throw new F(t.name, { docsPath: u });
31
31
  i = E(t.inputs, e);
32
32
  }
33
- return R([s, i]);
33
+ return N([s, i]);
34
34
  }
35
35
  const d = "/docs/contract/encodeFunctionResult";
36
36
  function x(n) {
@@ -39,13 +39,13 @@ function x(n) {
39
39
  if (a) {
40
40
  const s = g({ abi: r, name: a });
41
41
  if (!s)
42
- throw new m(a, { docsPath: d });
42
+ throw new h(a, { docsPath: d });
43
43
  t = s;
44
44
  }
45
45
  if (t.type !== "function")
46
- throw new m(void 0, { docsPath: d });
46
+ throw new h(void 0, { docsPath: d });
47
47
  if (!t.outputs)
48
- throw new N(t.name, { docsPath: d });
48
+ throw new P(t.name, { docsPath: d });
49
49
  const o = (() => {
50
50
  if (t.outputs.length === 0)
51
51
  return [];
@@ -53,18 +53,18 @@ function x(n) {
53
53
  return [e];
54
54
  if (Array.isArray(e))
55
55
  return e;
56
- throw new P(e);
56
+ throw new I(e);
57
57
  })();
58
58
  return E(t.outputs, o);
59
59
  }
60
60
  const v = "x-batch-gateway:true";
61
- async function G(n) {
61
+ async function D(n) {
62
62
  const { data: r, ccipRequest: a } = n, { args: [e] } = q({ abi: f, data: r }), t = [], o = [];
63
63
  return await Promise.all(e.map(async (s, i) => {
64
64
  try {
65
- o[i] = s.urls.includes(v) ? await G({ data: s.data, ccipRequest: a }) : await a(s), t[i] = !1;
65
+ o[i] = s.urls.includes(v) ? await D({ data: s.data, ccipRequest: a }) : await a(s), t[i] = !1;
66
66
  } catch (c) {
67
- t[i] = !0, o[i] = H(c);
67
+ t[i] = !0, o[i] = G(c);
68
68
  }
69
69
  })), x({
70
70
  abi: f,
@@ -72,19 +72,19 @@ async function G(n) {
72
72
  result: [t, o]
73
73
  });
74
74
  }
75
- function H(n) {
75
+ function G(n) {
76
76
  return n.name === "HttpRequestError" && n.status ? p({
77
77
  abi: f,
78
78
  errorName: "HttpError",
79
79
  args: [n.status, n.shortMessage]
80
80
  }) : p({
81
- abi: [I],
81
+ abi: [R],
82
82
  errorName: "Error",
83
83
  args: ["shortMessage" in n ? n.shortMessage : n.message]
84
84
  });
85
85
  }
86
86
  export {
87
- G as a,
87
+ D as a,
88
88
  v as l
89
89
  };
90
- //# sourceMappingURL=localBatchGatewayRequest-Dm7yXllz.js.map
90
+ //# sourceMappingURL=localBatchGatewayRequest-BchhbxQ2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"localBatchGatewayRequest-Dm7yXllz.js","sources":["../node_modules/.pnpm/viem@2.45.0_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/decodeFunctionData.js","../node_modules/.pnpm/viem@2.45.0_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/encodeErrorResult.js","../node_modules/.pnpm/viem@2.45.0_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/encodeFunctionResult.js","../node_modules/.pnpm/viem@2.45.0_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js"],"sourcesContent":["import { AbiFunctionSignatureNotFoundError } from '../../errors/abi.js';\nimport { slice } from '../data/slice.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { decodeAbiParameters, } from './decodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nexport function decodeFunctionData(parameters) {\n const { abi, data } = parameters;\n const signature = slice(data, 0, 4);\n const description = abi.find((x) => x.type === 'function' &&\n signature === toFunctionSelector(formatAbiItem(x)));\n if (!description)\n throw new AbiFunctionSignatureNotFoundError(signature, {\n docsPath: '/docs/contract/decodeFunctionData',\n });\n return {\n functionName: description.name,\n args: ('inputs' in description &&\n description.inputs &&\n description.inputs.length > 0\n ? decodeAbiParameters(description.inputs, slice(data, 4))\n : undefined),\n };\n}\n//# sourceMappingURL=decodeFunctionData.js.map","import { AbiErrorInputsNotFoundError, AbiErrorNotFoundError, } from '../../errors/abi.js';\nimport { concatHex } from '../data/concat.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeErrorResult';\nexport function encodeErrorResult(parameters) {\n const { abi, errorName, args } = parameters;\n let abiItem = abi[0];\n if (errorName) {\n const item = getAbiItem({ abi, args, name: errorName });\n if (!item)\n throw new AbiErrorNotFoundError(errorName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'error')\n throw new AbiErrorNotFoundError(undefined, { docsPath });\n const definition = formatAbiItem(abiItem);\n const signature = toFunctionSelector(definition);\n let data = '0x';\n if (args && args.length > 0) {\n if (!abiItem.inputs)\n throw new AbiErrorInputsNotFoundError(abiItem.name, { docsPath });\n data = encodeAbiParameters(abiItem.inputs, args);\n }\n return concatHex([signature, data]);\n}\n//# sourceMappingURL=encodeErrorResult.js.map","import { AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, InvalidArrayError, } from '../../errors/abi.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeFunctionResult';\nexport function encodeFunctionResult(parameters) {\n const { abi, functionName, result } = parameters;\n let abiItem = abi[0];\n if (functionName) {\n const item = getAbiItem({ abi, name: functionName });\n if (!item)\n throw new AbiFunctionNotFoundError(functionName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'function')\n throw new AbiFunctionNotFoundError(undefined, { docsPath });\n if (!abiItem.outputs)\n throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath });\n const values = (() => {\n if (abiItem.outputs.length === 0)\n return [];\n if (abiItem.outputs.length === 1)\n return [result];\n if (Array.isArray(result))\n return result;\n throw new InvalidArrayError(result);\n })();\n return encodeAbiParameters(abiItem.outputs, values);\n}\n//# sourceMappingURL=encodeFunctionResult.js.map","import { batchGatewayAbi } from '../../constants/abis.js';\nimport { solidityError } from '../../constants/solidity.js';\nimport { decodeFunctionData } from '../abi/decodeFunctionData.js';\nimport { encodeErrorResult } from '../abi/encodeErrorResult.js';\nimport { encodeFunctionResult } from '../abi/encodeFunctionResult.js';\nexport const localBatchGatewayUrl = 'x-batch-gateway:true';\nexport async function localBatchGatewayRequest(parameters) {\n const { data, ccipRequest } = parameters;\n const { args: [queries], } = decodeFunctionData({ abi: batchGatewayAbi, data });\n const failures = [];\n const responses = [];\n await Promise.all(queries.map(async (query, i) => {\n try {\n responses[i] = query.urls.includes(localBatchGatewayUrl)\n ? await localBatchGatewayRequest({ data: query.data, ccipRequest })\n : await ccipRequest(query);\n failures[i] = false;\n }\n catch (err) {\n failures[i] = true;\n responses[i] = encodeError(err);\n }\n }));\n return encodeFunctionResult({\n abi: batchGatewayAbi,\n functionName: 'query',\n result: [failures, responses],\n });\n}\nfunction encodeError(error) {\n if (error.name === 'HttpRequestError' && error.status)\n return encodeErrorResult({\n abi: batchGatewayAbi,\n errorName: 'HttpError',\n args: [error.status, error.shortMessage],\n });\n return encodeErrorResult({\n abi: [solidityError],\n errorName: 'Error',\n args: ['shortMessage' in error ? error.shortMessage : error.message],\n });\n}\n//# sourceMappingURL=localBatchGatewayRequest.js.map"],"names":["decodeFunctionData","parameters","abi","data","signature","slice","description","x","toFunctionSelector","formatAbiItem","AbiFunctionSignatureNotFoundError","decodeAbiParameters","docsPath","encodeErrorResult","errorName","args","abiItem","item","getAbiItem","AbiErrorNotFoundError","definition","AbiErrorInputsNotFoundError","encodeAbiParameters","concatHex","encodeFunctionResult","functionName","result","AbiFunctionNotFoundError","AbiFunctionOutputsNotFoundError","values","InvalidArrayError","localBatchGatewayUrl","localBatchGatewayRequest","ccipRequest","queries","batchGatewayAbi","failures","responses","query","err","encodeError","error","solidityError"],"mappings":";;AAKO,SAASA,EAAmBC,GAAY;AAC3C,QAAM,EAAE,KAAAC,GAAK,MAAAC,EAAI,IAAKF,GAChBG,IAAYC,EAAMF,GAAM,GAAG,CAAC,GAC5BG,IAAcJ,EAAI,KAAK,CAACK,MAAMA,EAAE,SAAS,cAC3CH,MAAcI,EAAmBC,EAAcF,CAAC,CAAC,CAAC;AACtD,MAAI,CAACD;AACD,UAAM,IAAII,EAAkCN,GAAW;AAAA,MACnD,UAAU;AAAA,IACtB,CAAS;AACL,SAAO;AAAA,IACH,cAAcE,EAAY;AAAA,IAC1B,MAAO,YAAYA,KACfA,EAAY,UACZA,EAAY,OAAO,SAAS,IAC1BK,EAAoBL,EAAY,QAAQD,EAAMF,GAAM,CAAC,CAAC,IACtD;AAAA,EACd;AACA;AChBA,MAAMS,IAAW;AACV,SAASC,EAAkBZ,GAAY;AAC1C,QAAM,EAAE,KAAAC,GAAK,WAAAY,GAAW,MAAAC,EAAI,IAAKd;AACjC,MAAIe,IAAUd,EAAI,CAAC;AACnB,MAAIY,GAAW;AACX,UAAMG,IAAOC,EAAW,EAAE,KAAAhB,GAAK,MAAAa,GAAM,MAAMD,GAAW;AACtD,QAAI,CAACG;AACD,YAAM,IAAIE,EAAsBL,GAAW,EAAA,UAAEF,EAAQ,CAAE;AAC3D,IAAAI,IAAUC;AAAA,EACd;AACA,MAAID,EAAQ,SAAS;AACjB,UAAM,IAAIG,EAAsB,QAAW,EAAA,UAAEP,EAAQ,CAAE;AAC3D,QAAMQ,IAAaX,EAAcO,CAAO,GAClCZ,IAAYI,EAAmBY,CAAU;AAC/C,MAAIjB,IAAO;AACX,MAAIY,KAAQA,EAAK,SAAS,GAAG;AACzB,QAAI,CAAC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AM,QAAQ,IAAIH,EAAQ,IAAI,OAAOI,GAAO,MAAM;AAC9C,QAAI;AACA,MAAAD,EAAU,CAAC,IAAIC,EAAM,KAAK,SAASP,CAAoB,IACjD,MAAMC,EAAyB,EAAE,MAAMM,EAAM,MAAM,aAAAL,EAAW,CAAE,IAChE,MAAMA,EAAYK,CAAK,GAC7BF,EAAS,CAAC,IAAI;AAAA,IAClB,SACOG,GAAK;AACR,MAAAH,EAAS,CAAC,IAAI,IACdC,EAAU,CAAC,IAAIG,EAAYD,CAAG;AAAA,IAClC;AAAA,EACJ,CAAC,CAAC,GACKf,EAAqB;AAAA,IACxB,KAAKW;AAAA,IACL,cAAc;AAAA,IACd,QAAQ,CAACC,GAAUC,CAAS;AAAA,EACpC,CAAK;AACL;AACA,SAASG,EAAYC,GAAO;AACxB,SAAIA,EAAM,SAAS,sBAAsBA,EAAM,SACpC5B,EAAkB;AAAA,IACrB,KAAKsB;AAAA,IACL,WAAW;AAAA,IACX,MAAM,CAACM,EAAM,QAAQA,EAAM,YAAY;AAAA,EACnD,CAAS,IACE5B,EAAkB;AAAA,IACrB,KAAK,CAAC6B,CAAa;AAAA,IACnB,WAAW;AAAA,IACX,MAAM,CAAC,kBAAkBD,IAAQA,EAAM,eAAeA,EAAM,OAAO;AAAA,EAC3E,CAAK;AACL;","x_google_ignoreList":[0,1,2,3]}
1
+ {"version":3,"file":"localBatchGatewayRequest-BchhbxQ2.js","sources":["../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/decodeFunctionData.js","../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/encodeErrorResult.js","../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/encodeFunctionResult.js","../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js"],"sourcesContent":["import { AbiFunctionSignatureNotFoundError } from '../../errors/abi.js';\nimport { slice } from '../data/slice.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { decodeAbiParameters, } from './decodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nexport function decodeFunctionData(parameters) {\n const { abi, data } = parameters;\n const signature = slice(data, 0, 4);\n const description = abi.find((x) => x.type === 'function' &&\n signature === toFunctionSelector(formatAbiItem(x)));\n if (!description)\n throw new AbiFunctionSignatureNotFoundError(signature, {\n docsPath: '/docs/contract/decodeFunctionData',\n });\n return {\n functionName: description.name,\n args: ('inputs' in description &&\n description.inputs &&\n description.inputs.length > 0\n ? decodeAbiParameters(description.inputs, slice(data, 4))\n : undefined),\n };\n}\n//# sourceMappingURL=decodeFunctionData.js.map","import { AbiErrorInputsNotFoundError, AbiErrorNotFoundError, } from '../../errors/abi.js';\nimport { concatHex } from '../data/concat.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeErrorResult';\nexport function encodeErrorResult(parameters) {\n const { abi, errorName, args } = parameters;\n let abiItem = abi[0];\n if (errorName) {\n const item = getAbiItem({ abi, args, name: errorName });\n if (!item)\n throw new AbiErrorNotFoundError(errorName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'error')\n throw new AbiErrorNotFoundError(undefined, { docsPath });\n const definition = formatAbiItem(abiItem);\n const signature = toFunctionSelector(definition);\n let data = '0x';\n if (args && args.length > 0) {\n if (!abiItem.inputs)\n throw new AbiErrorInputsNotFoundError(abiItem.name, { docsPath });\n data = encodeAbiParameters(abiItem.inputs, args);\n }\n return concatHex([signature, data]);\n}\n//# sourceMappingURL=encodeErrorResult.js.map","import { AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, InvalidArrayError, } from '../../errors/abi.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeFunctionResult';\nexport function encodeFunctionResult(parameters) {\n const { abi, functionName, result } = parameters;\n let abiItem = abi[0];\n if (functionName) {\n const item = getAbiItem({ abi, name: functionName });\n if (!item)\n throw new AbiFunctionNotFoundError(functionName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'function')\n throw new AbiFunctionNotFoundError(undefined, { docsPath });\n if (!abiItem.outputs)\n throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath });\n const values = (() => {\n if (abiItem.outputs.length === 0)\n return [];\n if (abiItem.outputs.length === 1)\n return [result];\n if (Array.isArray(result))\n return result;\n throw new InvalidArrayError(result);\n })();\n return encodeAbiParameters(abiItem.outputs, values);\n}\n//# sourceMappingURL=encodeFunctionResult.js.map","import { batchGatewayAbi } from '../../constants/abis.js';\nimport { solidityError } from '../../constants/solidity.js';\nimport { decodeFunctionData } from '../abi/decodeFunctionData.js';\nimport { encodeErrorResult } from '../abi/encodeErrorResult.js';\nimport { encodeFunctionResult } from '../abi/encodeFunctionResult.js';\nexport const localBatchGatewayUrl = 'x-batch-gateway:true';\nexport async function localBatchGatewayRequest(parameters) {\n const { data, ccipRequest } = parameters;\n const { args: [queries], } = decodeFunctionData({ abi: batchGatewayAbi, data });\n const failures = [];\n const responses = [];\n await Promise.all(queries.map(async (query, i) => {\n try {\n responses[i] = query.urls.includes(localBatchGatewayUrl)\n ? await localBatchGatewayRequest({ data: query.data, ccipRequest })\n : await ccipRequest(query);\n failures[i] = false;\n }\n catch (err) {\n failures[i] = true;\n responses[i] = encodeError(err);\n }\n }));\n return encodeFunctionResult({\n abi: batchGatewayAbi,\n functionName: 'query',\n result: [failures, responses],\n });\n}\nfunction encodeError(error) {\n if (error.name === 'HttpRequestError' && error.status)\n return encodeErrorResult({\n abi: batchGatewayAbi,\n errorName: 'HttpError',\n args: [error.status, error.shortMessage],\n });\n return encodeErrorResult({\n abi: [solidityError],\n errorName: 'Error',\n args: ['shortMessage' in error ? error.shortMessage : error.message],\n });\n}\n//# sourceMappingURL=localBatchGatewayRequest.js.map"],"names":["decodeFunctionData","parameters","abi","data","signature","slice","description","x","toFunctionSelector","formatAbiItem","AbiFunctionSignatureNotFoundError","decodeAbiParameters","docsPath","encodeErrorResult","errorName","args","abiItem","item","getAbiItem","AbiErrorNotFoundError","definition","AbiErrorInputsNotFoundError","encodeAbiParameters","concatHex","encodeFunctionResult","functionName","result","AbiFunctionNotFoundError","AbiFunctionOutputsNotFoundError","values","InvalidArrayError","localBatchGatewayUrl","localBatchGatewayRequest","ccipRequest","queries","batchGatewayAbi","failures","responses","query","err","encodeError","error","solidityError"],"mappings":";;AAKO,SAASA,EAAmBC,GAAY;AAC3C,QAAM,EAAE,KAAAC,GAAK,MAAAC,EAAI,IAAKF,GAChBG,IAAYC,EAAMF,GAAM,GAAG,CAAC,GAC5BG,IAAcJ,EAAI,KAAK,CAACK,MAAMA,EAAE,SAAS,cAC3CH,MAAcI,EAAmBC,EAAcF,CAAC,CAAC,CAAC;AACtD,MAAI,CAACD;AACD,UAAM,IAAII,EAAkCN,GAAW;AAAA,MACnD,UAAU;AAAA,IACtB,CAAS;AACL,SAAO;AAAA,IACH,cAAcE,EAAY;AAAA,IAC1B,MAAO,YAAYA,KACfA,EAAY,UACZA,EAAY,OAAO,SAAS,IAC1BK,EAAoBL,EAAY,QAAQD,EAAMF,GAAM,CAAC,CAAC,IACtD;AAAA,EACd;AACA;AChBA,MAAMS,IAAW;AACV,SAASC,EAAkBZ,GAAY;AAC1C,QAAM,EAAE,KAAAC,GAAK,WAAAY,GAAW,MAAAC,EAAI,IAAKd;AACjC,MAAIe,IAAUd,EAAI,CAAC;AACnB,MAAIY,GAAW;AACX,UAAMG,IAAOC,EAAW,EAAE,KAAAhB,GAAK,MAAAa,GAAM,MAAMD,GAAW;AACtD,QAAI,CAACG;AACD,YAAM,IAAIE,EAAsBL,G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AACD,SAAOJ,EAAoBN,EAAQ,SAASa,CAAM;AACtD;ACtBY,MAACE,IAAuB;AAC7B,eAAeC,EAAyB/B,GAAY;AACvD,QAAM,EAAE,MAAAE,GAAM,aAAA8B,EAAW,IAAKhC,GACxB,EAAE,MAAM,CAACiC,CAAO,EAAC,IAAMlC,EAAmB,EAAE,KAAKmC,GAAiB,MAAAhC,GAAM,GACxEiC,IAAW,CAAA,GACXC,IAAY,CAAA;AAClB,eAAM,QAAQ,IAAIH,EAAQ,IAAI,OAAOI,GAAO,MAAM;AAC9C,QAAI;AACA,MAAAD,EAAU,CAAC,IAAIC,EAAM,KAAK,SAASP,CAAoB,IACjD,MAAMC,EAAyB,EAAE,MAAMM,EAAM,MAAM,aAAAL,EAAW,CAAE,IAChE,MAAMA,EAAYK,CAAK,GAC7BF,EAAS,CAAC,IAAI;AAAA,IAClB,SACOG,GAAK;AACR,MAAAH,EAAS,CAAC,IAAI,IACdC,EAAU,CAAC,IAAIG,EAAYD,CAAG;AAAA,IAClC;AAAA,EACJ,CAAC,CAAC,GACKf,EAAqB;AAAA,IACxB,KAAKW;AAAA,IACL,cAAc;AAAA,IACd,QAAQ,CAACC,GAAUC,CAAS;AAAA,EACpC,CAAK;AACL;AACA,SAASG,EAAYC,GAAO;AACxB,SAAIA,EAAM,SAAS,sBAAsBA,EAAM,SACpC5B,EAAkB;AAAA,IACrB,KAAKsB;AAAA,IACL,WAAW;AAAA,IACX,MAAM,CAACM,EAAM,QAAQA,EAAM,YAAY;AAAA,EACnD,CAAS,IACE5B,EAAkB;AAAA,IACrB,KAAK,CAAC6B,CAAa;AAAA,IACnB,WAAW;AAAA,IACX,MAAM,CAAC,kBAAkBD,IAAQA,EAAM,eAAeA,EAAM,OAAO;AAAA,EAC3E,CAAK;AACL;","x_google_ignoreList":[0,1,2,3]}
@@ -1,2 +1,2 @@
1
- "use strict";const e=require("./writeContract-PoCaxmyT.cjs"),f=require("./constants-Dhpa19or.cjs");function w(n){const{abi:i,data:o}=n,r=f.slice(o,0,4),t=i.find(a=>a.type==="function"&&r===e.toFunctionSelector(e.formatAbiItem(a)));if(!t)throw new e.AbiFunctionSignatureNotFoundError(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:t.name,args:"inputs"in t&&t.inputs&&t.inputs.length>0?e.decodeAbiParameters(t.inputs,f.slice(o,4)):void 0}}const d="/docs/contract/encodeErrorResult";function h(n){const{abi:i,errorName:o,args:r}=n;let t=i[0];if(o){const u=e.getAbiItem({abi:i,args:r,name:o});if(!u)throw new e.AbiErrorNotFoundError(o,{docsPath:d});t=u}if(t.type!=="error")throw new e.AbiErrorNotFoundError(void 0,{docsPath:d});const a=e.formatAbiItem(t),s=e.toFunctionSelector(a);let c="0x";if(r&&r.length>0){if(!t.inputs)throw new e.AbiErrorInputsNotFoundError(t.name,{docsPath:d});c=e.encodeAbiParameters(t.inputs,r)}return f.concatHex([s,c])}const l="/docs/contract/encodeFunctionResult";function p(n){const{abi:i,functionName:o,result:r}=n;let t=i[0];if(o){const s=e.getAbiItem({abi:i,name:o});if(!s)throw new e.AbiFunctionNotFoundError(o,{docsPath:l});t=s}if(t.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:l});if(!t.outputs)throw new e.AbiFunctionOutputsNotFoundError(t.name,{docsPath:l});const a=(()=>{if(t.outputs.length===0)return[];if(t.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new e.InvalidArrayError(r)})();return e.encodeAbiParameters(t.outputs,a)}const b="x-batch-gateway:true";async function m(n){const{data:i,ccipRequest:o}=n,{args:[r]}=w({abi:e.batchGatewayAbi,data:i}),t=[],a=[];return await Promise.all(r.map(async(s,c)=>{try{a[c]=s.urls.includes(b)?await m({data:s.data,ccipRequest:o}):await o(s),t[c]=!1}catch(u){t[c]=!0,a[c]=A(u)}})),p({abi:e.batchGatewayAbi,functionName:"query",result:[t,a]})}function A(n){return n.name==="HttpRequestError"&&n.status?h({abi:e.batchGatewayAbi,errorName:"HttpError",args:[n.status,n.shortMessage]}):h({abi:[e.solidityError],errorName:"Error",args:["shortMessage"in n?n.shortMessage:n.message]})}exports.localBatchGatewayRequest=m;exports.localBatchGatewayUrl=b;
2
- //# sourceMappingURL=localBatchGatewayRequest-CuvkLo7E.cjs.map
1
+ "use strict";const f=require("./writeContract-Gli_t0c1.cjs"),e=require("./constants-PXB3A4Yl.cjs");function w(n){const{abi:i,data:o}=n,r=e.slice(o,0,4),t=i.find(a=>a.type==="function"&&r===e.toFunctionSelector(e.formatAbiItem(a)));if(!t)throw new e.AbiFunctionSignatureNotFoundError(r,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:t.name,args:"inputs"in t&&t.inputs&&t.inputs.length>0?e.decodeAbiParameters(t.inputs,e.slice(o,4)):void 0}}const d="/docs/contract/encodeErrorResult";function h(n){const{abi:i,errorName:o,args:r}=n;let t=i[0];if(o){const u=e.getAbiItem({abi:i,args:r,name:o});if(!u)throw new e.AbiErrorNotFoundError(o,{docsPath:d});t=u}if(t.type!=="error")throw new e.AbiErrorNotFoundError(void 0,{docsPath:d});const a=e.formatAbiItem(t),s=e.toFunctionSelector(a);let c="0x";if(r&&r.length>0){if(!t.inputs)throw new e.AbiErrorInputsNotFoundError(t.name,{docsPath:d});c=e.encodeAbiParameters(t.inputs,r)}return e.concatHex([s,c])}const l="/docs/contract/encodeFunctionResult";function p(n){const{abi:i,functionName:o,result:r}=n;let t=i[0];if(o){const s=e.getAbiItem({abi:i,name:o});if(!s)throw new e.AbiFunctionNotFoundError(o,{docsPath:l});t=s}if(t.type!=="function")throw new e.AbiFunctionNotFoundError(void 0,{docsPath:l});if(!t.outputs)throw new e.AbiFunctionOutputsNotFoundError(t.name,{docsPath:l});const a=(()=>{if(t.outputs.length===0)return[];if(t.outputs.length===1)return[r];if(Array.isArray(r))return r;throw new e.InvalidArrayError(r)})();return e.encodeAbiParameters(t.outputs,a)}const b="x-batch-gateway:true";async function m(n){const{data:i,ccipRequest:o}=n,{args:[r]}=w({abi:f.batchGatewayAbi,data:i}),t=[],a=[];return await Promise.all(r.map(async(s,c)=>{try{a[c]=s.urls.includes(b)?await m({data:s.data,ccipRequest:o}):await o(s),t[c]=!1}catch(u){t[c]=!0,a[c]=A(u)}})),p({abi:f.batchGatewayAbi,functionName:"query",result:[t,a]})}function A(n){return n.name==="HttpRequestError"&&n.status?h({abi:f.batchGatewayAbi,errorName:"HttpError",args:[n.status,n.shortMessage]}):h({abi:[e.solidityError],errorName:"Error",args:["shortMessage"in n?n.shortMessage:n.message]})}exports.localBatchGatewayRequest=m;exports.localBatchGatewayUrl=b;
2
+ //# sourceMappingURL=localBatchGatewayRequest-Bz0YuhIJ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"localBatchGatewayRequest-CuvkLo7E.cjs","sources":["../node_modules/.pnpm/viem@2.45.0_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/decodeFunctionData.js","../node_modules/.pnpm/viem@2.45.0_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/encodeErrorResult.js","../node_modules/.pnpm/viem@2.45.0_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/encodeFunctionResult.js","../node_modules/.pnpm/viem@2.45.0_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js"],"sourcesContent":["import { AbiFunctionSignatureNotFoundError } from '../../errors/abi.js';\nimport { slice } from '../data/slice.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { decodeAbiParameters, } from './decodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nexport function decodeFunctionData(parameters) {\n const { abi, data } = parameters;\n const signature = slice(data, 0, 4);\n const description = abi.find((x) => x.type === 'function' &&\n signature === toFunctionSelector(formatAbiItem(x)));\n if (!description)\n throw new AbiFunctionSignatureNotFoundError(signature, {\n docsPath: '/docs/contract/decodeFunctionData',\n });\n return {\n functionName: description.name,\n args: ('inputs' in description &&\n description.inputs &&\n description.inputs.length > 0\n ? decodeAbiParameters(description.inputs, slice(data, 4))\n : undefined),\n };\n}\n//# sourceMappingURL=decodeFunctionData.js.map","import { AbiErrorInputsNotFoundError, AbiErrorNotFoundError, } from '../../errors/abi.js';\nimport { concatHex } from '../data/concat.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeErrorResult';\nexport function encodeErrorResult(parameters) {\n const { abi, errorName, args } = parameters;\n let abiItem = abi[0];\n if (errorName) {\n const item = getAbiItem({ abi, args, name: errorName });\n if (!item)\n throw new AbiErrorNotFoundError(errorName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'error')\n throw new AbiErrorNotFoundError(undefined, { docsPath });\n const definition = formatAbiItem(abiItem);\n const signature = toFunctionSelector(definition);\n let data = '0x';\n if (args && args.length > 0) {\n if (!abiItem.inputs)\n throw new AbiErrorInputsNotFoundError(abiItem.name, { docsPath });\n data = encodeAbiParameters(abiItem.inputs, args);\n }\n return concatHex([signature, data]);\n}\n//# sourceMappingURL=encodeErrorResult.js.map","import { AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, InvalidArrayError, } from '../../errors/abi.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeFunctionResult';\nexport function encodeFunctionResult(parameters) {\n const { abi, functionName, result } = parameters;\n let abiItem = abi[0];\n if (functionName) {\n const item = getAbiItem({ abi, name: functionName });\n if (!item)\n throw new AbiFunctionNotFoundError(functionName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'function')\n throw new AbiFunctionNotFoundError(undefined, { docsPath });\n if (!abiItem.outputs)\n throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath });\n const values = (() => {\n if (abiItem.outputs.length === 0)\n return [];\n if (abiItem.outputs.length === 1)\n return [result];\n if (Array.isArray(result))\n return result;\n throw new InvalidArrayError(result);\n })();\n return encodeAbiParameters(abiItem.outputs, values);\n}\n//# sourceMappingURL=encodeFunctionResult.js.map","import { batchGatewayAbi } from '../../constants/abis.js';\nimport { solidityError } from '../../constants/solidity.js';\nimport { decodeFunctionData } from '../abi/decodeFunctionData.js';\nimport { encodeErrorResult } from '../abi/encodeErrorResult.js';\nimport { encodeFunctionResult } from '../abi/encodeFunctionResult.js';\nexport const localBatchGatewayUrl = 'x-batch-gateway:true';\nexport async function localBatchGatewayRequest(parameters) {\n const { data, ccipRequest } = parameters;\n const { args: [queries], } = decodeFunctionData({ abi: batchGatewayAbi, data });\n const failures = [];\n const responses = [];\n await Promise.all(queries.map(async (query, i) => {\n try {\n responses[i] = query.urls.includes(localBatchGatewayUrl)\n ? await localBatchGatewayRequest({ data: query.data, ccipRequest })\n : await ccipRequest(query);\n failures[i] = false;\n }\n catch (err) {\n failures[i] = true;\n responses[i] = encodeError(err);\n }\n }));\n return encodeFunctionResult({\n abi: batchGatewayAbi,\n functionName: 'query',\n result: [failures, responses],\n });\n}\nfunction encodeError(error) {\n if (error.name === 'HttpRequestError' && error.status)\n return encodeErrorResult({\n abi: batchGatewayAbi,\n errorName: 'HttpError',\n args: [error.status, error.shortMessage],\n });\n return encodeErrorResult({\n abi: [solidityError],\n errorName: 'Error',\n args: ['shortMessage' in error ? error.shortMessage : error.message],\n });\n}\n//# sourceMappingURL=localBatchGatewayRequest.js.map"],"names":["decodeFunctionData","parameters","abi","data","signature","slice","description","x","toFunctionSelector","formatAbiItem","AbiFunctionSignatureNotFoundError","decodeAbiParameters","docsPath","encodeErrorResult","errorName","args","abiItem","item","getAbiItem","AbiErrorNotFoundError","definition","AbiErrorInputsNotFoundError","encodeAbiParameters","concatHex","encodeFunctionResult","functionName","result","AbiFunctionNotFoundError","AbiFunctionOutputsNotFoundError","values","InvalidArrayError","localBatchGatewayUrl","localBatchGatewayRequest","ccipRequest","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GAAI,CACAF,EAAUE,CAAC,EAAID,EAAM,KAAK,SAASP,CAAoB,EACjD,MAAMC,EAAyB,CAAE,KAAMM,EAAM,KAAM,YAAAL,CAAW,CAAE,EAChE,MAAMA,EAAYK,CAAK,EAC7BF,EAASG,CAAC,EAAI,EAClB,OACOC,EAAK,CACRJ,EAASG,CAAC,EAAI,GACdF,EAAUE,CAAC,EAAIE,EAAYD,CAAG,CAClC,CACJ,CAAC,CAAC,EACKhB,EAAqB,CACxB,IAAKW,EAAAA,gBACL,aAAc,QACd,OAAQ,CAACC,EAAUC,CAAS,CACpC,CAAK,CACL,CACA,SAASI,EAAYC,EAAO,CACxB,OAAIA,EAAM,OAAS,oBAAsBA,EAAM,OACpC7B,EAAkB,CACrB,IAAKsB,EAAAA,gBACL,UAAW,YACX,KAAM,CAACO,EAAM,OAAQA,EAAM,YAAY,CACnD,CAAS,EACE7B,EAAkB,CACrB,IAAK,CAAC8B,EAAAA,aAAa,EACnB,UAAW,QACX,KAAM,CAAC,iBAAkBD,EAAQA,EAAM,aAAeA,EAAM,OAAO,CAC3E,CAAK,CACL","x_google_ignoreList":[0,1,2,3]}
1
+ {"version":3,"file":"localBatchGatewayRequest-Bz0YuhIJ.cjs","sources":["../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/decodeFunctionData.js","../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/encodeErrorResult.js","../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/abi/encodeFunctionResult.js","../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3_zod@4.1.12/node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js"],"sourcesContent":["import { AbiFunctionSignatureNotFoundError } from '../../errors/abi.js';\nimport { slice } from '../data/slice.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { decodeAbiParameters, } from './decodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nexport function decodeFunctionData(parameters) {\n const { abi, data } = parameters;\n const signature = slice(data, 0, 4);\n const description = abi.find((x) => x.type === 'function' &&\n signature === toFunctionSelector(formatAbiItem(x)));\n if (!description)\n throw new AbiFunctionSignatureNotFoundError(signature, {\n docsPath: '/docs/contract/decodeFunctionData',\n });\n return {\n functionName: description.name,\n args: ('inputs' in description &&\n description.inputs &&\n description.inputs.length > 0\n ? decodeAbiParameters(description.inputs, slice(data, 4))\n : undefined),\n };\n}\n//# sourceMappingURL=decodeFunctionData.js.map","import { AbiErrorInputsNotFoundError, AbiErrorNotFoundError, } from '../../errors/abi.js';\nimport { concatHex } from '../data/concat.js';\nimport { toFunctionSelector, } from '../hash/toFunctionSelector.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { formatAbiItem } from './formatAbiItem.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeErrorResult';\nexport function encodeErrorResult(parameters) {\n const { abi, errorName, args } = parameters;\n let abiItem = abi[0];\n if (errorName) {\n const item = getAbiItem({ abi, args, name: errorName });\n if (!item)\n throw new AbiErrorNotFoundError(errorName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'error')\n throw new AbiErrorNotFoundError(undefined, { docsPath });\n const definition = formatAbiItem(abiItem);\n const signature = toFunctionSelector(definition);\n let data = '0x';\n if (args && args.length > 0) {\n if (!abiItem.inputs)\n throw new AbiErrorInputsNotFoundError(abiItem.name, { docsPath });\n data = encodeAbiParameters(abiItem.inputs, args);\n }\n return concatHex([signature, data]);\n}\n//# sourceMappingURL=encodeErrorResult.js.map","import { AbiFunctionNotFoundError, AbiFunctionOutputsNotFoundError, InvalidArrayError, } from '../../errors/abi.js';\nimport { encodeAbiParameters, } from './encodeAbiParameters.js';\nimport { getAbiItem } from './getAbiItem.js';\nconst docsPath = '/docs/contract/encodeFunctionResult';\nexport function encodeFunctionResult(parameters) {\n const { abi, functionName, result } = parameters;\n let abiItem = abi[0];\n if (functionName) {\n const item = getAbiItem({ abi, name: functionName });\n if (!item)\n throw new AbiFunctionNotFoundError(functionName, { docsPath });\n abiItem = item;\n }\n if (abiItem.type !== 'function')\n throw new AbiFunctionNotFoundError(undefined, { docsPath });\n if (!abiItem.outputs)\n throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath });\n const values = (() => {\n if (abiItem.outputs.length === 0)\n return [];\n if (abiItem.outputs.length === 1)\n return [result];\n if (Array.isArray(result))\n return result;\n throw new InvalidArrayError(result);\n })();\n return encodeAbiParameters(abiItem.outputs, values);\n}\n//# sourceMappingURL=encodeFunctionResult.js.map","import { batchGatewayAbi } from '../../constants/abis.js';\nimport { solidityError } from '../../constants/solidity.js';\nimport { decodeFunctionData } from '../abi/decodeFunctionData.js';\nimport { encodeErrorResult } from '../abi/encodeErrorResult.js';\nimport { encodeFunctionResult } from '../abi/encodeFunctionResult.js';\nexport const localBatchGatewayUrl = 'x-batch-gateway:true';\nexport async function localBatchGatewayRequest(parameters) {\n const { data, ccipRequest } = parameters;\n const { args: [queries], } = decodeFunctionData({ abi: batchGatewayAbi, data });\n const failures = [];\n const responses = [];\n await Promise.all(queries.map(async (query, i) => {\n try {\n responses[i] = query.urls.includes(localBatchGatewayUrl)\n ? await localBatchGatewayRequest({ data: query.data, ccipRequest })\n : await ccipRequest(query);\n failures[i] = false;\n }\n catch (err) {\n failures[i] = true;\n responses[i] = encodeError(err);\n }\n }));\n return encodeFunctionResult({\n abi: batchGatewayAbi,\n functionName: 'query',\n result: [failures, responses],\n });\n}\nfunction encodeError(error) {\n if (error.name === 'HttpRequestError' && error.status)\n return encodeErrorResult({\n abi: batchGatewayAbi,\n errorName: 'HttpError',\n args: [error.status, error.shortMessage],\n });\n return encodeErrorResult({\n abi: [solidityError],\n errorName: 'Error',\n args: ['shortMessage' in error ? error.shortMessage : error.message],\n });\n}\n//# sourceMappingURL=localBatchGatewayRequest.js.map"],"names":["decodeFunctionData","parameters","abi","data","signature","slice","description","x","toFunctionSelector","formatAbiItem","AbiFunctionSignatureNotFoundError","decodeAbiParameters","docsPath","encodeErrorResult","errorName","args","abiItem","item","getAbiItem","AbiErrorNotFoundError","definition","AbiErrorInputsNotFoundError","encodeAbiParameters","concatHex","encodeFunctionResult","functionName","result","AbiFunctionNotFoundError","AbiFunctionOutputsNotFoundError","values","InvalidArrayError","localBatchGatewayUrl","localBatchGatewayRequest","ccipRequest","queries","batchGatewayAbi","failures","responses","query","i","err","encodeError","error","solidityError"],"mappings":"mGAKO,SAASA,EAAmBC,EAAY,CAC3C,KAAM,CAAE,IAAAC,EAAK,KAAAC,CAAI,EAAKF,EAChBG,EAAYC,EAAAA,MAAMF,EAAM,EAAG,CAAC,EAC5BG,EAAcJ,EAAI,KAAMK,GAAMA,EAAE,OAAS,YAC3CH,IAAcI,EAAAA,mBAAmBC,gBAAcF,CAAC,CAAC,CAAC,EACtD,GAAI,CAACD,EACD,MAAM,IAAII,EAAAA,kCAAkCN,EAAW,CACnD,SAAU,mCACtB,CAAS,EACL,MAAO,CACH,aAAcE,EAAY,KAC1B,KAAO,WAAYA,GACfA,EAAY,QACZA,EAAY,OAAO,OAAS,EAC1BK,EAAAA,oBAAoBL,EAAY,OAAQD,EAAAA,MAAMF,EAAM,CAAC,CAAC,EACtD,MACd,CACA,CChBA,MAAMS,EAAW,mCACV,SAASC,EAAkBZ,EAAY,CAC1C,KAAM,CAAE,IAAAC,EAAK,UAAAY,EAAW,KAAAC,CAAI,EAAKd,EACjC,IAAIe,EAAUd,EAAI,CAAC,EACnB,GAAIY,EAAW,CACX,MAAMG,EAAOC,EAAAA,WAAW,CAAE,IAAAhB,EAAK,KAAAa,EAAM,KAAMD,EAAW,EACtD,GAAI,CAACG,EACD,MAAM,IAAIE,EAAAA,sBAAsBL,EAAW,CAAA,SAAEF,CAAQ,CAAE,EAC3DI,EAAUC,CACd,CACA,GAAID,EAAQ,OAAS,QACjB,MAAM,IAAIG,EAAAA,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AAuB,uBAC7B,eAAeC,EAAyB/B,EAAY,CACvD,KAAM,CAAE,KAAAE,EAAM,YAAA8B,CAAW,EAAKhC,EACxB,CAAE,KAAM,CAACiC,CAAO,CAAC,EAAMlC,EAAmB,CAAE,IAAKmC,kBAAiB,KAAAhC,EAAM,EACxEiC,EAAW,CAAA,EACXC,EAAY,CAAA,EAClB,aAAM,QAAQ,IAAIH,EAAQ,IAAI,MAAOI,EAAOC,IAAM,CAC9C,GAAI,CACAF,EAAUE,CAAC,EAAID,EAAM,KAAK,SAASP,CAAoB,EACjD,MAAMC,EAAyB,CAAE,KAAMM,EAAM,KAAM,YAAAL,CAAW,CAAE,EAChE,MAAMA,EAAYK,CAAK,EAC7BF,EAASG,CAAC,EAAI,EAClB,OACOC,EAAK,CACRJ,EAASG,CAAC,EAAI,GACdF,EAAUE,CAAC,EAAIE,EAAYD,CAAG,CAClC,CACJ,CAAC,CAAC,EACKhB,EAAqB,CACxB,IAAKW,EAAAA,gBACL,aAAc,QACd,OAAQ,CAACC,EAAUC,CAAS,CACpC,CAAK,CACL,CACA,SAASI,EAAYC,EAAO,CACxB,OAAIA,EAAM,OAAS,oBAAsBA,EAAM,OACpC7B,EAAkB,CACrB,IAAKsB,EAAAA,gBACL,UAAW,YACX,KAAM,CAACO,EAAM,OAAQA,EAAM,YAAY,CACnD,CAAS,EACE7B,EAAkB,CACrB,IAAK,CAAC8B,EAAAA,aAAa,EACnB,UAAW,QACX,KAAM,CAAC,iBAAkBD,EAAQA,EAAM,aAAeA,EAAM,OAAO,CAC3E,CAAK,CACL","x_google_ignoreList":[0,1,2,3]}
package/dist/main.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./api/puffer-client.cjs"),n=require("./api/puffer-client-helpers.cjs"),e=require("./constants-Dhpa19or.cjs"),r=require("./contracts/tokens.cjs"),t=require("./contracts/addresses.cjs"),l=require("./contracts/vaults-addresses.cjs"),o=require("./contracts/handlers/erc20-permit-handler.cjs"),s=require("./contracts/handlers/l1-reward-manager-handler.cjs"),c=require("./contracts/handlers/l2-reward-manager-handler.cjs"),d=require("./contracts/handlers/puf-locker-handler.cjs"),i=require("./contracts/handlers/puffer-depositor-handler.cjs"),u=require("./contracts/handlers/puffer-l2-depositor-handler.cjs"),f=require("./contracts/handlers/puffer-vault-handler.cjs"),_=require("./contracts/handlers/puffer-withdrawal-manager-handler.cjs"),H=require("./contracts/handlers/distributor-handler.cjs"),S=require("./contracts/handlers/concrete-vault-handler.cjs"),P=require("./contracts/handlers/validator-ticket-handler.cjs"),E=require("./contracts/handlers/puffer-oracle-v2-handler.cjs"),T=require("./contracts/handlers/puffer-protocol-handler.cjs");exports.PufferClient=a.PufferClient;exports.PufferClientHelpers=n.PufferClientHelpers;exports.Chain=e.Chain;exports.VIEM_CHAINS=e.VIEM_CHAINS;exports.TOKENS_ADDRESSES=r.TOKENS_ADDRESSES;exports.TOKENS_PERMIT_VERSION=r.TOKENS_PERMIT_VERSION;exports.TOKENS_SALT=r.TOKENS_SALT;exports.Token=r.Token;exports.UnifiToken=r.UnifiToken;exports.CONTRACT_ADDRESSES=t.CONTRACT_ADDRESSES;exports.VAULTS_ADDRESSES=l.VAULTS_ADDRESSES;exports.ERC20PermitHandler=o.ERC20PermitHandler;exports.L1RewardManagerHandler=s.L1RewardManagerHandler;exports.L2RewardManagerHandler=c.L2RewardManagerHandler;exports.PufLockerHandler=d.PufLockerHandler;exports.PufferDepositorHandler=i.PufferDepositorHandler;exports.PufferL2DepositorHandler=u.PufferL2DepositorHandler;exports.PufferVaultHandler=f.PufferVaultHandler;exports.PufferWithdrawalManagerHandler=_.PufferWithdrawalManagerHandler;exports.DistributorHandler=H.DistributorHandler;exports.ConcreteVaultHandler=S.ConcreteVaultHandler;exports.ValidatorTicketHandler=P.ValidatorTicketHandler;exports.PufferOracleV2Handler=E.PufferOracleV2Handler;exports.PufferProtocolHandler=T.PufferProtocolHandler;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./api/puffer-client.cjs"),n=require("./api/puffer-client-helpers.cjs"),e=require("./constants-PXB3A4Yl.cjs"),r=require("./contracts/tokens.cjs"),t=require("./contracts/addresses.cjs"),l=require("./contracts/vaults-addresses.cjs"),o=require("./contracts/handlers/erc20-permit-handler.cjs"),s=require("./contracts/handlers/l1-reward-manager-handler.cjs"),c=require("./contracts/handlers/l2-reward-manager-handler.cjs"),d=require("./contracts/handlers/puf-locker-handler.cjs"),i=require("./contracts/handlers/puffer-depositor-handler.cjs"),u=require("./contracts/handlers/puffer-l2-depositor-handler.cjs"),f=require("./contracts/handlers/puffer-vault-handler.cjs"),_=require("./contracts/handlers/puffer-withdrawal-manager-handler.cjs"),H=require("./contracts/handlers/distributor-handler.cjs"),S=require("./contracts/handlers/concrete-vault-handler.cjs"),P=require("./contracts/handlers/validator-ticket-handler.cjs"),E=require("./contracts/handlers/puffer-oracle-v2-handler.cjs"),T=require("./contracts/handlers/puffer-protocol-handler.cjs");exports.PufferClient=a.PufferClient;exports.PufferClientHelpers=n.PufferClientHelpers;exports.Chain=e.Chain;exports.VIEM_CHAINS=e.VIEM_CHAINS;exports.TOKENS_ADDRESSES=r.TOKENS_ADDRESSES;exports.TOKENS_PERMIT_VERSION=r.TOKENS_PERMIT_VERSION;exports.TOKENS_SALT=r.TOKENS_SALT;exports.Token=r.Token;exports.UnifiToken=r.UnifiToken;exports.CONTRACT_ADDRESSES=t.CONTRACT_ADDRESSES;exports.VAULTS_ADDRESSES=l.VAULTS_ADDRESSES;exports.ERC20PermitHandler=o.ERC20PermitHandler;exports.L1RewardManagerHandler=s.L1RewardManagerHandler;exports.L2RewardManagerHandler=c.L2RewardManagerHandler;exports.PufLockerHandler=d.PufLockerHandler;exports.PufferDepositorHandler=i.PufferDepositorHandler;exports.PufferL2DepositorHandler=u.PufferL2DepositorHandler;exports.PufferVaultHandler=f.PufferVaultHandler;exports.PufferWithdrawalManagerHandler=_.PufferWithdrawalManagerHandler;exports.DistributorHandler=H.DistributorHandler;exports.ConcreteVaultHandler=S.ConcreteVaultHandler;exports.ValidatorTicketHandler=P.ValidatorTicketHandler;exports.PufferOracleV2Handler=E.PufferOracleV2Handler;exports.PufferProtocolHandler=T.PufferProtocolHandler;
2
2
  //# sourceMappingURL=main.cjs.map
package/dist/main.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { PufferClient as o } from "./api/puffer-client.js";
2
2
  import { PufferClientHelpers as t } from "./api/puffer-client-helpers.js";
3
- import { C as n, V as l } from "./constants-CUYeD71n.js";
3
+ import { C as n, V as l } from "./constants-C-rrOSfg.js";
4
4
  import { TOKENS_ADDRESSES as m, TOKENS_PERMIT_VERSION as x, TOKENS_SALT as d, Token as S, UnifiToken as H } from "./contracts/tokens.js";
5
5
  import { CONTRACT_ADDRESSES as E } from "./contracts/addresses.js";
6
6
  import { VAULTS_ADDRESSES as P } from "./contracts/vaults-addresses.js";
@@ -1,4 +1,4 @@
1
- import { H as le, f as de, g as he, j as we, k as kt, l as ge, m as me, r as pe, o as ye, q as be } from "./constants-CUYeD71n.js";
1
+ import { H as le, F as de, G as he, J as we, K as kt, L as ge, M as me, N as pe, O as ye, P as be } from "./constants-C-rrOSfg.js";
2
2
  const Rt = /* @__PURE__ */ BigInt(0), Nt = /* @__PURE__ */ BigInt(1);
3
3
  function ut(e) {
4
4
  return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
@@ -15,36 +15,36 @@ function dt(e) {
15
15
  const n = e.toString(16);
16
16
  return n.length & 1 ? "0" + n : n;
17
17
  }
18
- function Wt(e) {
18
+ function Gt(e) {
19
19
  if (typeof e != "string")
20
20
  throw new Error("hex string expected, got " + typeof e);
21
21
  return e === "" ? Rt : BigInt("0x" + e);
22
22
  }
23
- const Dt = (
23
+ const Wt = (
24
24
  // @ts-ignore
25
25
  typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function"
26
26
  ), Ee = /* @__PURE__ */ Array.from({ length: 256 }, (e, n) => n.toString(16).padStart(2, "0"));
27
27
  function at(e) {
28
- if (Zt(e), Dt)
28
+ if (Zt(e), Wt)
29
29
  return e.toHex();
30
30
  let n = "";
31
31
  for (let t = 0; t < e.length; t++)
32
32
  n += Ee[e[t]];
33
33
  return n;
34
34
  }
35
- const D = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
35
+ const W = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
36
36
  function _t(e) {
37
- if (e >= D._0 && e <= D._9)
38
- return e - D._0;
39
- if (e >= D.A && e <= D.F)
40
- return e - (D.A - 10);
41
- if (e >= D.a && e <= D.f)
42
- return e - (D.a - 10);
37
+ if (e >= W._0 && e <= W._9)
38
+ return e - W._0;
39
+ if (e >= W.A && e <= W.F)
40
+ return e - (W.A - 10);
41
+ if (e >= W.a && e <= W.f)
42
+ return e - (W.a - 10);
43
43
  }
44
44
  function ht(e) {
45
45
  if (typeof e != "string")
46
46
  throw new Error("hex string expected, got " + typeof e);
47
- if (Dt)
47
+ if (Wt)
48
48
  return Uint8Array.fromHex(e);
49
49
  const n = e.length, t = n / 2;
50
50
  if (n % 2)
@@ -61,10 +61,10 @@ function ht(e) {
61
61
  return r;
62
62
  }
63
63
  function et(e) {
64
- return Wt(at(e));
64
+ return Gt(at(e));
65
65
  }
66
- function Gt(e) {
67
- return Zt(e), Wt(at(Uint8Array.from(e).reverse()));
66
+ function Dt(e) {
67
+ return Zt(e), Gt(at(Uint8Array.from(e).reverse()));
68
68
  }
69
69
  function lt(e, n) {
70
70
  return ht(e.toString(16).padStart(n * 2, "0"));
@@ -225,24 +225,24 @@ class Ft extends le {
225
225
  }
226
226
  const Qt = (e, n, t) => new Ft(e, n).update(t).digest();
227
227
  Qt.create = (e, n) => new Ft(e, n);
228
- const j = BigInt(0), C = BigInt(1), tt = /* @__PURE__ */ BigInt(2), Se = /* @__PURE__ */ BigInt(3), Jt = /* @__PURE__ */ BigInt(4), te = /* @__PURE__ */ BigInt(5), ee = /* @__PURE__ */ BigInt(8);
228
+ const Y = BigInt(0), C = BigInt(1), tt = /* @__PURE__ */ BigInt(2), Se = /* @__PURE__ */ BigInt(3), Jt = /* @__PURE__ */ BigInt(4), te = /* @__PURE__ */ BigInt(5), ee = /* @__PURE__ */ BigInt(8);
229
229
  function M(e, n) {
230
230
  const t = e % n;
231
- return t >= j ? t : n + t;
231
+ return t >= Y ? t : n + t;
232
232
  }
233
- function Y(e, n, t) {
233
+ function j(e, n, t) {
234
234
  let r = e;
235
- for (; n-- > j; )
235
+ for (; n-- > Y; )
236
236
  r *= r, r %= t;
237
237
  return r;
238
238
  }
239
239
  function Ot(e, n) {
240
- if (e === j)
240
+ if (e === Y)
241
241
  throw new Error("invert: expected non-zero number");
242
- if (n <= j)
242
+ if (n <= Y)
243
243
  throw new Error("invert: expected positive modulus, got " + n);
244
- let t = M(e, n), r = n, i = j, s = C;
245
- for (; t !== j; ) {
244
+ let t = M(e, n), r = n, i = Y, s = C;
245
+ for (; t !== Y; ) {
246
246
  const u = r / t, o = r % t, d = i - s * u;
247
247
  r = t, t = o, i = s, s = d;
248
248
  }
@@ -266,7 +266,7 @@ function Ie(e) {
266
266
  if (e < BigInt(3))
267
267
  throw new Error("sqrt is not defined for small field");
268
268
  let n = e - C, t = 0;
269
- for (; n % tt === j; )
269
+ for (; n % tt === Y; )
270
270
  n /= tt, t++;
271
271
  let r = tt;
272
272
  const i = Ut(e);
@@ -328,14 +328,14 @@ function qe(e) {
328
328
  return mt(e, t);
329
329
  }
330
330
  function He(e, n, t) {
331
- if (t < j)
331
+ if (t < Y)
332
332
  throw new Error("invalid exponent, negatives unsupported");
333
- if (t === j)
333
+ if (t === Y)
334
334
  return e.ONE;
335
335
  if (t === C)
336
336
  return n;
337
337
  let r = e.ONE, i = n;
338
- for (; t > j; )
338
+ for (; t > Y; )
339
339
  t & C && (r = e.mul(r, i)), i = e.sqr(i), t >>= C;
340
340
  return r;
341
341
  }
@@ -355,7 +355,7 @@ function oe(e, n) {
355
355
  return { nBitLength: t, nByteLength: r };
356
356
  }
357
357
  function Ut(e, n, t = !1, r = {}) {
358
- if (e <= j)
358
+ if (e <= Y)
359
359
  throw new Error("invalid field: expected ORDER > 0, got " + e);
360
360
  const { nBitLength: i, nByteLength: s } = oe(e, n);
361
361
  if (s > 2048)
@@ -367,15 +367,15 @@ function Ut(e, n, t = !1, r = {}) {
367
367
  BITS: i,
368
368
  BYTES: s,
369
369
  MASK: gt(i),
370
- ZERO: j,
370
+ ZERO: Y,
371
371
  ONE: C,
372
372
  create: (o) => M(o, e),
373
373
  isValid: (o) => {
374
374
  if (typeof o != "bigint")
375
375
  throw new Error("invalid field element: expected bigint, got " + typeof o);
376
- return j <= o && o < e;
376
+ return Y <= o && o < e;
377
377
  },
378
- is0: (o) => o === j,
378
+ is0: (o) => o === Y,
379
379
  isOdd: (o) => (o & C) === C,
380
380
  neg: (o) => M(-o, e),
381
381
  eql: (o, d) => o === d,
@@ -396,7 +396,7 @@ function Ut(e, n, t = !1, r = {}) {
396
396
  fromBytes: (o) => {
397
397
  if (o.length !== s)
398
398
  throw new Error("Field.fromBytes: expected " + s + " bytes, got " + o.length);
399
- return t ? Gt(o) : et(o);
399
+ return t ? Dt(o) : et(o);
400
400
  },
401
401
  // TODO: we don't need it here, move out to separate fn
402
402
  invertBatch: (o) => re(u, o),
@@ -420,10 +420,10 @@ function Le(e, n, t = !1) {
420
420
  const r = e.length, i = ie(n), s = se(n);
421
421
  if (r < 16 || r < s || r > 1024)
422
422
  throw new Error("expected " + s + "-1024 bytes of input, got " + r);
423
- const c = t ? Gt(e) : et(e), u = M(c, n - C) + C;
423
+ const c = t ? Dt(e) : et(e), u = M(c, n - C) + C;
424
424
  return t ? Xt(u, i) : lt(u, i);
425
425
  }
426
- const jt = BigInt(0), qt = BigInt(1);
426
+ const Yt = BigInt(0), qt = BigInt(1);
427
427
  function Bt(e, n) {
428
428
  const t = n.negate();
429
429
  return e ? t : n;
@@ -437,7 +437,7 @@ function vt(e, n) {
437
437
  const t = Math.ceil(n / e) + 1, r = 2 ** (e - 1), i = 2 ** e, s = gt(e), c = BigInt(e);
438
438
  return { windows: t, windowSize: r, mask: s, maxNumber: i, shiftBy: c };
439
439
  }
440
- function Yt(e, n, t) {
440
+ function jt(e, n, t) {
441
441
  const { windowSize: r, mask: i, maxNumber: s, shiftBy: c } = t;
442
442
  let u = Number(e & i), o = e >> c;
443
443
  u > r && (u -= s, o += qt);
@@ -473,7 +473,7 @@ function ze(e, n) {
473
473
  // non-const time multiplication ladder
474
474
  unsafeLadder(t, r, i = e.ZERO) {
475
475
  let s = t;
476
- for (; r > jt; )
476
+ for (; r > Yt; )
477
477
  r & qt && (i = i.add(s)), s = s.double(), r >>= qt;
478
478
  return i;
479
479
  },
@@ -511,7 +511,7 @@ function ze(e, n) {
511
511
  let s = e.ZERO, c = e.BASE;
512
512
  const u = vt(t, n);
513
513
  for (let o = 0; o < u.windows; o++) {
514
- const { nextN: d, offset: m, isZero: A, isNeg: N, isNegF: R, offsetF: Z } = Yt(i, o, u);
514
+ const { nextN: d, offset: m, isZero: A, isNeg: N, isNegF: R, offsetF: Z } = jt(i, o, u);
515
515
  i = d, A ? c = c.add(Bt(R, r[Z])) : s = s.add(Bt(N, r[m]));
516
516
  }
517
517
  return { p: s, f: c };
@@ -526,8 +526,8 @@ function ze(e, n) {
526
526
  */
527
527
  wNAFUnsafe(t, r, i, s = e.ZERO) {
528
528
  const c = vt(t, n);
529
- for (let u = 0; u < c.windows && i !== jt; u++) {
530
- const { nextN: o, offset: d, isZero: m, isNeg: A } = Yt(i, u, c);
529
+ for (let u = 0; u < c.windows && i !== Yt; u++) {
530
+ const { nextN: o, offset: d, isZero: m, isNeg: A } = jt(i, u, c);
531
531
  if (i = o, !m) {
532
532
  const N = r[d];
533
533
  s = s.add(A ? N.negate() : N);
@@ -626,13 +626,13 @@ class ke extends Error {
626
626
  super(n);
627
627
  }
628
628
  }
629
- const G = {
629
+ const D = {
630
630
  // asn.1 DER encoding utils
631
631
  Err: ke,
632
632
  // Basic building block is TLV (Tag-Length-Value)
633
633
  _tlv: {
634
634
  encode: (e, n) => {
635
- const { Err: t } = G;
635
+ const { Err: t } = D;
636
636
  if (e < 0 || e > 256)
637
637
  throw new t("tlv.encode: wrong tag");
638
638
  if (n.length & 1)
@@ -645,7 +645,7 @@ const G = {
645
645
  },
646
646
  // v - value, l - left bytes (unparsed)
647
647
  decode(e, n) {
648
- const { Err: t } = G;
648
+ const { Err: t } = D;
649
649
  let r = 0;
650
650
  if (e < 0 || e > 256)
651
651
  throw new t("tlv.encode: wrong tag");
@@ -683,7 +683,7 @@ const G = {
683
683
  // - if next byte doesn't have a flag, leading zero is not allowed (minimal encoding)
684
684
  _int: {
685
685
  encode(e) {
686
- const { Err: n } = G;
686
+ const { Err: n } = D;
687
687
  if (e < X)
688
688
  throw new n("integer: negative integers are not allowed");
689
689
  let t = dt(e);
@@ -692,7 +692,7 @@ const G = {
692
692
  return t;
693
693
  },
694
694
  decode(e) {
695
- const { Err: n } = G;
695
+ const { Err: n } = D;
696
696
  if (e[0] & 128)
697
697
  throw new n("invalid signature integer: negative");
698
698
  if (e[0] === 0 && !(e[1] & 128))
@@ -701,7 +701,7 @@ const G = {
701
701
  }
702
702
  },
703
703
  toSig(e) {
704
- const { Err: n, _int: t, _tlv: r } = G, i = K("signature", e), { v: s, l: c } = r.decode(48, i);
704
+ const { Err: n, _int: t, _tlv: r } = D, i = K("signature", e), { v: s, l: c } = r.decode(48, i);
705
705
  if (c.length)
706
706
  throw new n("invalid signature: left bytes after parsing");
707
707
  const { v: u, l: o } = r.decode(2, s), { v: d, l: m } = r.decode(2, o);
@@ -710,7 +710,7 @@ const G = {
710
710
  return { r: t.decode(u), s: t.decode(d) };
711
711
  },
712
712
  hexFromSig(e) {
713
- const { _tlv: n, _int: t } = G, r = n.encode(2, t.encode(e.r)), i = n.encode(2, t.encode(e.s)), s = r + i;
713
+ const { _tlv: n, _int: t } = D, r = n.encode(2, t.encode(e.r)), i = n.encode(2, t.encode(e.s)), s = r + i;
714
714
  return n.encode(48, s);
715
715
  }
716
716
  };
@@ -1062,7 +1062,7 @@ function Me(e) {
1062
1062
  // DER encoded ECDSA signature
1063
1063
  // https://bitcoin.stackexchange.com/questions/57644/what-are-the-parts-of-a-bitcoin-transaction-input-script
1064
1064
  static fromDER(a) {
1065
- const { r: w, s: S } = G.toSig(K("DER", a));
1065
+ const { r: w, s: S } = D.toSig(K("DER", a));
1066
1066
  return new z(w, S);
1067
1067
  }
1068
1068
  /**
@@ -1081,7 +1081,7 @@ function Me(e) {
1081
1081
  const L = E === 2 || E === 3 ? w + n.n : w;
1082
1082
  if (L >= t.ORDER)
1083
1083
  throw new Error("recovery id 2 or 3 invalid");
1084
- const _ = (E & 1) === 0 ? "02" : "03", W = m.fromHex(_ + At(L, t.BYTES)), P = d(L), V = o(-v * P), nt = o(S * P), F = m.BASE.multiplyAndAddUnsafe(W, V, nt);
1084
+ const _ = (E & 1) === 0 ? "02" : "03", G = m.fromHex(_ + At(L, t.BYTES)), P = d(L), V = o(-v * P), nt = o(S * P), F = m.BASE.multiplyAndAddUnsafe(G, V, nt);
1085
1085
  if (!F)
1086
1086
  throw new Error("point at infinify");
1087
1087
  return F.assertValidity(), F;
@@ -1098,7 +1098,7 @@ function Me(e) {
1098
1098
  return ht(this.toDERHex());
1099
1099
  }
1100
1100
  toDERHex() {
1101
- return G.hexFromSig(this);
1101
+ return D.hexFromSig(this);
1102
1102
  }
1103
1103
  // padded bytes of r, then padded bytes of s
1104
1104
  toCompactRawBytes() {
@@ -1174,12 +1174,12 @@ function Me(e) {
1174
1174
  const { hash: S, randomBytes: E } = n;
1175
1175
  let { lowS: v, prehash: L, extraEntropy: _ } = w;
1176
1176
  v == null && (v = !0), l = K("msgHash", l), Kt(w), L && (l = K("prehashed msgHash", S(l)));
1177
- const W = B(l), P = A(a), V = [H(P), H(W)];
1177
+ const G = B(l), P = A(a), V = [H(P), H(G)];
1178
1178
  if (_ != null && _ !== !1) {
1179
1179
  const Q = _ === !0 ? E(t.BYTES) : _;
1180
1180
  V.push(K("extraEntropy", Q));
1181
1181
  }
1182
- const nt = wt(...V), F = W;
1182
+ const nt = wt(...V), F = G;
1183
1183
  function pt(Q) {
1184
1184
  const rt = p(Q);
1185
1185
  if (!R(rt))
@@ -1209,16 +1209,16 @@ function Me(e) {
1209
1209
  throw new Error("options.strict was renamed to lowS");
1210
1210
  if (_ !== void 0 && _ !== "compact" && _ !== "der")
1211
1211
  throw new Error("format must be compact or der");
1212
- const W = typeof E == "string" || ut(E), P = !W && !_ && typeof E == "object" && E !== null && typeof E.r == "bigint" && typeof E.s == "bigint";
1213
- if (!W && !P)
1212
+ const G = typeof E == "string" || ut(E), P = !G && !_ && typeof E == "object" && E !== null && typeof E.r == "bigint" && typeof E.s == "bigint";
1213
+ if (!G && !P)
1214
1214
  throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");
1215
1215
  let V, nt;
1216
1216
  try {
1217
- if (P && (V = new z(E.r, E.s)), W) {
1217
+ if (P && (V = new z(E.r, E.s)), G) {
1218
1218
  try {
1219
1219
  _ !== "compact" && (V = z.fromDER(E));
1220
1220
  } catch (ot) {
1221
- if (!(ot instanceof G.Err))
1221
+ if (!(ot instanceof D.Err))
1222
1222
  throw ot;
1223
1223
  }
1224
1224
  !V && _ !== "der" && (V = z.fromCompact(E));
@@ -1244,25 +1244,25 @@ function Me(e) {
1244
1244
  utils: $
1245
1245
  };
1246
1246
  }
1247
- function je(e) {
1247
+ function Ye(e) {
1248
1248
  return {
1249
1249
  hash: e,
1250
1250
  hmac: (n, ...t) => Qt(e, n, ye(...t)),
1251
1251
  randomBytes: pe
1252
1252
  };
1253
1253
  }
1254
- function Ye(e, n) {
1255
- const t = (r) => Me({ ...e, ...je(r) });
1254
+ function je(e, n) {
1255
+ const t = (r) => Me({ ...e, ...Ye(r) });
1256
1256
  return { ...t(n), create: t };
1257
1257
  }
1258
1258
  const ue = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"), Pt = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"), Ke = BigInt(0), Pe = BigInt(1), Ht = BigInt(2), $t = (e, n) => (e + n / Ht) / n;
1259
1259
  function $e(e) {
1260
- const n = ue, t = BigInt(3), r = BigInt(6), i = BigInt(11), s = BigInt(22), c = BigInt(23), u = BigInt(44), o = BigInt(88), d = e * e * e % n, m = d * d * e % n, A = Y(m, t, n) * m % n, N = Y(A, t, n) * m % n, R = Y(N, Ht, n) * d % n, Z = Y(R, i, n) * R % n, g = Y(Z, s, n) * Z % n, k = Y(g, u, n) * g % n, z = Y(k, o, n) * k % n, $ = Y(z, u, n) * g % n, x = Y($, t, n) * m % n, f = Y(x, c, n) * Z % n, h = Y(f, r, n) * d % n, p = Y(h, Ht, n);
1260
+ const n = ue, t = BigInt(3), r = BigInt(6), i = BigInt(11), s = BigInt(22), c = BigInt(23), u = BigInt(44), o = BigInt(88), d = e * e * e % n, m = d * d * e % n, A = j(m, t, n) * m % n, N = j(A, t, n) * m % n, R = j(N, Ht, n) * d % n, Z = j(R, i, n) * R % n, g = j(Z, s, n) * Z % n, k = j(g, u, n) * g % n, z = j(k, o, n) * k % n, $ = j(z, u, n) * g % n, x = j($, t, n) * m % n, f = j(x, c, n) * Z % n, h = j(f, r, n) * d % n, p = j(h, Ht, n);
1261
1261
  if (!Lt.eql(Lt.sqr(p), e))
1262
1262
  throw new Error("Cannot find square root");
1263
1263
  return p;
1264
1264
  }
1265
- const Lt = Ut(ue, void 0, void 0, { sqrt: $e }), De = Ye({
1265
+ const Lt = Ut(ue, void 0, void 0, { sqrt: $e }), We = je({
1266
1266
  a: Ke,
1267
1267
  b: BigInt(7),
1268
1268
  Fp: Lt,
@@ -1286,6 +1286,6 @@ const Lt = Ut(ue, void 0, void 0, { sqrt: $e }), De = Ye({
1286
1286
  }
1287
1287
  }, be);
1288
1288
  export {
1289
- De as secp256k1
1289
+ We as secp256k1
1290
1290
  };
1291
- //# sourceMappingURL=secp256k1-BbMQ_WWG.js.map
1291
+ //# sourceMappingURL=secp256k1-Bm3EstvG.js.map