@tempoxyz/id 0.0.0-pr-908.sha-652e644 → 0.0.0-pr-932.sha-4cb07e0

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.
@@ -2,9 +2,9 @@ import {
2
2
  attach,
3
3
  create,
4
4
  pending
5
- } from "./chunk-ZPSZWBSP.js";
5
+ } from "./chunk-EAF4AWMZ.js";
6
6
  import "./chunk-FWGE6HXK.js";
7
- import "./chunk-RPK2XRIH.js";
7
+ import "./chunk-3QNRH5KK.js";
8
8
  import "./chunk-Y7KQRRJL.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  InvalidError
3
3
  } from "./chunk-2T7V6ASK.js";
4
- import "./chunk-O3TDRJRS.js";
4
+ import "./chunk-YNWE34XO.js";
5
5
  import {
6
6
  authPath,
7
7
  basePath,
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  PendingNotFoundError,
12
12
  RequestError
13
- } from "./chunk-RPK2XRIH.js";
13
+ } from "./chunk-3QNRH5KK.js";
14
14
  import "./chunk-Y7KQRRJL.js";
15
15
  import "./chunk-MLKGABMK.js";
16
16
 
@@ -95,7 +95,11 @@ function create(options) {
95
95
  }
96
96
  async function login(request) {
97
97
  const url = new URL(request.url);
98
- const started = await backend.start({ redirectUri: redirectUri(request) }).catch((error) => {
98
+ const started = await backend.start({
99
+ loginHint: url.searchParams.get("loginHint") || void 0,
100
+ prompt: url.searchParams.get("prompt") === "login" ? "login" : void 0,
101
+ redirectUri: redirectUri(request)
102
+ }).catch((error) => {
99
103
  if (error instanceof RequestError && answered(error)) return error;
100
104
  throw error;
101
105
  });
@@ -5,8 +5,8 @@ import {
5
5
  machines,
6
6
  prompt,
7
7
  waiting
8
- } from "./chunk-67E3BWY5.js";
9
- import "./chunk-RPK2XRIH.js";
8
+ } from "./chunk-QPZ5JYWN.js";
9
+ import "./chunk-3QNRH5KK.js";
10
10
  import "./chunk-Y7KQRRJL.js";
11
11
  import "./chunk-MLKGABMK.js";
12
12
  export {
@@ -65,7 +65,7 @@ __export(account_exports, {
65
65
  updateAccessKey: () => updateAccessKey,
66
66
  upgrade: () => upgrade
67
67
  });
68
- import { Base64 as Base643, Hex as Hex2 } from "ox";
68
+ import { Address as Address2, Base64 as Base643, Hex as Hex2 } from "ox";
69
69
  import { Authentication } from "ox/webauthn";
70
70
  import {
71
71
  formatTransactionReceipt
@@ -623,6 +623,20 @@ var messages = {
623
623
  // ../../accounts/src/internal/Payment.ts
624
624
  import { Hex } from "ox";
625
625
  var hexPattern = /^0x(?:[0-9a-fA-F]{2})*$/;
626
+ var amountPattern = /^(\d+(\.\d*)?|\.\d+)$/;
627
+ var decimals = 6;
628
+ function amount(value) {
629
+ const fraction = typeof value === "string" ? value.split(".")[1] ?? "" : "";
630
+ if (typeof value === "string" && amountPattern.test(value) && /[1-9]/.test(value) && !/[1-9]/.test(fraction.slice(decimals)))
631
+ return value;
632
+ throw new RequestError({
633
+ code: "invalid_request",
634
+ field: "amount",
635
+ message: `Invalid \`amount\`: "${String(value)}" is not a decimal above 0 with at most 6 decimal places. Pass such a decimal string, such as \`'50'\`.`,
636
+ reason: "invalid_field",
637
+ status: 0
638
+ });
639
+ }
626
640
  function memo(value) {
627
641
  const hex = hexPattern.test(value) ? value : Hex.fromString(value);
628
642
  if (Hex.size(hex) >= 1 && Hex.size(hex) <= 32) return hex;
@@ -696,8 +710,8 @@ function apple() {
696
710
  return /Macintosh/.test(agent) && navigator.maxTouchPoints > 1;
697
711
  }
698
712
  function coinflow(options) {
699
- const { amount: amount2, chainId, token: token2 } = options;
700
- if (amount2 === void 0 || token2 !== "MACH") return false;
713
+ const { amount: amount3, chainId, token: token2 } = options;
714
+ if (amount3 === void 0 || token2 !== "MACH") return false;
701
715
  if (chainId !== ids.mainnet) return false;
702
716
  return apple();
703
717
  }
@@ -844,7 +858,8 @@ async function get(auth, options = {}) {
844
858
  return tempoAccount(account2, { getFn: options.getFn });
845
859
  }
846
860
  async function pay(auth, options) {
847
- const { account: account2, amount: amount2, note, to, token: token2 } = options;
861
+ const { account: account2, challenge, note, to, token: token2 } = options;
862
+ const amount3 = amount(options.amount);
848
863
  const memo2 = options.memo === void 0 ? void 0 : memo(options.memo);
849
864
  if (typeof document === "undefined") throw new PageRequiredError();
850
865
  const redirectUri = approvalRedirectUri(auth, options);
@@ -854,9 +869,10 @@ async function pay(auth, options) {
854
869
  noun: "payment",
855
870
  path: "/pay",
856
871
  query: {
857
- account: account2,
858
- amount: amount2,
872
+ ...account2 !== void 0 ? { account: account2 } : {},
873
+ amount: amount3,
859
874
  chain_id: String(options.chainId ?? auth.chainId),
875
+ ...challenge !== void 0 ? { challenge } : {},
860
876
  client_id: auth.clientId,
861
877
  ...memo2 !== void 0 ? { memo: memo2 } : {},
862
878
  ...note !== void 0 ? { note } : {},
@@ -869,7 +885,22 @@ async function pay(auth, options) {
869
885
  });
870
886
  const transaction = transactionOf(url2, { redirectUri });
871
887
  if (!transaction) throw transactionOf.missing();
872
- return { transaction };
888
+ const address = (() => {
889
+ const value = parameter(url2, { name: "account", redirectUri });
890
+ if (value !== void 0 && Address2.validate(value, { strict: false }))
891
+ return Address2.checksum(value);
892
+ if (value === void 0 && account2 !== void 0) return account2;
893
+ throw missing("account");
894
+ })();
895
+ if (challenge === void 0)
896
+ return { address, transaction };
897
+ const challengeSignature2 = parameter(url2, {
898
+ name: "challenge_signature",
899
+ redirectUri
900
+ });
901
+ if (!challengeSignature2 || !Hex2.validate(challengeSignature2))
902
+ throw missing("challenge_signature");
903
+ return { address, challengeSignature: challengeSignature2, transaction };
873
904
  }
874
905
  async function revokeAccessKey(auth, options) {
875
906
  const { accessKey: accessKey2, account: account2, chainId } = options;
@@ -1098,7 +1129,7 @@ async function approve(auth, options) {
1098
1129
  let unwatch;
1099
1130
  try {
1100
1131
  return await new Promise((resolve3, reject) => {
1101
- void import("./Sheet-6HHKPVI5.js").then(
1132
+ void import("./Sheet-AQ6OZBKO.js").then(
1102
1133
  (Sheet2) => {
1103
1134
  if (settled) return;
1104
1135
  unblock = Sheet2.waiting({
@@ -1144,7 +1175,7 @@ async function approve(auth, options) {
1144
1175
  if (popup === null) throw new BlockedError();
1145
1176
  return await watch2(popup);
1146
1177
  }
1147
- const Sheet = await import("./Sheet-6HHKPVI5.js");
1178
+ const Sheet = await import("./Sheet-AQ6OZBKO.js");
1148
1179
  signal?.throwIfAborted();
1149
1180
  let abort;
1150
1181
  let close;
@@ -1242,6 +1273,14 @@ function transactionOf(url2, options) {
1242
1273
  return transaction;
1243
1274
  throw transactionOf.missing();
1244
1275
  }
1276
+ function missing(name) {
1277
+ return new RequestError({
1278
+ code: "invalid_request",
1279
+ field: name,
1280
+ message: `Invalid \`${name}\` in the return URL: it is missing or malformed. Check the account on Tempo ID, then try again.`,
1281
+ status: 0
1282
+ });
1283
+ }
1245
1284
  transactionOf.missing = () => new RequestError({
1246
1285
  code: "invalid_request",
1247
1286
  field: "transaction",
@@ -1261,7 +1300,7 @@ function thirdParty(clientId) {
1261
1300
  import { Authentication as Authentication2 } from "ox/webauthn";
1262
1301
 
1263
1302
  // ../../accounts/src/internal/Request.ts
1264
- import { AbiFunction, Address as Address4, Base64 as Base644, Bytes as Bytes2, Hash as Hash2, Hex as Hex3 } from "ox";
1303
+ import { AbiFunction, Address as Address5, Base64 as Base644, Bytes as Bytes2, Hash as Hash2, Hex as Hex3 } from "ox";
1265
1304
  import { zeroAddress } from "viem";
1266
1305
 
1267
1306
  // ../../accounts/src/internal/Pending.ts
@@ -1270,15 +1309,15 @@ function from2(value) {
1270
1309
  }
1271
1310
 
1272
1311
  // ../../accounts/src/Permissions.ts
1273
- import { Address as Address3, Value as Value2 } from "ox";
1312
+ import { Address as Address4, Value as Value2 } from "ox";
1274
1313
  import { KeyAuthorization } from "ox/tempo";
1275
1314
  import { Addresses as Addresses2, Scopes, Selectors } from "viem/tempo";
1276
1315
  import { defineToken, tokens as tokens2 } from "viem/tokens";
1277
1316
 
1278
1317
  // ../../accounts/src/internal/FeeAllowance.ts
1279
- import { Address as Address2, Value } from "ox";
1318
+ import { Address as Address3, Value } from "ox";
1280
1319
  import { Addresses } from "viem/tempo";
1281
- var amount = "0.1";
1320
+ var amount2 = "0.1";
1282
1321
  var spenders = [
1283
1322
  Addresses.feeManager,
1284
1323
  Addresses.stablecoinDex,
@@ -1299,20 +1338,20 @@ function from3(options) {
1299
1338
  if (spends(scopes.map((scope) => scope.address))) return void 0;
1300
1339
  const stablecoins = tokens3.filter((token2) => symbols.includes(token2.symbol));
1301
1340
  if (stablecoins.some(
1302
- (token2) => limits.some((entry) => Address2.isEqual(entry.address, token2.address))
1341
+ (token2) => limits.some((entry) => Address3.isEqual(entry.address, token2.address))
1303
1342
  ))
1304
1343
  return void 0;
1305
1344
  const allowance = stablecoins.filter(
1306
- (token2) => !scopes.some((scope) => Address2.isEqual(scope.address, token2.address))
1345
+ (token2) => !scopes.some((scope) => Address3.isEqual(scope.address, token2.address))
1307
1346
  ).map((token2) => ({
1308
- limit: Value.from(amount, token2.decimals),
1347
+ limit: Value.from(amount2, token2.decimals),
1309
1348
  token: token2.address
1310
1349
  }));
1311
1350
  return allowance.length ? allowance : void 0;
1312
1351
  }
1313
1352
  function spends(targets) {
1314
1353
  return targets.some(
1315
- (target) => spenders.some((address) => Address2.isEqual(target, address))
1354
+ (target) => spenders.some((address) => Address3.isEqual(target, address))
1316
1355
  );
1317
1356
  }
1318
1357
 
@@ -1463,8 +1502,8 @@ function resolve(permissions2, options) {
1463
1502
  function listing(options) {
1464
1503
  const { chainId, token: token2 } = options;
1465
1504
  const listed = listings({ chainId });
1466
- if (Address3.validate(token2, { strict: false })) {
1467
- const match2 = listed.find((entry) => Address3.isEqual(entry.address, token2));
1505
+ if (Address4.validate(token2, { strict: false })) {
1506
+ const match2 = listed.find((entry) => Address4.isEqual(entry.address, token2));
1468
1507
  return match2 ?? { address: token2 };
1469
1508
  }
1470
1509
  const match = listed.find((entry) => entry.symbol === token2.toLowerCase());
@@ -1479,7 +1518,7 @@ function listings(options) {
1479
1518
  if (!address) return [];
1480
1519
  return [
1481
1520
  {
1482
- address: Address3.checksum(address),
1521
+ address: Address4.checksum(address),
1483
1522
  decimals: entry.decimals,
1484
1523
  symbol: entry.symbol.toLowerCase()
1485
1524
  }
@@ -1644,7 +1683,7 @@ function permissions(auth, options) {
1644
1683
  status: 0
1645
1684
  });
1646
1685
  const duplicate = limits.map((entry, index) => ({ entry, index })).find(
1647
- (item) => limits.slice(0, item.index).some((earlier) => Address4.isEqual(earlier.token, item.entry.token))
1686
+ (item) => limits.slice(0, item.index).some((earlier) => Address5.isEqual(earlier.token, item.entry.token))
1648
1687
  );
1649
1688
  if (duplicate)
1650
1689
  throw new RequestError({
@@ -1659,7 +1698,7 @@ function permissions(auth, options) {
1659
1698
  const repeated = scopes.map((scope, index) => ({ index, scope })).find((item) => {
1660
1699
  const { address } = item.scope;
1661
1700
  if (item.scope.selector === void 0 && tip20(item.scope)) return false;
1662
- if (!Address4.validate(address, { strict: false })) return false;
1701
+ if (!Address5.validate(address, { strict: false })) return false;
1663
1702
  const key2 = address.toLowerCase();
1664
1703
  const call = item.scope.selector === void 0 ? void 0 : selector(item.scope.selector);
1665
1704
  const named = rules.get(key2);
@@ -1687,7 +1726,7 @@ function permissions(auth, options) {
1687
1726
  for (const list of lists) {
1688
1727
  const seen = /* @__PURE__ */ new Set();
1689
1728
  const position = list.values.findIndex((value) => {
1690
- if (!Address4.validate(value, { strict: false })) return false;
1729
+ if (!Address5.validate(value, { strict: false })) return false;
1691
1730
  const address = value.toLowerCase();
1692
1731
  if (address === zeroAddress || seen.has(address)) return true;
1693
1732
  seen.add(address);
@@ -2091,7 +2130,7 @@ function get2(clientId) {
2091
2130
  }
2092
2131
 
2093
2132
  // ../../accounts/src/internal/Core.ts
2094
- import { Address as Address5 } from "ox";
2133
+ import { Address as Address6 } from "ox";
2095
2134
  import { KeyAuthorization as KeyAuthorization3 } from "ox/tempo";
2096
2135
 
2097
2136
  // ../../accounts/src/internal/Session.ts
@@ -3979,7 +4018,7 @@ async function run(context, parameters) {
3979
4018
  const renewing = context.session.renewing()?.accessKey;
3980
4019
  const derived = parameters.renew && parameters.accessKey === void 0 && // A lifetime that ended before the response renews without the derived access key, as its
3981
4020
  // expiry has passed.
3982
- renewing?.lifetime && renewing.lifetime > 0 && (parameters.account === void 0 || Address5.isEqual(parameters.account, renewing.account)) ? {
4021
+ renewing?.lifetime && renewing.lifetime > 0 && (parameters.account === void 0 || Address6.isEqual(parameters.account, renewing.account)) ? {
3983
4022
  ...fromAccessKey(renewing),
3984
4023
  expiry: Math.floor(Date.now() / 1e3) + renewing.lifetime
3985
4024
  } : void 0;
@@ -4054,7 +4093,9 @@ function refresh3(context, options = {}) {
4054
4093
  }
4055
4094
  const change = context.session.change({ sent: refreshToken, update: true });
4056
4095
  await change.prepare().catch(change.fail);
4057
- const spansContexts = typeof indexedDB !== "undefined" && !!globalThis.navigator?.locks;
4096
+ const locks = !!globalThis.navigator?.locks;
4097
+ const spansContexts = typeof indexedDB !== "undefined" && locks;
4098
+ const final = spansContexts || locks && context.config.store?.local === true;
4058
4099
  const send = () => refresh(context.config, { refreshToken });
4059
4100
  let rotating = false;
4060
4101
  let refused = false;
@@ -4070,7 +4111,7 @@ function refresh3(context, options = {}) {
4070
4111
  );
4071
4112
  if ("tokens" in result) return result.tokens;
4072
4113
  const refusal2 = !unanswered(result.error) && result.error instanceof RequestError && result.error.code === "invalid_grant";
4073
- const retry = unanswered(result.error) || refusal2 && (rotating || !spansContexts && !refused);
4114
+ const retry = unanswered(result.error) || refusal2 && (rotating || !final && !refused);
4074
4115
  if (!retry || delay === void 0) throw refusalError ?? result.error;
4075
4116
  if (!refusal2) rotating = true;
4076
4117
  if (refusal2 && !spansContexts && refusedAt === void 0) {
@@ -4240,7 +4281,7 @@ function plugin() {
4240
4281
  let loading;
4241
4282
  let loaded_plugin;
4242
4283
  function load() {
4243
- loading ??= import("./dialog-W5EXHYOA.js").then((module) => loaded_plugin = module.dialog()).catch((error3) => {
4284
+ loading ??= import("./dialog-PY4IUIVR.js").then((module) => loaded_plugin = module.dialog()).catch((error3) => {
4244
4285
  loading = void 0;
4245
4286
  throw error3;
4246
4287
  });
@@ -4505,7 +4546,7 @@ function discard(auth) {
4505
4546
  preloads.delete(auth);
4506
4547
  }
4507
4548
  async function open(auth, options) {
4508
- const { amount: amount2, currency, signal, token: token2 } = options;
4549
+ const { amount: amount3, currency, signal, token: token2 } = options;
4509
4550
  if (typeof options.address === "object")
4510
4551
  Promise.resolve(options.address).catch(() => void 0);
4511
4552
  signal?.throwIfAborted();
@@ -4514,7 +4555,7 @@ async function open(auth, options) {
4514
4555
  const value = options.mode ?? "frame";
4515
4556
  if (value !== "frame") return value;
4516
4557
  if (coinflow({
4517
- amount: amount2,
4558
+ amount: amount3,
4518
4559
  chainId: options.chainId ?? auth.chainId,
4519
4560
  token: token2
4520
4561
  }))
@@ -4524,7 +4565,7 @@ async function open(auth, options) {
4524
4565
  const redirectUri = options.redirectUri ?? auth.redirectUri ?? `${window.location.origin}/`;
4525
4566
  const toUrl = (address, entry = { mode }) => pageUrl(auth, {
4526
4567
  address,
4527
- amount: amount2,
4568
+ amount: amount3,
4528
4569
  chainId: options.chainId,
4529
4570
  currency,
4530
4571
  entry,
@@ -4549,7 +4590,7 @@ async function open(auth, options) {
4549
4590
  throw new OriginError2({ origin: window.location.origin, redirectUri });
4550
4591
  if (mode === "popup" && options.mode !== "popup" && !activated()) {
4551
4592
  const address = await abortable(read2(), { signal });
4552
- const Sheet = await import("./Sheet-6HHKPVI5.js");
4593
+ const Sheet = await import("./Sheet-AQ6OZBKO.js");
4553
4594
  return await new Promise((resolve3, reject) => {
4554
4595
  const abort = () => {
4555
4596
  close();
@@ -4612,7 +4653,7 @@ async function preload(auth, options) {
4612
4653
  const entry = { ready: Promise.resolve(), sheet: void 0, url: url2 };
4613
4654
  preloads.set(auth, entry);
4614
4655
  entry.ready = (async () => {
4615
- const Sheet = await import("./Sheet-6HHKPVI5.js").catch(() => void 0);
4656
+ const Sheet = await import("./Sheet-AQ6OZBKO.js").catch(() => void 0);
4616
4657
  if (!document.body)
4617
4658
  await new Promise(
4618
4659
  (resolve3) => document.addEventListener("DOMContentLoaded", resolve3, {
@@ -4638,7 +4679,7 @@ async function watch(auth, options) {
4638
4679
  try {
4639
4680
  return await new Promise(
4640
4681
  (resolve3, reject) => {
4641
- void import("./Sheet-6HHKPVI5.js").then(
4682
+ void import("./Sheet-AQ6OZBKO.js").then(
4642
4683
  (Sheet) => {
4643
4684
  if (settled) return;
4644
4685
  unblock = Sheet.waiting({
@@ -4676,7 +4717,7 @@ async function watch(auth, options) {
4676
4717
  }
4677
4718
  }
4678
4719
  function pageUrl(auth, options) {
4679
- const { amount: amount2, currency, entry, token: token2 } = options;
4720
+ const { amount: amount3, currency, entry, token: token2 } = options;
4680
4721
  const url2 = new URL(
4681
4722
  entry.mode === "redirect" ? "/deposit" : "/embed/deposit",
4682
4723
  auth.url
@@ -4690,7 +4731,7 @@ function pageUrl(auth, options) {
4690
4731
  client_id: auth.clientId,
4691
4732
  ...entry.mode === "popup" ? { display: entry.mode } : {},
4692
4733
  ...currency === void 0 ? {} : { funding_currency: currency },
4693
- ...amount2 === void 0 ? {} : { funding_hint: amount2 },
4734
+ ...amount3 === void 0 ? {} : { funding_hint: amount3 },
4694
4735
  ...token2 === void 0 ? {} : { funding_token: token2 },
4695
4736
  ...entry.method ? { method: entry.method } : {},
4696
4737
  redirect_uri: options.redirectUri
@@ -4733,13 +4774,13 @@ function parse(url2, options) {
4733
4774
  const status = appended("deposit_status");
4734
4775
  if (status === "continued") return { status };
4735
4776
  if (status !== "received") return void 0;
4736
- const amount2 = appended("deposit_amount");
4737
- return amount2 === void 0 ? { status } : { amount: amount2, status };
4777
+ const amount3 = appended("deposit_amount");
4778
+ return amount3 === void 0 ? { status } : { amount: amount3, status };
4738
4779
  }
4739
4780
  async function frame(auth, options) {
4740
4781
  const { redirectUri, signal, toUrl } = options;
4741
4782
  const address = await abortable(options.address, { signal });
4742
- const Sheet = await import("./Sheet-6HHKPVI5.js");
4783
+ const Sheet = await import("./Sheet-AQ6OZBKO.js");
4743
4784
  signal?.throwIfAborted();
4744
4785
  const url2 = toUrl(address);
4745
4786
  const held = preloads.get(auth);
@@ -4764,7 +4805,8 @@ async function frame(auth, options) {
4764
4805
  const popup = openPopup(
4765
4806
  toUrl(address, {
4766
4807
  amount: entry.amount,
4767
- method: entry.method,
4808
+ // Only the payment page requests a sign-in as another user.
4809
+ method: entry.method === "mach" ? entry.method : void 0,
4768
4810
  mode: "popup"
4769
4811
  })
4770
4812
  );
@@ -5354,7 +5396,7 @@ function create4(options = {}) {
5354
5396
  function connections2() {
5355
5397
  if (!connectionsOptions)
5356
5398
  return Promise.reject(new ConnectionsRequiredError());
5357
- attached ??= import("./Connections-UDKWNSI3.js").then(
5399
+ attached ??= import("./Connections-AX5X2RZF.js").then(
5358
5400
  (module) => module.attach(config, connectionsOptions)
5359
5401
  );
5360
5402
  return attached;
@@ -5411,7 +5453,7 @@ function create4(options = {}) {
5411
5453
  },
5412
5454
  handler: {
5413
5455
  async fetch(request2) {
5414
- server ??= import("./Server-DQB4UEEV.js").then(
5456
+ server ??= import("./Server-ZYZUW27T.js").then(
5415
5457
  (module) => module.create({
5416
5458
  accessKeys: connectionsOptions ? async () => (await connections2()).accessKeyEndpoint : void 0,
5417
5459
  // The `backend` plugin's actions sit on the instance under its `id`.
@@ -5430,7 +5472,14 @@ function create4(options = {}) {
5430
5472
  },
5431
5473
  pay: async (parameters) => {
5432
5474
  const chainId = parameters.chainId ?? chain.get();
5475
+ amount(parameters.amount);
5433
5476
  const memo2 = parameters.memo === void 0 ? void 0 : memo(parameters.memo);
5477
+ if (parameters.challenge !== void 0)
5478
+ return await pay(config, {
5479
+ ...parameters,
5480
+ chainId,
5481
+ memo: memo2
5482
+ });
5434
5483
  const held = context.session.get();
5435
5484
  const account2 = parameters.account ?? (chainId === chain.get() ? held?.account?.address ?? held?.accessKey?.account : void 0) ?? (await getAccount2({ chainId }))?.address;
5436
5485
  if (!account2) throw new SignedOutError2();
@@ -5438,7 +5487,7 @@ function create4(options = {}) {
5438
5487
  for (const plugin2 of plugins) {
5439
5488
  const attempt = plugin2.hooks?.pay?.(context, payment);
5440
5489
  const sent = attempt && await attempt;
5441
- if (sent) return sent;
5490
+ if (sent) return { ...sent, address: account2 };
5442
5491
  }
5443
5492
  return await pay(config, payment);
5444
5493
  },
@@ -2,16 +2,16 @@ import {
2
2
  bind,
3
3
  from,
4
4
  passkey_exports
5
- } from "./chunk-VLQTOGOE.js";
5
+ } from "./chunk-UAKLEULG.js";
6
6
  import {
7
7
  dialog_exports
8
- } from "./chunk-YN2QG5LX.js";
8
+ } from "./chunk-DFOXBHFR.js";
9
9
  import {
10
10
  redirect_exports
11
- } from "./chunk-O3TDRJRS.js";
11
+ } from "./chunk-YNWE34XO.js";
12
12
  import {
13
13
  connections_exports
14
- } from "./chunk-ZPSZWBSP.js";
14
+ } from "./chunk-EAF4AWMZ.js";
15
15
  import {
16
16
  AccessKey_exports,
17
17
  Accounts_exports,
@@ -50,7 +50,7 @@ import {
50
50
  unlisted,
51
51
  user,
52
52
  withoutAccessKey
53
- } from "./chunk-RPK2XRIH.js";
53
+ } from "./chunk-3QNRH5KK.js";
54
54
  import {
55
55
  __export
56
56
  } from "./chunk-MLKGABMK.js";
@@ -443,7 +443,7 @@ async function signIn2(auth2, options) {
443
443
  return { ...next, options: next.options };
444
444
  })();
445
445
  if (creation && prepared.accessKey && options.accessKey) {
446
- const { register } = await import("./passkey-VQ3CYVON.js");
446
+ const { register } = await import("./passkey-PDR4MOJV.js");
447
447
  const registered = await register(auth2, {
448
448
  accessKey: { ...options.accessKey, account: prepared.accessKey.signer },
449
449
  challenge: options.challenge,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  handleCallback,
3
3
  handleResult
4
- } from "./chunk-O3TDRJRS.js";
4
+ } from "./chunk-YNWE34XO.js";
5
5
  import {
6
6
  create,
7
7
  prompt,
8
8
  waiting
9
- } from "./chunk-67E3BWY5.js";
9
+ } from "./chunk-QPZ5JYWN.js";
10
10
  import {
11
11
  authPath,
12
12
  basePath
@@ -28,7 +28,7 @@ import {
28
28
  pushes,
29
29
  resources,
30
30
  watchPopup
31
- } from "./chunk-RPK2XRIH.js";
31
+ } from "./chunk-3QNRH5KK.js";
32
32
  import {
33
33
  __export
34
34
  } from "./chunk-MLKGABMK.js";
@@ -8,7 +8,7 @@ import {
8
8
  from,
9
9
  json,
10
10
  post
11
- } from "./chunk-RPK2XRIH.js";
11
+ } from "./chunk-3QNRH5KK.js";
12
12
  import {
13
13
  __export
14
14
  } from "./chunk-MLKGABMK.js";
@@ -2,7 +2,7 @@ import {
2
2
  openPopup,
3
3
  received,
4
4
  watchPopup
5
- } from "./chunk-RPK2XRIH.js";
5
+ } from "./chunk-3QNRH5KK.js";
6
6
 
7
7
  // ../../accounts/src/internal/Sheet.ts
8
8
  import {
@@ -529,10 +529,14 @@ function load(options) {
529
529
  else if (data?.type === "tempo-id:embed.callback" && typeof data.url === "string")
530
530
  handlers()?.onCallback(data.url);
531
531
  else if (data?.type === "tempo-id:embed.popup") {
532
- const popup = data.method === "mach" ? {
533
- ...typeof data.amount === "string" ? { amount: data.amount } : {},
534
- method: "mach"
535
- } : {};
532
+ const popup = (() => {
533
+ if (data.method === "switch") return { method: "switch" };
534
+ if (data.method !== "mach") return {};
535
+ return {
536
+ ...typeof data.amount === "string" ? { amount: data.amount } : {},
537
+ method: "mach"
538
+ };
539
+ })();
536
540
  if (popup.method && handlers()?.onPopup({ ...popup, automatic: true }))
537
541
  return;
538
542
  offer(popup);
@@ -15,7 +15,7 @@ import {
15
15
  tempoAccount,
16
16
  tokens,
17
17
  user
18
- } from "./chunk-RPK2XRIH.js";
18
+ } from "./chunk-3QNRH5KK.js";
19
19
  import {
20
20
  __export
21
21
  } from "./chunk-MLKGABMK.js";
@@ -18,7 +18,7 @@ import {
18
18
  tokens,
19
19
  url,
20
20
  user
21
- } from "./chunk-RPK2XRIH.js";
21
+ } from "./chunk-3QNRH5KK.js";
22
22
  import {
23
23
  __export
24
24
  } from "./chunk-MLKGABMK.js";
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  env,
3
3
  login
4
- } from "../chunk-YK2XKACO.js";
4
+ } from "../chunk-AOA6RRSB.js";
5
5
  import "../chunk-2T7V6ASK.js";
6
- import "../chunk-VLQTOGOE.js";
7
- import "../chunk-YN2QG5LX.js";
8
- import "../chunk-O3TDRJRS.js";
9
- import "../chunk-67E3BWY5.js";
10
- import "../chunk-ZPSZWBSP.js";
6
+ import "../chunk-UAKLEULG.js";
7
+ import "../chunk-DFOXBHFR.js";
8
+ import "../chunk-YNWE34XO.js";
9
+ import "../chunk-QPZ5JYWN.js";
10
+ import "../chunk-EAF4AWMZ.js";
11
11
  import "../chunk-FWGE6HXK.js";
12
12
  import {
13
13
  Accounts_exports
14
- } from "../chunk-RPK2XRIH.js";
14
+ } from "../chunk-3QNRH5KK.js";
15
15
  import "../chunk-Y7KQRRJL.js";
16
16
  import "../chunk-MLKGABMK.js";
17
17
 
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  env,
3
3
  remove
4
- } from "../chunk-YK2XKACO.js";
4
+ } from "../chunk-AOA6RRSB.js";
5
5
  import "../chunk-2T7V6ASK.js";
6
- import "../chunk-VLQTOGOE.js";
7
- import "../chunk-YN2QG5LX.js";
8
- import "../chunk-O3TDRJRS.js";
9
- import "../chunk-67E3BWY5.js";
10
- import "../chunk-ZPSZWBSP.js";
6
+ import "../chunk-UAKLEULG.js";
7
+ import "../chunk-DFOXBHFR.js";
8
+ import "../chunk-YNWE34XO.js";
9
+ import "../chunk-QPZ5JYWN.js";
10
+ import "../chunk-EAF4AWMZ.js";
11
11
  import "../chunk-FWGE6HXK.js";
12
- import "../chunk-RPK2XRIH.js";
12
+ import "../chunk-3QNRH5KK.js";
13
13
  import "../chunk-Y7KQRRJL.js";
14
14
  import "../chunk-MLKGABMK.js";
15
15
 
@@ -2,15 +2,15 @@ import {
2
2
  env,
3
3
  signedOut,
4
4
  whoami
5
- } from "../chunk-YK2XKACO.js";
5
+ } from "../chunk-AOA6RRSB.js";
6
6
  import "../chunk-2T7V6ASK.js";
7
- import "../chunk-VLQTOGOE.js";
8
- import "../chunk-YN2QG5LX.js";
9
- import "../chunk-O3TDRJRS.js";
10
- import "../chunk-67E3BWY5.js";
11
- import "../chunk-ZPSZWBSP.js";
7
+ import "../chunk-UAKLEULG.js";
8
+ import "../chunk-DFOXBHFR.js";
9
+ import "../chunk-YNWE34XO.js";
10
+ import "../chunk-QPZ5JYWN.js";
11
+ import "../chunk-EAF4AWMZ.js";
12
12
  import "../chunk-FWGE6HXK.js";
13
- import "../chunk-RPK2XRIH.js";
13
+ import "../chunk-3QNRH5KK.js";
14
14
  import "../chunk-Y7KQRRJL.js";
15
15
  import "../chunk-MLKGABMK.js";
16
16
 
@@ -3,9 +3,9 @@ import {
3
3
  preload,
4
4
  signIn,
5
5
  signMessage
6
- } from "./chunk-YN2QG5LX.js";
7
- import "./chunk-O3TDRJRS.js";
8
- import "./chunk-67E3BWY5.js";
6
+ } from "./chunk-DFOXBHFR.js";
7
+ import "./chunk-YNWE34XO.js";
8
+ import "./chunk-QPZ5JYWN.js";
9
9
  import {
10
10
  authPath,
11
11
  basePath
@@ -20,7 +20,7 @@ import {
20
20
  revokeAccessKey,
21
21
  toSession,
22
22
  updateAccessKey
23
- } from "./chunk-RPK2XRIH.js";
23
+ } from "./chunk-3QNRH5KK.js";
24
24
  import "./chunk-Y7KQRRJL.js";
25
25
  import "./chunk-MLKGABMK.js";
26
26
 
@@ -3,8 +3,8 @@ import {
3
3
  prepare,
4
4
  register,
5
5
  signIn
6
- } from "./chunk-VLQTOGOE.js";
7
- import "./chunk-RPK2XRIH.js";
6
+ } from "./chunk-UAKLEULG.js";
7
+ import "./chunk-3QNRH5KK.js";
8
8
  import "./chunk-Y7KQRRJL.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
  export {
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "node": ">=24.21"
10
10
  },
11
11
  "name": "@tempoxyz/id",
12
- "version": "0.0.0-pr-908.sha-652e644",
12
+ "version": "0.0.0-pr-932.sha-4cb07e0",
13
13
  "description": "The tempo-id CLI: sign in to Tempo ID, and call its API and the Admin API.",
14
14
  "type": "module",
15
15
  "bin": {