@universal-everything/sdk-core 1.1.0-dev.651a832 → 1.1.0-dev.6819996

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/index.d.ts CHANGED
@@ -139,6 +139,8 @@ type Profile = {
139
139
  status?: ProfileStatus;
140
140
  defaultControllerId: string | null;
141
141
  controllers: ControllerSummary[];
142
+ /** The owner-level deploy-time controller (lowercase) or `null` = unknown. */
143
+ generatingController: string | null;
142
144
  createdAt: string;
143
145
  };
144
146
  /**
@@ -157,6 +159,12 @@ type ChainStatus = {
157
159
  profileId: string;
158
160
  chainId: number;
159
161
  status: ProfileStatus;
162
+ /**
163
+ * The owner-level controller the LSP23 deploy granted (lowercase), or
164
+ * `null` = unknown. Clients compare it with their own keystore to tell a
165
+ * *created* profile from an *Imported* (secondary-key) one.
166
+ */
167
+ generatingController: string | null;
160
168
  label: string | null;
161
169
  defaultControllerId: string | null;
162
170
  controllers: ControllerSummary[];
@@ -172,8 +180,83 @@ type ChainStatus = {
172
180
  * `getProfileByAddress`. Address is the natural primary key once a UP
173
181
  * may live on multiple chains (handoff G1).
174
182
  */
183
+ /** A subscription currently covering an identity. */
184
+ type CoveredBy = {
185
+ subscriptionId: string;
186
+ /**
187
+ * `self` = owned by the caller's account. `other` (a foreign covering
188
+ * subscription) is reserved for R2's explicit membership — the server only
189
+ * emits `self` today.
190
+ */
191
+ owner: "self" | "other";
192
+ tier: string;
193
+ status: string;
194
+ source: string;
195
+ };
196
+ /**
197
+ * Server-side extend verdict — ADVISORY. `reason` reports the ownership and
198
+ * capacity gates the extend route enforces for this session; target-dependent
199
+ * gates (chain availability, tier chain allow-list, LSP23 package / factory /
200
+ * deployability) come from `extend-targets` and at submit, so `null` means
201
+ * "no ownership or capacity refusal", not "extend will succeed". Whether THIS
202
+ * device can extend (holds the generating key) is the client's call from
203
+ * `generatingController`.
204
+ */
205
+ type ExtendVerdictReason = "not_active" | "held_by_another_login" | "subscription_required" | "cross_chain_cap_reached" | "capacity_unknown";
206
+ type ExtendVerdict = {
207
+ /**
208
+ * Chains the identity is live on (active / pending), across every login of
209
+ * the holder account — NOT candidate targets; those come from
210
+ * `GET /v1/profiles/:id/extend-targets`, whose occupancy check is scoped to
211
+ * the calling login.
212
+ */
213
+ chains: number[];
214
+ reason: ExtendVerdictReason | null;
215
+ };
216
+ /** One entry of `GET /v1/subscriptions` — a subscription of the caller's account. */
217
+ type SubscriptionSummary = {
218
+ subscriptionId: string;
219
+ /** Always `self` today; `other` (a subscription that only covers one of your profiles) arrives with explicit membership. */
220
+ owner: "self" | "other";
221
+ tier: string;
222
+ status: string;
223
+ /** `active` or `trialing`. */
224
+ live: boolean;
225
+ source: "stripe" | "apple" | "google" | "admin";
226
+ currentPeriodEnd: string | null;
227
+ /** Where Manage goes: `stripe` ⇒ {@link RelayerClient.createPortalSession}; `apple` / `google` ⇒ the store; `admin` ⇒ nothing. */
228
+ manage: {
229
+ kind: "stripe" | "apple" | "google" | "admin";
230
+ };
231
+ };
232
+ /** `GET /v1/me` — the authenticated login and its account context. */
233
+ type Me = {
234
+ subject: string;
235
+ isAdmin: boolean;
236
+ /** The login's personal account (null only before provisioning). */
237
+ accountId: string | null;
238
+ /** This login's own tier — what the cross-chain cap resolves from. */
239
+ tier: string;
240
+ /**
241
+ * The account's effective tier (best tier across its login subjects) —
242
+ * what gas coverage resolves from. Differs from `tier` only on legacy
243
+ * multi-login accounts.
244
+ */
245
+ accountTier: string;
246
+ };
175
247
  type ProfileWithChains = {
176
248
  address: Hex;
249
+ /**
250
+ * Identity-level generating controller: the value every chain row agrees
251
+ * on; `null` when unknown or when the rows disagree.
252
+ */
253
+ generatingController: string | null;
254
+ /**
255
+ * Present on the `/v1/profiles` mount; omitted on the sig-auth
256
+ * `/v1/relayer/profiles` mirror.
257
+ */
258
+ coveredBy?: CoveredBy[];
259
+ extend: ExtendVerdict;
177
260
  chains: ChainStatus[];
178
261
  };
179
262
  type QuotaSnapshot = {
@@ -313,6 +396,11 @@ type NonceResponse = {
313
396
  nonce: string;
314
397
  issuedAt: string;
315
398
  };
399
+ /** `POST /v1/ipfs/upload-token` — a short-lived bearer for the IPFS upload service. */
400
+ type IpfsUploadTokenResponse = {
401
+ token: string;
402
+ expiresAt: string;
403
+ };
316
404
  type DeployProfileBase = {
317
405
  chainId: number;
318
406
  label?: string | null;
@@ -331,10 +419,17 @@ type DeployProfileBase = {
331
419
  * Deploy a sponsored Universal Profile. Two mutually-exclusive controller
332
420
  * modes:
333
421
  * - **custody**: `controllerWalletId` — a relayer-held wallet row.
334
- * - **external (A1)**: `controllerAddress` + `controlProof` — a user-held key
335
- * (a Privy embedded wallet, or an extension/mobile key) that proves control
336
- * by signing a nonce-bound challenge. Build the proof with
422
+ * - **external (A1)**: `controllerAddress` (+ `controlProof`) — a user-held key
423
+ * (a Privy embedded wallet, or an extension/mobile key). The proof is a
424
+ * signature by that key over a nonce-bound challenge; build it with
337
425
  * `@universal-everything/sdk-core-viem`'s `buildControlProof`.
426
+ *
427
+ * On `/v1` the proof is **optional**: a first-time user has only a social
428
+ * login, and the extension / mobile app holding the new controller cannot sign
429
+ * for a not-yet-deployed profile. When present it is always verified. The next
430
+ * API version makes it mandatory for everyone (relayer
431
+ * `docs/DESIGN_2026-09-10_control-proof-versioning.md`), so callers that CAN
432
+ * sign (a Privy embedded wallet) should always send it.
338
433
  */
339
434
  type DeployProfileInput = (DeployProfileBase & {
340
435
  controllerWalletId: string;
@@ -342,7 +437,7 @@ type DeployProfileInput = (DeployProfileBase & {
342
437
  controlProof?: never;
343
438
  }) | (DeployProfileBase & {
344
439
  controllerAddress: Hex;
345
- controlProof: ControlProof;
440
+ controlProof?: ControlProof;
346
441
  controllerWalletId?: never;
347
442
  });
348
443
  type DeployProfileSingleChainResponse = {
@@ -447,10 +542,7 @@ declare class TierError extends WalletKitError {
447
542
  declare class WalletKitClient {
448
543
  #private;
449
544
  constructor(config: WalletKitClientConfig);
450
- me(): Promise<{
451
- subject: string;
452
- isAdmin: boolean;
453
- }>;
545
+ me(): Promise<Me>;
454
546
  listWallets(): Promise<Wallet[]>;
455
547
  getWallet(walletId: string): Promise<Wallet>;
456
548
  createWallet(input?: {
@@ -475,6 +567,14 @@ declare class WalletKitClient {
475
567
  * bind an A1 control proof for an external-controller {@link deployProfile}.
476
568
  */
477
569
  getNonce(): Promise<NonceResponse>;
570
+ /**
571
+ * Mint a short-lived (~120s) HS256 token for the IPFS upload service
572
+ * (`POST /v1/ipfs/upload-token`, authenticated). Fetch one per upload:
573
+ * the token is meant to expire within the service's 600s window (which the
574
+ * service does not enforce today — see the relayer's routes/ipfs.ts). 503
575
+ * when the relayer has no upload secret configured.
576
+ */
577
+ getIpfsUploadToken(): Promise<IpfsUploadTokenResponse>;
478
578
  importProfile(input: {
479
579
  address: Hex;
480
580
  chainId: number;
@@ -498,6 +598,23 @@ declare class WalletKitClient {
498
598
  * default (`source === null`) when they have no paid subscription.
499
599
  */
500
600
  getSubscription(): Promise<SubscriptionResponse>;
601
+ /**
602
+ * Every subscription of the caller's account, live ones first — what the
603
+ * dashboard's account / subscription dropdown renders.
604
+ */
605
+ listSubscriptions(): Promise<{
606
+ subscriptions: SubscriptionSummary[];
607
+ }>;
608
+ /**
609
+ * Stripe Customer Portal URL for the caller's own Stripe subscription.
610
+ * Rejects with `manage_in_store` (409) for an Apple / Google subscription
611
+ * and `no_subscription` (404) when there is nothing to manage.
612
+ */
613
+ createPortalSession(opts?: {
614
+ returnOrigin?: string;
615
+ }): Promise<{
616
+ url: string;
617
+ }>;
501
618
  /**
502
619
  * Start a Stripe Checkout for a tier and return the created session
503
620
  * `{ id, url }`. In a browser this ALSO navigates to `url` by default
@@ -539,4 +656,4 @@ declare class IdentityError extends Error {
539
656
  constructor(code: IdentityErrorCode, message: string);
540
657
  }
541
658
 
542
- export { type ChainStatus, type CheckoutSession, type ControlProof, type ControllerSummary, type DeployProfileInput, type DeployProfileMultiChainResponse, type DeployProfileResponse, type DeployProfileSingleChainResponse, type DeployQueueStatus, type ExportCompleteResponse, type ExportRequestInput, type ExportRequestResponse, type ExportedKey, type FreeDefaultSnapshot, type Hex, IdentityError, type IdentityErrorCode, type IdentityProvider, type ImportBeginResponse, type ImportCompleteInput, type ImportCompleteResponse, KeyCustodyError, type KeyCustodyErrorCode, type KeyCustodyOpContext, type KeyCustodyProvider, type NonceResponse, type OpContext, type OpenCheckoutInput, type Profile, type ProfileStatus, type ProfileWithChains, type QuotaSnapshot, type RelaySponsoredInput, type RelaySponsoredResponse, type SignLsp25Input, type SignLsp25Response, type SignMessageResponse, type SignTransactionInput, type SignTransactionResponse, type SignTxRequest, type Subject, type SubscriptionResponse, type SubscriptionSnapshot, TIER_ERROR_CODES, TierError, type VerifiedToken, type VerifyOptions, type Wallet, type WalletInfo, WalletKitClient, type WalletKitClientConfig, WalletKitError, createWalletKitClient };
659
+ export { type ChainStatus, type CheckoutSession, type ControlProof, type ControllerSummary, type CoveredBy, type DeployProfileInput, type DeployProfileMultiChainResponse, type DeployProfileResponse, type DeployProfileSingleChainResponse, type DeployQueueStatus, type ExportCompleteResponse, type ExportRequestInput, type ExportRequestResponse, type ExportedKey, type ExtendVerdict, type ExtendVerdictReason, type FreeDefaultSnapshot, type Hex, IdentityError, type IdentityErrorCode, type IdentityProvider, type ImportBeginResponse, type ImportCompleteInput, type ImportCompleteResponse, type IpfsUploadTokenResponse, KeyCustodyError, type KeyCustodyErrorCode, type KeyCustodyOpContext, type KeyCustodyProvider, type Me, type NonceResponse, type OpContext, type OpenCheckoutInput, type Profile, type ProfileStatus, type ProfileWithChains, type QuotaSnapshot, type RelaySponsoredInput, type RelaySponsoredResponse, type SignLsp25Input, type SignLsp25Response, type SignMessageResponse, type SignTransactionInput, type SignTransactionResponse, type SignTxRequest, type Subject, type SubscriptionResponse, type SubscriptionSnapshot, type SubscriptionSummary, TIER_ERROR_CODES, TierError, type VerifiedToken, type VerifyOptions, type Wallet, type WalletInfo, WalletKitClient, type WalletKitClientConfig, WalletKitError, createWalletKitClient };
package/dist/index.js CHANGED
@@ -121,6 +121,16 @@ var WalletKitClient = class {
121
121
  async getNonce() {
122
122
  return this.#request("POST", "/v1/auth/nonce");
123
123
  }
124
+ /**
125
+ * Mint a short-lived (~120s) HS256 token for the IPFS upload service
126
+ * (`POST /v1/ipfs/upload-token`, authenticated). Fetch one per upload:
127
+ * the token is meant to expire within the service's 600s window (which the
128
+ * service does not enforce today — see the relayer's routes/ipfs.ts). 503
129
+ * when the relayer has no upload secret configured.
130
+ */
131
+ async getIpfsUploadToken() {
132
+ return this.#request("POST", "/v1/ipfs/upload-token");
133
+ }
124
134
  async importProfile(input) {
125
135
  return this.#request("POST", "/v1/profiles/import", input);
126
136
  }
@@ -160,6 +170,21 @@ var WalletKitClient = class {
160
170
  async getSubscription() {
161
171
  return this.#request("GET", "/v1/billing/subscription");
162
172
  }
173
+ /**
174
+ * Every subscription of the caller's account, live ones first — what the
175
+ * dashboard's account / subscription dropdown renders.
176
+ */
177
+ async listSubscriptions() {
178
+ return this.#request("GET", "/v1/subscriptions");
179
+ }
180
+ /**
181
+ * Stripe Customer Portal URL for the caller's own Stripe subscription.
182
+ * Rejects with `manage_in_store` (409) for an Apple / Google subscription
183
+ * and `no_subscription` (404) when there is nothing to manage.
184
+ */
185
+ async createPortalSession(opts) {
186
+ return this.#request("POST", "/v1/billing/portal-session", opts ?? {});
187
+ }
163
188
  /**
164
189
  * Start a Stripe Checkout for a tier and return the created session
165
190
  * `{ id, url }`. In a browser this ALSO navigates to `url` by default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universal-everything/sdk-core",
3
- "version": "1.1.0-dev.651a832",
3
+ "version": "1.1.0-dev.6819996",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/universal-everything/universal-relayer.git",