@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.
- package/dist/{Connections-UDKWNSI3.js → Connections-AX5X2RZF.js} +2 -2
- package/dist/{Server-DQB4UEEV.js → Server-ZYZUW27T.js} +7 -3
- package/dist/{Sheet-6HHKPVI5.js → Sheet-AQ6OZBKO.js} +2 -2
- package/dist/{chunk-RPK2XRIH.js → chunk-3QNRH5KK.js} +92 -43
- package/dist/{chunk-YK2XKACO.js → chunk-AOA6RRSB.js} +6 -6
- package/dist/{chunk-YN2QG5LX.js → chunk-DFOXBHFR.js} +3 -3
- package/dist/{chunk-ZPSZWBSP.js → chunk-EAF4AWMZ.js} +1 -1
- package/dist/{chunk-67E3BWY5.js → chunk-QPZ5JYWN.js} +9 -5
- package/dist/{chunk-VLQTOGOE.js → chunk-UAKLEULG.js} +1 -1
- package/dist/{chunk-O3TDRJRS.js → chunk-YNWE34XO.js} +1 -1
- package/dist/commands/login.js +7 -7
- package/dist/commands/logout.js +7 -7
- package/dist/commands/whoami.js +7 -7
- package/dist/{dialog-W5EXHYOA.js → dialog-PY4IUIVR.js} +4 -4
- package/dist/{passkey-VQ3CYVON.js → passkey-PDR4MOJV.js} +2 -2
- package/package.json +1 -1
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
attach,
|
|
3
3
|
create,
|
|
4
4
|
pending
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EAF4AWMZ.js";
|
|
6
6
|
import "./chunk-FWGE6HXK.js";
|
|
7
|
-
import "./chunk-
|
|
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-
|
|
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-
|
|
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({
|
|
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
|
});
|
|
@@ -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:
|
|
700
|
-
if (
|
|
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,
|
|
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:
|
|
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
|
-
|
|
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-
|
|
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-
|
|
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
|
|
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
|
|
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
|
|
1318
|
+
import { Address as Address3, Value } from "ox";
|
|
1280
1319
|
import { Addresses } from "viem/tempo";
|
|
1281
|
-
var
|
|
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) =>
|
|
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) =>
|
|
1345
|
+
(token2) => !scopes.some((scope) => Address3.isEqual(scope.address, token2.address))
|
|
1307
1346
|
).map((token2) => ({
|
|
1308
|
-
limit: Value.from(
|
|
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) =>
|
|
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 (
|
|
1467
|
-
const match2 = listed.find((entry) =>
|
|
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:
|
|
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) =>
|
|
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 (!
|
|
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 (!
|
|
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
|
|
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 ||
|
|
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
|
|
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 || !
|
|
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-
|
|
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:
|
|
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:
|
|
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:
|
|
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-
|
|
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-
|
|
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-
|
|
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:
|
|
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
|
-
...
|
|
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
|
|
4737
|
-
return
|
|
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-
|
|
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
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
5
|
+
} from "./chunk-UAKLEULG.js";
|
|
6
6
|
import {
|
|
7
7
|
dialog_exports
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DFOXBHFR.js";
|
|
9
9
|
import {
|
|
10
10
|
redirect_exports
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YNWE34XO.js";
|
|
12
12
|
import {
|
|
13
13
|
connections_exports
|
|
14
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
4
|
+
} from "./chunk-YNWE34XO.js";
|
|
5
5
|
import {
|
|
6
6
|
create,
|
|
7
7
|
prompt,
|
|
8
8
|
waiting
|
|
9
|
-
} from "./chunk-
|
|
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-
|
|
31
|
+
} from "./chunk-3QNRH5KK.js";
|
|
32
32
|
import {
|
|
33
33
|
__export
|
|
34
34
|
} from "./chunk-MLKGABMK.js";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
openPopup,
|
|
3
3
|
received,
|
|
4
4
|
watchPopup
|
|
5
|
-
} from "./chunk-
|
|
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 =
|
|
533
|
-
|
|
534
|
-
method
|
|
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);
|
package/dist/commands/login.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
env,
|
|
3
3
|
login
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-AOA6RRSB.js";
|
|
5
5
|
import "../chunk-2T7V6ASK.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
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-
|
|
14
|
+
} from "../chunk-3QNRH5KK.js";
|
|
15
15
|
import "../chunk-Y7KQRRJL.js";
|
|
16
16
|
import "../chunk-MLKGABMK.js";
|
|
17
17
|
|
package/dist/commands/logout.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
env,
|
|
3
3
|
remove
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-AOA6RRSB.js";
|
|
5
5
|
import "../chunk-2T7V6ASK.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
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-
|
|
12
|
+
import "../chunk-3QNRH5KK.js";
|
|
13
13
|
import "../chunk-Y7KQRRJL.js";
|
|
14
14
|
import "../chunk-MLKGABMK.js";
|
|
15
15
|
|
package/dist/commands/whoami.js
CHANGED
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
env,
|
|
3
3
|
signedOut,
|
|
4
4
|
whoami
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-AOA6RRSB.js";
|
|
6
6
|
import "../chunk-2T7V6ASK.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
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-
|
|
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-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
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-
|
|
23
|
+
} from "./chunk-3QNRH5KK.js";
|
|
24
24
|
import "./chunk-Y7KQRRJL.js";
|
|
25
25
|
import "./chunk-MLKGABMK.js";
|
|
26
26
|
|
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-
|
|
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": {
|