pay_hash 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ import path2 from "path";
41
41
  import { fileURLToPath as fileURLToPath2 } from "url";
42
42
 
43
43
  // src/constants.ts
44
- var TEMPO_TESTNET_CHAIN_ID = 42429;
44
+ var TEMPO_TESTNET_CHAIN_ID = 42431;
45
45
 
46
46
  // src/render.ts
47
47
  import Handlebars2 from "handlebars";
@@ -71,9 +71,11 @@ function renderReceiptHtml({
71
71
  bodyFontSize: template.bodyFontSize || 14,
72
72
  receiptTitle: template.subject || "Payment Receipt",
73
73
  footerText: template.footerText || "Powered by PayHash",
74
- txHash: receipt.transactionHash,
75
- payer: receipt.from,
76
- timestamp: new Date(receipt.timestamp).toUTCString(),
74
+ txHash: receipt.receipt?.transactionHash || receipt.transactionHash,
75
+ payer: receipt.receipt?.from || receipt.from,
76
+ timestamp: new Date(
77
+ receipt.receipt?.timestamp || receipt.timestamp
78
+ ).toUTCString(),
77
79
  year: (/* @__PURE__ */ new Date()).getFullYear(),
78
80
  amount: params.amount,
79
81
  token: tokenName
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pay_hash",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "PayHash SDK is a professional TypeScript library designed to streamline blockchain payments, receipt generation, and automated email notifications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/constants.ts CHANGED
@@ -1 +1 @@
1
- export const TEMPO_TESTNET_CHAIN_ID = 42429;
1
+ export const TEMPO_TESTNET_CHAIN_ID = 42431;
package/src/render.ts CHANGED
@@ -19,9 +19,9 @@ export function renderReceiptHtml({
19
19
  const templateSource = fs.readFileSync(
20
20
  path.join(
21
21
  template.emailTemplatePath ?? __dirname,
22
- template.emailTemplateName ?? "mailTemplate.hbs"
22
+ template.emailTemplateName ?? "mailTemplate.hbs",
23
23
  ),
24
- "utf8"
24
+ "utf8",
25
25
  );
26
26
  const templates = Handlebars.compile(templateSource);
27
27
  return templates({
@@ -32,9 +32,11 @@ export function renderReceiptHtml({
32
32
  bodyFontSize: template.bodyFontSize || 14,
33
33
  receiptTitle: template.subject || "Payment Receipt",
34
34
  footerText: template.footerText || "Powered by PayHash",
35
- txHash: receipt.transactionHash,
36
- payer: receipt.from,
37
- timestamp: new Date(receipt.timestamp).toUTCString(),
35
+ txHash: receipt.receipt?.transactionHash || receipt.transactionHash,
36
+ payer: receipt.receipt?.from || receipt.from,
37
+ timestamp: new Date(
38
+ receipt.receipt?.timestamp || receipt.timestamp,
39
+ ).toUTCString(),
38
40
  year: new Date().getFullYear(),
39
41
  amount: params.amount,
40
42
  token: tokenName,