@goodwidget/ai-credits-widget 0.1.12 → 0.1.13

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.
@@ -7,7 +7,7 @@ import {
7
7
  buildQuoteAmounts,
8
8
  buildSetOperatorPayload,
9
9
  totalCreditUsdFromProfile
10
- } from "../chunk-HFKD7MN7.js";
10
+ } from "../chunk-5AGZTMIN.js";
11
11
 
12
12
  // src/mocked/AiCreditsMockWidget.tsx
13
13
  import { useMemo } from "react";
package/dist/register.cjs CHANGED
@@ -30,6 +30,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
+ // package.json
34
+ var version;
35
+ var init_package = __esm({
36
+ "package.json"() {
37
+ version = "0.1.13";
38
+ }
39
+ });
40
+
33
41
  // src/signerKeyDerivation.ts
34
42
  function buildSignerKeyMessage(payerAddress) {
35
43
  return `Generate a key for G$ credits from payer wallet of '${payerAddress.toLowerCase()}'`;
@@ -572,7 +580,7 @@ async function signWithdrawPrincipal(params) {
572
580
  types: WITHDRAW_PRINCIPAL_TYPES,
573
581
  primaryType: "WithdrawPrincipal",
574
582
  message: {
575
- signer: params.signer,
583
+ buyer: params.signer,
576
584
  amount: params.amountMicro,
577
585
  recipient: params.recipient,
578
586
  nonce: params.nonce
@@ -627,7 +635,10 @@ var init_signerSignatures = __esm({
627
635
  };
628
636
  WITHDRAW_PRINCIPAL_TYPES = {
629
637
  WithdrawPrincipal: [
630
- { name: "signer", type: "address" },
638
+ // `buyer` is the contract's field name; the value is our signer address.
639
+ // EIP-712 hashes field names, so renaming this to `signer` changes the
640
+ // struct hash and the vault rejects the withdrawal with InvalidSignature().
641
+ { name: "buyer", type: "address" },
631
642
  { name: "amount", type: "uint256" },
632
643
  { name: "recipient", type: "address" },
633
644
  { name: "nonce", type: "uint256" }
@@ -7041,18 +7052,21 @@ function AiCreditsWidget({
7041
7052
  showWalletControls
7042
7053
  }
7043
7054
  ),
7044
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui20.ToastContainer, {})
7055
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui20.ToastContainer, {}),
7056
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui21.WidgetVersion, { name: "AI Credits", version })
7045
7057
  ] })
7046
7058
  }
7047
7059
  );
7048
7060
  }
7049
- var import_react18, import_core3, import_ui20, import_jsx_runtime19, CELO_CHAIN_ID3;
7061
+ var import_react18, import_core3, import_ui20, import_ui21, import_jsx_runtime19, CELO_CHAIN_ID3;
7050
7062
  var init_AiCreditsWidget = __esm({
7051
7063
  "src/AiCreditsWidget.tsx"() {
7052
7064
  "use strict";
7053
7065
  import_react18 = __toESM(require("react"), 1);
7054
7066
  import_core3 = require("@goodwidget/core");
7055
7067
  import_ui20 = require("@goodwidget/ui");
7068
+ init_package();
7069
+ import_ui21 = require("@goodwidget/ui");
7056
7070
  init_adapter();
7057
7071
  init_useAiCreditsHistory();
7058
7072
  init_components();