@tempoxyz/patron 0.0.25 → 0.0.26

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/bin.js CHANGED
@@ -12,6 +12,6 @@ if (process.argv[2] === "hook") {
12
12
  await runPayProcess().catch(() => void 0);
13
13
  process.exit(0);
14
14
  } else {
15
- const { run } = await import("./chunks/-ZZLSTHT6.js");
15
+ const { run } = await import("./chunks/-WOZ4DM2Y.js");
16
16
  process.exitCode = await run(process.argv.slice(2));
17
17
  }
@@ -700,10 +700,10 @@ async function linkRefillFailedAt(home) {
700
700
  var REFILL_LOCK_STALE_MS = 5 * 60 * 1e3;
701
701
  var defaultOpenWallet = async (settings, config, issuer, maxUnits) => {
702
702
  if (config.wallet === "link") {
703
- const { openLinkWallet } = await import("./wallet-7M2LEO4J.js");
703
+ const { openLinkWallet } = await import("./wallet-IDSQUCB5.js");
704
704
  return openLinkWallet(config, maxUnits);
705
705
  }
706
- const { openWallet } = await import("./wallet-7M2LEO4J.js");
706
+ const { openWallet } = await import("./wallet-IDSQUCB5.js");
707
707
  return openWallet(settings, config.wallet, issuer, maxUnits);
708
708
  };
709
709
  async function buyWithinBudget(settings, config, wanted, openWallet = defaultOpenWallet) {
@@ -1072,7 +1072,7 @@ async function tempoSignIn(deps, budgetUnits, issuer) {
1072
1072
  deps,
1073
1073
  deps.settings.privateKey ? "Using PATRON_PRIVATE_KEY" : "Signing in with Tempo Wallet"
1074
1074
  );
1075
- const { signIn } = await import("./wallet-7M2LEO4J.js");
1075
+ const { signIn } = await import("./wallet-IDSQUCB5.js");
1076
1076
  const account = await signIn(deps.settings, {
1077
1077
  budgetUnits,
1078
1078
  issuer,
@@ -1186,7 +1186,7 @@ async function changeBudget(deps, input) {
1186
1186
  } else budget = await askBudget(deps, config.monthlyBudgetUsd);
1187
1187
  if (config.wallet === "tempo" && budget > config.monthlyBudgetUsd) {
1188
1188
  step(deps, "Approve the new spending limit in Tempo Wallet");
1189
- const { authorizeBudget } = await import("./wallet-7M2LEO4J.js");
1189
+ const { authorizeBudget } = await import("./wallet-IDSQUCB5.js");
1190
1190
  const issuer = await loadIssuer(settings.home, settings.gatewayUrl, {
1191
1191
  fetch: deps.fetch
1192
1192
  });
@@ -1302,7 +1302,7 @@ async function setName(deps, name) {
1302
1302
  const issuer = await loadIssuer(settings.home, settings.gatewayUrl, {
1303
1303
  fetch: deps.fetch
1304
1304
  });
1305
- const open = deps.openWallet ?? (async (s, c, i, max) => (await import("./wallet-7M2LEO4J.js")).openWallet(s, c.wallet, i, max));
1305
+ const open = deps.openWallet ?? (async (s, c, i, max) => (await import("./wallet-IDSQUCB5.js")).openWallet(s, c.wallet, i, max));
1306
1306
  const wallet = await open(settings, config, issuer, 0n);
1307
1307
  await setProfile(settings.gatewayUrl, wallet, name, deps.fetch);
1308
1308
  await writeConfig(settings.home, { ...config, name });
@@ -36,7 +36,7 @@ var BUDGET_PERIOD_SECONDS = 30 * 24 * 60 * 60;
36
36
  async function signIn(settings, options) {
37
37
  if (settings.privateKey)
38
38
  return { address: privateKeyToAccount(settings.privateKey).address, wallet: "key" };
39
- const provider = tempoProvider(settings, options.issuer.chainId, options.output);
39
+ const provider = tempoProvider(settings, options.issuer, options.output);
40
40
  await Store.waitForHydration(provider.store);
41
41
  const result = await provider.request({
42
42
  method: "wallet_connect",
@@ -57,7 +57,7 @@ async function signIn(settings, options) {
57
57
  }
58
58
  async function authorizeBudget(settings, options) {
59
59
  if (settings.privateKey) return;
60
- const provider = tempoProvider(settings, options.issuer.chainId, options.output);
60
+ const provider = tempoProvider(settings, options.issuer, options.output);
61
61
  await Store.waitForHydration(provider.store);
62
62
  await provider.request({
63
63
  method: "wallet_authorizeAccessKey",
@@ -89,7 +89,7 @@ async function openWallet(settings, wallet, issuer, maxUnits, output = process.s
89
89
  signMessage: (message) => account.signMessage({ message })
90
90
  };
91
91
  }
92
- const provider = tempoProvider(settings, issuer.chainId, output);
92
+ const provider = tempoProvider(settings, issuer, output);
93
93
  await Store.waitForHydration(provider.store);
94
94
  const [address] = await provider.request({ method: "eth_accounts" });
95
95
  if (!address)
@@ -142,8 +142,9 @@ function budgetLimit(budgetUnits, currency) {
142
142
  token: currency
143
143
  };
144
144
  }
145
- function tempoProvider(settings, chainId, output) {
146
- const chain = chainId === tempoModerato.id ? tempoModerato : tempo;
145
+ function tempoProvider(settings, issuer, output) {
146
+ const base = issuer.chainId === tempoModerato.id ? tempoModerato : tempo;
147
+ const chain = base.extend({ feeToken: issuer.currency });
147
148
  return CliProvider.create({
148
149
  chains: [chain],
149
150
  mpp: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempoxyz/patron",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "Pay the websites your AI agents read, privately",
5
5
  "type": "module",
6
6
  "bin": {