@dexterai/connect 0.34.0 → 0.35.0
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/{accountIdentity-DQ_C-WAi.d.ts → accountIdentity-BHazSkuz.d.ts} +1 -8
- package/dist/{chunk-SLI2QCWN.js → chunk-5B3IO3JU.js} +22 -1
- package/dist/{chunk-Q7HTBUJF.js → chunk-SGWYN67U.js} +679 -935
- package/dist/{chunk-3SBEND6T.js → chunk-ZVUFVXUG.js} +1 -1
- package/dist/{connectionContract-BA03zq2D.d.ts → connectionContract-CSZiddpS.d.ts} +1 -1
- package/dist/hosted.d.ts +1 -1
- package/dist/hosted.js +5 -12
- package/dist/index.d.ts +55 -5
- package/dist/index.js +52 -7
- package/dist/react.d.ts +18 -4
- package/dist/react.js +86 -11
- package/package.json +13 -1
|
@@ -265,14 +265,7 @@ interface CreateWalletResult {
|
|
|
265
265
|
/** Dexter-signed proof used to restore this Wallet's account relationship. */
|
|
266
266
|
walletIdentityProof: WalletIdentityProof;
|
|
267
267
|
}
|
|
268
|
-
/**
|
|
269
|
-
* Mint a brand-new Dexter wallet (passkey + vault). Commit mode (the default)
|
|
270
|
-
* makes it active immediately; provisional mode returns it without changing
|
|
271
|
-
* the active-wallet store.
|
|
272
|
-
*
|
|
273
|
-
* One passkey approval. Throws ConnectError on any failed leg (the `code` is the
|
|
274
|
-
* server's error string, or webauthn_failed / no_credential for the ceremony).
|
|
275
|
-
*/
|
|
268
|
+
/** Always rejects with `dexter_wallet_closed`. Use enrollAccountIdentity for new users. */
|
|
276
269
|
declare function createWallet(config?: CreateWalletConfig): Promise<CreateWalletResult>;
|
|
277
270
|
|
|
278
271
|
declare const ACCOUNT_IDENTITY_API_PATH = "/api/connect/account-identity";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
subscribe,
|
|
11
11
|
walletBindingCandidate,
|
|
12
12
|
walletProofSessionStore
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SGWYN67U.js";
|
|
14
14
|
|
|
15
15
|
// src/relationController.ts
|
|
16
16
|
function provisionalRelation(walletPresent, accountPresent) {
|
|
@@ -533,6 +533,24 @@ function createDexterControlModel(intent, relation) {
|
|
|
533
533
|
});
|
|
534
534
|
}
|
|
535
535
|
|
|
536
|
+
// src/policy.ts
|
|
537
|
+
var SESSION_TTL_30D = "2592000";
|
|
538
|
+
function usdToAtomic(input) {
|
|
539
|
+
const cleaned = input.trim().replace(/^\$/, "").replace(/,/g, "");
|
|
540
|
+
if (!/^\d+(\.\d{1,6})?$/.test(cleaned)) return null;
|
|
541
|
+
const [whole, frac = ""] = cleaned.split(".");
|
|
542
|
+
try {
|
|
543
|
+
return BigInt(whole) * 1000000n + BigInt((frac + "000000").slice(0, 6));
|
|
544
|
+
} catch {
|
|
545
|
+
return null;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
function authoredPolicy(usdInput) {
|
|
549
|
+
const atomic = usdToAtomic(usdInput);
|
|
550
|
+
if (atomic === null || atomic <= 0n) return null;
|
|
551
|
+
return { spendLimitAtomic: atomic.toString(), sessionTtlSeconds: SESSION_TTL_30D };
|
|
552
|
+
}
|
|
553
|
+
|
|
536
554
|
// src/phase.ts
|
|
537
555
|
var PHASE_LABEL = {
|
|
538
556
|
challenge: "Preparing\u2026",
|
|
@@ -610,6 +628,9 @@ export {
|
|
|
610
628
|
connectDexterIdentity,
|
|
611
629
|
disconnectDexterIdentity,
|
|
612
630
|
createDexterControlModel,
|
|
631
|
+
SESSION_TTL_30D,
|
|
632
|
+
usdToAtomic,
|
|
633
|
+
authoredPolicy,
|
|
613
634
|
ceremonyPhaseLabel,
|
|
614
635
|
passkeySignalSupport,
|
|
615
636
|
renamePasskey,
|