@goodz-core/sdk 0.3.1 → 0.3.3

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/README.md CHANGED
@@ -12,6 +12,37 @@ pnpm add @goodz-core/sdk
12
12
 
13
13
  Runtime dependency: `superjson` only. Works in Node.js 18+, Deno, Bun, Cloudflare Workers, and browsers (any runtime with Fetch API).
14
14
 
15
+ ## Prerequisites: Get Your Credentials
16
+
17
+ Before calling any authenticated API, you need a **GoodZ OAuth App** (`clientId` + `clientSecret`) and a **user access token**. There are two ways to get set up — choose based on who is doing the integration:
18
+
19
+ | Path | Who | How to register | How to get token |
20
+ |------|-----|----------------|------------------|
21
+ | **AI Agent** | An MCP-connected Agent (Claude, GPT, etc.) | Call `register_app()` on Core MCP → credentials returned in response | Call `get_auth_url()` → user logs in → token returned |
22
+ | **Human Developer** | A person writing code | Go to [Developer Console](https://goodzcore.manus.space/dev-hub) → Register App → copy credentials | Implement OAuth flow with `buildAuthorizationUrl()` + `exchangeCode()` |
23
+
24
+ **Agent path (zero-dashboard):**
25
+ ```
26
+ # Connect to GoodZ Core MCP
27
+ MCP endpoint: https://goodzcore.manus.space/api/mcp
28
+
29
+ # Step 1: Register an app (no auth needed to call this)
30
+ register_app({ app_name: "My App", redirect_uris: ["https://myapp.com/callback"] })
31
+ → { client_id: "od_xxxxxxxx", client_secret: "gk_live_..." } # Save these!
32
+
33
+ # Step 2: Get user token
34
+ get_auth_url()
35
+ → { login_url: "https://..." } # User clicks this, logs in, gets token
36
+ ```
37
+
38
+ **Human path (traditional):**
39
+ 1. Visit `https://goodzcore.manus.space/dev-hub` and log in
40
+ 2. Click "Register App" → fill in name and redirect URIs
41
+ 3. Copy `clientId` and `clientSecret` (secret shown once!)
42
+ 4. Implement the OAuth flow in your app (see [Authentication](#authentication) below)
43
+
44
+ > **Don't need user auth?** For read-only public data (catalog, card details, instance profiles), no credentials are needed — just call `createGoodZClient()` without a token.
45
+
15
46
  ## Quick Start
16
47
 
17
48
  ```ts
@@ -93,6 +124,7 @@ Core namespaces communicate via tRPC HTTP wire protocol with `goodzcore.manus.sp
93
124
  | `getDepositPackages(input?)` | Query | Available deposit packages with pricing |
94
125
  | `createDepositOrder(input)` | Mutation | Create Stripe checkout for Z-coin deposit |
95
126
  | `getDepositStatus(input)` | Query | Check deposit checkout session status |
127
+ | `getDepositUrl(input?)` | Query | Generate a deposit deep link URL for third-party app redirects |
96
128
  | `commercialTransfer(input)` | Mutation | **Primary API for secondary market.** Atomic: debit buyer → credit seller → transfer ownership |
97
129
  | `mintAndCharge(input)` | Mutation | **Primary API for primary sales.** Atomic: mint instance → charge buyer |
98
130
  | `chargeUser(input)` | Mutation | Charge Z-coin for in-app purchases |
@@ -102,6 +134,18 @@ Core namespaces communicate via tRPC HTTP wire protocol with `goodzcore.manus.sp
102
134
 
103
135
  `mintAndCharge` is the primary API for primary sales (gacha, direct-from-creator). It mints a new card instance and charges the buyer in one atomic operation. Requires prior mint authorization via `inventory.grantMintAuth`.
104
136
 
137
+ `getDepositUrl` generates a deep link URL that redirects users to Core's deposit page. After completing the Stripe checkout, the user is redirected back to your app via `returnUrl`. This is the recommended way for third-party apps to handle "insufficient balance" scenarios:
138
+
139
+ ```ts
140
+ // When user's balance is too low, redirect them to deposit
141
+ const { url } = await goodz.zcoin.getDepositUrl({
142
+ amount: 100, // suggested amount
143
+ returnUrl: "https://myapp.com/shop", // return here after deposit
144
+ appId: "od_myapp", // your app's client_id
145
+ });
146
+ window.open(url, "_blank");
147
+ ```
148
+
105
149
  ### `goodz.inventory` — Card Instance Management
106
150
 
107
151
  | Method | Type | Description |
@@ -296,6 +340,8 @@ const result = await goodz.alive.rawTool("some_new_tool", { key: "value" });
296
340
 
297
341
  ## Authentication
298
342
 
343
+ > **Where do I get `clientId`?** See [Prerequisites](#prerequisites-get-your-credentials) above. AI Agents call `register_app()` via MCP; human developers register at the [Developer Console](https://goodzcore.manus.space/dev-hub).
344
+
299
345
  ### Static Token (simplest)
300
346
 
301
347
  ```ts
@@ -1,4 +1,4 @@
1
- import { X as TransportConfig } from '../transport-BOlScYEv.js';
1
+ import { $ as TransportConfig } from '../transport-CzoXrUZs.js';
2
2
 
3
3
  /**
4
4
  * @goodz-core/sdk — Alive API Type Definitions
@@ -43,6 +43,7 @@ function createGoodZClient(config = {}) {
43
43
  getDepositPackages: q("zcoin.getDepositPackages"),
44
44
  createDepositOrder: m("zcoin.createDepositOrder"),
45
45
  getDepositStatus: q("zcoin.getDepositStatus"),
46
+ getDepositUrl: q("zcoin.getDepositUrl"),
46
47
  commercialTransfer: m("zcoin.commercialTransfer"),
47
48
  mintAndCharge: m("zcoin.mintAndCharge"),
48
49
  chargeUser: m("zcoin.chargeUser"),
@@ -98,5 +99,5 @@ function createGoodZClient(config = {}) {
98
99
  var createUserClient = createGoodZClient;
99
100
 
100
101
  export { createGoodZClient, createUserClient };
101
- //# sourceMappingURL=chunk-KLMCZG4N.js.map
102
- //# sourceMappingURL=chunk-KLMCZG4N.js.map
102
+ //# sourceMappingURL=chunk-EQUAL5M6.js.map
103
+ //# sourceMappingURL=chunk-EQUAL5M6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":"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","file":"chunk-EQUAL5M6.js","sourcesContent":["/**\n * @goodz-core/sdk/core — Unified GoodZ API Client\n *\n * One client, all services. Stripe-style namespace architecture:\n * goodz.zcoin.* → Core settlement & Z-coin\n * goodz.inventory.* → Core instance management\n * goodz.collectible.* → Core card queries\n * goodz.user.* → Core user profiles\n * goodz.auth.* → Core auth\n * goodz.ip.* → Core IP (franchise/series/card)\n * goodz.commerce.* → Commerce/Shops (MCP)\n * goodz.exchange.* → Exchange marketplace (MCP)\n * goodz.alive.* → Alive companions (MCP)\n *\n * Core uses tRPC HTTP wire protocol; sub-sites use MCP JSON-RPC 2.0.\n * The client handles routing transparently.\n *\n * @example\n * ```ts\n * import { createGoodZClient } from \"@goodz-core/sdk\";\n *\n * const goodz = createGoodZClient({\n * accessToken: \"your-jwt-token\",\n * });\n *\n * // Core APIs\n * const balance = await goodz.zcoin.getMyBalance();\n * const result = await goodz.zcoin.commercialTransfer({ ... });\n *\n * // Commerce APIs\n * const shop = await goodz.commerce.createShop({ name: \"My Shop\" });\n * const order = await goodz.commerce.executePurchase({ campaignId: 1, quantity: 1 });\n *\n * // Exchange APIs\n * const listing = await goodz.exchange.createListing({ ... });\n * const data = await goodz.exchange.getMarketData({ coreGoodzId: 42 });\n *\n * // Alive APIs\n * const chat = await goodz.alive.sendMessage({ instanceId: 1, userId: 1, message: \"Hello!\" });\n * const memories = await goodz.alive.recallMemories({ instanceId: 1, userId: 1, query: \"birthday\" });\n * ```\n *\n * @module\n */\n\nimport { callQuery, callMutation, GoodZApiError } from \"../transport\";\nimport type { TransportConfig } from \"../transport\";\nimport { createMcpTransportConfig } from \"../mcp-transport\";\nimport { createCommerceNamespace } from \"../commerce/index\";\nimport type { CommerceNamespace } from \"../commerce/index\";\nimport { createExchangeNamespace } from \"../exchange/index\";\nimport type { ExchangeNamespace } from \"../exchange/index\";\nimport { createAliveNamespace } from \"../alive/index\";\nimport type { AliveNamespace } from \"../alive/index\";\nimport type {\n // zcoin\n ZcoinGetMyBalanceOutput,\n ZcoinGetMyHistoryInput,\n ZcoinCommercialTransferInput,\n ZcoinCommercialTransferOutput,\n ZcoinMintAndChargeInput,\n ZcoinMintAndChargeOutput,\n ZcoinChargeUserInput,\n ZcoinChargeUserOutput,\n ZcoinCreateDirectPurchaseOrderInput,\n ZcoinCreateDirectPurchaseOrderOutput,\n ZcoinGetDepositPackagesInput,\n ZcoinDepositPackage,\n ZcoinCreateDepositOrderInput,\n ZcoinCreateDepositOrderOutput,\n ZcoinGetDepositStatusInput,\n ZcoinGetDepositStatusOutput,\n ZcoinGetDepositUrlInput,\n ZcoinGetDepositUrlOutput,\n // inventory\n InventoryGetUserInventoryInput,\n InventoryItem,\n InventoryConfirmOwnershipInput,\n InventoryConfirmOwnershipOutput,\n InventoryMintInput,\n InventoryMintOutput,\n InventoryTransferInput,\n InventoryTransferOutput,\n InventoryTransferByCardInput,\n InventoryTransferByCardOutput,\n InventoryGrantMintAuthInput,\n InventoryTransferHistoryInput,\n // collectible\n CollectibleGetInstanceByIdInput,\n CollectibleGetPublicInstanceInput,\n CollectibleGetPublicInstancesBatchInput,\n CollectibleGetCardProfileInput,\n CollectibleGetShellImageUrlInput,\n // user\n UserGetPublicProfileInput,\n UserPublicProfile,\n UserGetPublicProfileByIdInput,\n // auth\n AuthGetOAuthAppInfoInput,\n AuthOAuthAppInfo,\n AuthUser,\n // ip\n FranchiseGetInput,\n SeriesGetInput,\n SeriesListByFranchiseInput,\n CardGetInput,\n CardListBySeriesInput,\n} from \"../types\";\n\n// ─── Re-export types and error class ─────────────────────────\n\nexport { GoodZApiError } from \"../transport\";\nexport type * from \"../types\";\nexport type * from \"../types-commerce\";\nexport type * from \"../types-exchange\";\nexport type * from \"../types-alive\";\nexport type { CommerceNamespace } from \"../commerce/index\";\nexport type { ExchangeNamespace } from \"../exchange/index\";\nexport type { AliveNamespace } from \"../alive/index\";\n\n// ─── Default sub-site URLs ──────────────────────────────────\n\nconst DEFAULT_CORE_URL = \"https://goodzcore.manus.space\";\nconst DEFAULT_COMMERCE_URL = \"https://goodzcommerce.manus.space\";\nconst DEFAULT_EXCHANGE_URL = \"https://goodzexchange.manus.space\";\nconst DEFAULT_ALIVE_URL = \"https://goodzalive.manus.space\";\n\n// ─── Client config ───────────────────────────────────────────\n\nexport interface GoodZClientConfig {\n /**\n * GoodZ.Core base URL.\n * @default \"https://goodzcore.manus.space\"\n */\n coreUrl?: string;\n\n /**\n * GoodZ.Commerce (Shops) base URL.\n * @default \"https://goodzcommerce.manus.space\"\n */\n commerceUrl?: string;\n\n /**\n * GoodZ.Exchange base URL.\n * @default \"https://goodzexchange.manus.space\"\n */\n exchangeUrl?: string;\n\n /**\n * GoodZ.Alive base URL.\n * @default \"https://goodzalive.manus.space\"\n */\n aliveUrl?: string;\n\n /**\n * Static access token (JWT) for authentication.\n * For server-to-server calls, obtain this via OAuth client_credentials flow.\n * For user-context calls, pass the user's access token.\n */\n accessToken?: string;\n\n /**\n * Dynamic token provider — called before every request.\n * Use this when tokens may rotate (e.g., auto-refresh).\n * Takes precedence over `accessToken` if both are set.\n */\n getAccessToken?: () => string | Promise<string>;\n\n /**\n * Custom headers to include in every request.\n * Useful for passing app identifiers or tracing headers.\n */\n headers?: Record<string, string>;\n}\n\n// ─── Core namespace interfaces (tRPC) ───────────────────────\n\nexport interface ZcoinNamespace {\n /** Get the authenticated user's Z-coin balance. */\n getMyBalance(): Promise<ZcoinGetMyBalanceOutput>;\n\n /** Get the authenticated user's Z-coin transaction history. */\n getMyHistory(input?: ZcoinGetMyHistoryInput): Promise<any[]>;\n\n /** Get available Z-coin deposit packages with pricing. */\n getDepositPackages(input?: ZcoinGetDepositPackagesInput): Promise<ZcoinDepositPackage[]>;\n\n /** Create a Stripe checkout session for Z-coin deposit. */\n createDepositOrder(input: ZcoinCreateDepositOrderInput): Promise<ZcoinCreateDepositOrderOutput>;\n\n /** Check the status of a deposit checkout session. */\n getDepositStatus(input: ZcoinGetDepositStatusInput): Promise<ZcoinGetDepositStatusOutput>;\n\n /**\n * Generate a deposit deep link URL for Z-coin top-up.\n * Returns a URL that redirects users to Core's deposit page.\n * After completing the deposit, the user is redirected back to returnUrl.\n *\n * No authentication required — anyone can generate a deposit URL.\n *\n * @example\n * ```ts\n * const { url } = await goodz.zcoin.getDepositUrl({\n * amount: 100,\n * returnUrl: \"https://myapp.com/shop\",\n * appId: \"od_myapp\",\n * });\n * window.open(url, \"_blank\");\n * ```\n */\n getDepositUrl(input?: ZcoinGetDepositUrlInput): Promise<ZcoinGetDepositUrlOutput>;\n\n /**\n * Atomic commercial transfer: Z-coin payment + ownership transfer in one transaction.\n * This is the primary API for Commerce and Exchange purchase flows.\n *\n * Idempotent via referenceId — duplicate calls return the same result.\n *\n * @throws {GoodZApiError} BAD_REQUEST — insufficient balance\n * @throws {GoodZApiError} CONFLICT — version conflict (retry)\n * @throws {GoodZApiError} FORBIDDEN — seller doesn't own instance\n */\n commercialTransfer(input: ZcoinCommercialTransferInput): Promise<ZcoinCommercialTransferOutput>;\n\n /**\n * Mint a new card instance and charge the buyer in one atomic transaction.\n * Used by Commerce for gacha and direct-from-creator purchases.\n *\n * Requires mint authorization (granted via inventory.grantMintAuth).\n * Idempotent via referenceId.\n *\n * @throws {GoodZApiError} FORBIDDEN — no mint authorization\n * @throws {GoodZApiError} BAD_REQUEST — insufficient balance\n */\n mintAndCharge(input: ZcoinMintAndChargeInput): Promise<ZcoinMintAndChargeOutput>;\n\n /**\n * Charge a user's Z-coin balance for an in-app purchase.\n * Used by apps that sell non-GoodZ digital goods/services.\n *\n * Idempotent via appOrderId.\n *\n * @throws {GoodZApiError} BAD_REQUEST — insufficient balance\n * @throws {GoodZApiError} CONFLICT — version conflict\n */\n chargeUser(input: ZcoinChargeUserInput): Promise<ZcoinChargeUserOutput>;\n\n /**\n * Create a direct purchase checkout session (fiat → Z-coin → transfer).\n * Transparent intermediation: user sees fiat price, Core handles conversion.\n */\n createDirectPurchaseOrder(input: ZcoinCreateDirectPurchaseOrderInput): Promise<ZcoinCreateDirectPurchaseOrderOutput>;\n}\n\nexport interface InventoryNamespace {\n /** Get a user's inventory (owned card instances). */\n getUserInventory(input: InventoryGetUserInventoryInput): Promise<InventoryItem[]>;\n\n /** Check if a user owns at least one instance of a specific card. */\n confirmOwnership(input: InventoryConfirmOwnershipInput): Promise<InventoryConfirmOwnershipOutput>;\n\n /**\n * Mint new card instances. Requires franchise ownership or admin role.\n * For Commerce/Exchange, use zcoin.mintAndCharge instead (includes payment).\n */\n mint(input: InventoryMintInput): Promise<InventoryMintOutput>;\n\n /**\n * Transfer a specific card instance to another user.\n * For commercial transfers, use zcoin.commercialTransfer instead.\n *\n * @deprecated for reason=\"purchase\"|\"trade\" — use commercialTransfer\n */\n transfer(input: InventoryTransferInput): Promise<InventoryTransferOutput>;\n\n /**\n * Transfer card instances by cardId (transfers oldest instances).\n * For commercial transfers, use zcoin.commercialTransfer instead.\n *\n * @deprecated for reason=\"purchase\"|\"trade\" — use commercialTransfer\n */\n transferByCard(input: InventoryTransferByCardInput): Promise<InventoryTransferByCardOutput>;\n\n /**\n * Grant mint authorization to another user/app for a specific card.\n * Required before Commerce can call zcoin.mintAndCharge for that card.\n */\n grantMintAuth(input: InventoryGrantMintAuthInput): Promise<any>;\n\n /** Get transfer/ownership history for an instance, card, or user. */\n transferHistory(input: InventoryTransferHistoryInput): Promise<any[]>;\n}\n\nexport interface CollectibleNamespace {\n /** Get a card instance by its numeric ID. Returns full instance data with card chain. */\n getInstanceById(input: CollectibleGetInstanceByIdInput): Promise<any>;\n\n /** Get a card instance by its instance code (public-facing identifier). */\n getPublicInstance(input: CollectibleGetPublicInstanceInput): Promise<any>;\n\n /** Batch-fetch multiple card instances by their IDs (max 100). */\n getPublicInstancesBatch(input: CollectibleGetPublicInstancesBatchInput): Promise<any[]>;\n\n /** Get the card profile (metadata, rarity, series info). */\n getCardProfile(input: CollectibleGetCardProfileInput): Promise<any>;\n\n /** Get the shell (packaging) image URL for a card. */\n getShellImageUrl(input: CollectibleGetShellImageUrlInput): Promise<any>;\n}\n\nexport interface UserNamespace {\n /** Get a user's public profile by openId. */\n getPublicProfile(input: UserGetPublicProfileInput): Promise<UserPublicProfile>;\n\n /** Get a user's public profile by internal userId. */\n getPublicProfileById(input: UserGetPublicProfileByIdInput): Promise<UserPublicProfile>;\n}\n\nexport interface AuthNamespace {\n /** Get the authenticated user's profile. Returns null if not authenticated. */\n me(): Promise<AuthUser | null>;\n\n /** Get public info about an OAuth app by its client ID. */\n getOAuthAppInfo(input: AuthGetOAuthAppInfoInput): Promise<AuthOAuthAppInfo | null>;\n}\n\nexport interface IpNamespace {\n /** Get a franchise by ID or slug. */\n getFranchise(input: FranchiseGetInput): Promise<any>;\n\n /** Get a series by ID or slug. */\n getSeries(input: SeriesGetInput): Promise<any>;\n\n /** List all series in a franchise. */\n listSeriesByFranchise(input: SeriesListByFranchiseInput): Promise<any[]>;\n\n /** Get a card by ID. */\n getCard(input: CardGetInput): Promise<any>;\n\n /** List all cards in a series. */\n listCardsBySeries(input: CardListBySeriesInput): Promise<any[]>;\n}\n\n// ─── GoodZClient type ────────────────────────────────────────\n\nexport interface GoodZClient {\n // ── Core namespaces (tRPC) ──\n readonly zcoin: ZcoinNamespace;\n readonly inventory: InventoryNamespace;\n readonly collectible: CollectibleNamespace;\n readonly user: UserNamespace;\n readonly auth: AuthNamespace;\n readonly ip: IpNamespace;\n\n // ── Sub-site namespaces (MCP) ──\n readonly commerce: CommerceNamespace;\n readonly exchange: ExchangeNamespace;\n readonly alive: AliveNamespace;\n\n /**\n * Make a raw tRPC query call to Core. Use this for routes not yet covered\n * by the typed namespaces.\n */\n rawQuery<T = any>(path: string, input?: any): Promise<T>;\n\n /**\n * Make a raw tRPC mutation call to Core. Use this for routes not yet covered\n * by the typed namespaces.\n */\n rawMutation<T = any>(path: string, input?: any): Promise<T>;\n}\n\n// ─── Client factory ──────────────────────────────────────────\n\n/**\n * Create a unified GoodZ API client — one client for all services.\n *\n * @example Server-to-server with static token\n * ```ts\n * const goodz = createGoodZClient({\n * accessToken: process.env.CORE_ACCESS_TOKEN,\n * });\n *\n * // Core\n * const balance = await goodz.zcoin.getMyBalance();\n *\n * // Commerce\n * const shop = await goodz.commerce.createShop({ name: \"My Shop\" });\n *\n * // Exchange\n * const listings = await goodz.exchange.browseMarketplace();\n *\n * // Alive\n * const chat = await goodz.alive.sendMessage({ instanceId: 1, userId: 1, message: \"Hi!\" });\n * ```\n *\n * @example With dynamic token provider (auto-refresh)\n * ```ts\n * const goodz = createGoodZClient({\n * getAccessToken: async () => {\n * const token = await refreshTokenIfNeeded();\n * return token;\n * },\n * });\n * ```\n *\n * @example Custom sub-site URLs (e.g., staging environment)\n * ```ts\n * const goodz = createGoodZClient({\n * accessToken: \"...\",\n * coreUrl: \"https://staging-core.goodz.dev\",\n * commerceUrl: \"https://staging-commerce.goodz.dev\",\n * exchangeUrl: \"https://staging-exchange.goodz.dev\",\n * aliveUrl: \"https://staging-alive.goodz.dev\",\n * });\n * ```\n */\nexport function createGoodZClient(config: GoodZClientConfig = {}): GoodZClient {\n const {\n coreUrl = DEFAULT_CORE_URL,\n commerceUrl = DEFAULT_COMMERCE_URL,\n exchangeUrl = DEFAULT_EXCHANGE_URL,\n aliveUrl = DEFAULT_ALIVE_URL,\n accessToken,\n getAccessToken,\n headers: customHeaders,\n } = config;\n\n // Shared header builder — used by both tRPC and MCP transports\n const buildHeaders = async (): Promise<Record<string, string>> => {\n const h: Record<string, string> = { ...customHeaders };\n const token = getAccessToken ? await getAccessToken() : accessToken;\n if (token) {\n h[\"Authorization\"] = `Bearer ${token}`;\n }\n return h;\n };\n\n // ── Core transport (tRPC) ──\n const coreTransport: TransportConfig = {\n baseUrl: coreUrl.replace(/\\/$/, \"\"),\n getHeaders: buildHeaders,\n };\n\n // ── Sub-site transports (MCP) ──\n const commerceTransport = createMcpTransportConfig(commerceUrl, buildHeaders);\n const exchangeTransport = createMcpTransportConfig(exchangeUrl, buildHeaders);\n const aliveTransport = createMcpTransportConfig(aliveUrl, buildHeaders);\n\n // Helper shortcuts for Core tRPC\n const q = <I, O>(path: string) => (input?: I) => callQuery<I, O>(coreTransport, path, input);\n const m = <I, O>(path: string) => (input?: I) => callMutation<I, O>(coreTransport, path, input);\n\n return {\n // ── zcoin ──────────────────────────────────────────────\n zcoin: {\n getMyBalance: q<void, ZcoinGetMyBalanceOutput>(\"zcoin.getMyBalance\"),\n getMyHistory: q<ZcoinGetMyHistoryInput, any[]>(\"zcoin.getMyHistory\"),\n getDepositPackages: q<ZcoinGetDepositPackagesInput, ZcoinDepositPackage[]>(\"zcoin.getDepositPackages\"),\n createDepositOrder: m<ZcoinCreateDepositOrderInput, ZcoinCreateDepositOrderOutput>(\"zcoin.createDepositOrder\"),\n getDepositStatus: q<ZcoinGetDepositStatusInput, ZcoinGetDepositStatusOutput>(\"zcoin.getDepositStatus\"),\n getDepositUrl: q<ZcoinGetDepositUrlInput, ZcoinGetDepositUrlOutput>(\"zcoin.getDepositUrl\"),\n commercialTransfer: m<ZcoinCommercialTransferInput, ZcoinCommercialTransferOutput>(\"zcoin.commercialTransfer\"),\n mintAndCharge: m<ZcoinMintAndChargeInput, ZcoinMintAndChargeOutput>(\"zcoin.mintAndCharge\"),\n chargeUser: m<ZcoinChargeUserInput, ZcoinChargeUserOutput>(\"zcoin.chargeUser\"),\n createDirectPurchaseOrder: m<ZcoinCreateDirectPurchaseOrderInput, ZcoinCreateDirectPurchaseOrderOutput>(\"zcoin.createDirectPurchaseOrder\"),\n },\n\n // ── inventory ──────────────────────────────────────────\n inventory: {\n getUserInventory: q<InventoryGetUserInventoryInput, InventoryItem[]>(\"inventory.getUserInventory\"),\n confirmOwnership: q<InventoryConfirmOwnershipInput, InventoryConfirmOwnershipOutput>(\"inventory.confirmOwnership\"),\n mint: m<InventoryMintInput, InventoryMintOutput>(\"inventory.mint\"),\n transfer: m<InventoryTransferInput, InventoryTransferOutput>(\"inventory.transfer\"),\n transferByCard: m<InventoryTransferByCardInput, InventoryTransferByCardOutput>(\"inventory.transferByCard\"),\n grantMintAuth: m<InventoryGrantMintAuthInput, any>(\"inventory.grantMintAuth\"),\n transferHistory: q<InventoryTransferHistoryInput, any[]>(\"inventory.transferHistory\"),\n },\n\n // ── collectible ────────────────────────────────────────\n collectible: {\n getInstanceById: q<CollectibleGetInstanceByIdInput, any>(\"collectible.getInstanceById\"),\n getPublicInstance: q<CollectibleGetPublicInstanceInput, any>(\"collectible.getPublicInstance\"),\n getPublicInstancesBatch: q<CollectibleGetPublicInstancesBatchInput, any[]>(\"collectible.getPublicInstancesBatch\"),\n getCardProfile: q<CollectibleGetCardProfileInput, any>(\"collectible.getCardProfile\"),\n getShellImageUrl: q<CollectibleGetShellImageUrlInput, any>(\"collectible.getShellImageUrl\"),\n },\n\n // ── user ───────────────────────────────────────────────\n user: {\n getPublicProfile: q<UserGetPublicProfileInput, UserPublicProfile>(\"user.getPublicProfile\"),\n getPublicProfileById: q<UserGetPublicProfileByIdInput, UserPublicProfile>(\"user.getPublicProfileById\"),\n },\n\n // ── auth ───────────────────────────────────────────────\n auth: {\n me: q<void, AuthUser | null>(\"auth.me\"),\n getOAuthAppInfo: q<AuthGetOAuthAppInfoInput, AuthOAuthAppInfo | null>(\"auth.getOAuthAppInfo\"),\n },\n\n // ── ip (franchise/series/card) ─────────────────────────\n ip: {\n getFranchise: q<FranchiseGetInput, any>(\"franchise.get\"),\n getSeries: q<SeriesGetInput, any>(\"series.get\"),\n listSeriesByFranchise: q<SeriesListByFranchiseInput, any[]>(\"series.listByFranchise\"),\n getCard: q<CardGetInput, any>(\"card.get\"),\n listCardsBySeries: q<CardListBySeriesInput, any[]>(\"card.listBySeries\"),\n },\n\n // ── commerce (MCP) ─────────────────────────────────────\n commerce: createCommerceNamespace(commerceTransport),\n\n // ── exchange (MCP) ─────────────────────────────────────\n exchange: createExchangeNamespace(exchangeTransport),\n\n // ── alive (MCP) ────────────────────────────────────────\n alive: createAliveNamespace(aliveTransport),\n\n // ── raw escape hatches (Core tRPC only) ────────────────\n rawQuery: <T = any>(path: string, input?: any) => callQuery<any, T>(coreTransport, path, input),\n rawMutation: <T = any>(path: string, input?: any) => callMutation<any, T>(coreTransport, path, input),\n };\n}\n\n/**\n * Alias for createGoodZClient — creates a client acting on behalf of a user.\n * Semantically identical, but makes the intent clearer in server-to-server code.\n */\nexport const createUserClient = createGoodZClient;\n"]}
@@ -1,4 +1,4 @@
1
- import { X as TransportConfig } from '../transport-BOlScYEv.js';
1
+ import { $ as TransportConfig } from '../transport-CzoXrUZs.js';
2
2
 
3
3
  /**
4
4
  * @goodz-core/sdk — Commerce / Shops API Type Definitions
@@ -4,8 +4,8 @@ import { ExchangeNamespace } from '../exchange/index.js';
4
4
  export { CompensationDirection, ExchangeAddToWatchlistInput, ExchangeBid, ExchangeBrowseMarketplaceInput, ExchangeBuyListingInput, ExchangeBuyListingOutput, ExchangeCancelListingInput, ExchangeCancelWtbInput, ExchangeCreateListingInput, ExchangeCreateListingOutput, ExchangeCreateWtbInput, ExchangeFulfillWtbInput, ExchangeFulfillWtbOutput, ExchangeGetBidsInput, ExchangeGetListingDetailInput, ExchangeGetMarketDataInput, ExchangeListing, ExchangeMarketData, ExchangePlaceBidInput, ExchangePlaceBidOutput, ExchangePricePoint, ExchangeProposeTradeInput, ExchangeRemoveFromWatchlistInput, ExchangeRespondToTradeInput, ExchangeRespondToTradeOutput, ExchangeTradeItem, ExchangeTradeProposal, ExchangeWatchlistItem, ExchangeWtb, ListingCondition, ListingType } from '../exchange/index.js';
5
5
  import { AliveNamespace } from '../alive/index.js';
6
6
  export { AliveBuildContextInput, AliveChatResponse, AliveClassifiedIntent, AliveClassifyIntentInput, AliveContext, AliveForgetMemoryInput, AliveGetIntimacyInput, AliveIntimacy, AliveMemory, AliveRecallMemoriesInput, AliveSendMessageInput, AliveStoreMemoryInput, AliveUpdateIntimacyInput, IntentCategory, MemoryType, MoodState } from '../alive/index.js';
7
- import { b as AuthUser, A as AuthGetOAuthAppInfoInput, a as AuthOAuthAppInfo, e as CollectibleGetInstanceByIdInput, f as CollectibleGetPublicInstanceInput, g as CollectibleGetPublicInstancesBatchInput, d as CollectibleGetCardProfileInput, h as CollectibleGetShellImageUrlInput, O as ZcoinGetMyBalanceOutput, Q as ZcoinGetMyHistoryInput, L as ZcoinGetDepositPackagesInput, K as ZcoinDepositPackage, D as ZcoinCreateDepositOrderInput, E as ZcoinCreateDepositOrderOutput, M as ZcoinGetDepositStatusInput, N as ZcoinGetDepositStatusOutput, z as ZcoinCommercialTransferInput, B as ZcoinCommercialTransferOutput, R as ZcoinMintAndChargeInput, V as ZcoinMintAndChargeOutput, Z as ZcoinChargeUserInput, y as ZcoinChargeUserOutput, H as ZcoinCreateDirectPurchaseOrderInput, J as ZcoinCreateDirectPurchaseOrderOutput, l as InventoryGetUserInventoryInput, I as InventoryConfirmOwnershipInput, k as InventoryConfirmOwnershipOutput, n as InventoryMintInput, o as InventoryMintOutput, s as InventoryTransferInput, t as InventoryTransferOutput, p as InventoryTransferByCardInput, q as InventoryTransferByCardOutput, m as InventoryGrantMintAuthInput, r as InventoryTransferHistoryInput, w as UserGetPublicProfileInput, x as UserPublicProfile, U as UserGetPublicProfileByIdInput, F as FranchiseGetInput, u as SeriesGetInput, v as SeriesListByFranchiseInput, C as CardGetInput, c as CardListBySeriesInput } from '../transport-BOlScYEv.js';
8
- export { G as GoodZApiError, i as GoodZApiFieldError, j as GoodZErrorV2, P as PurchaseChannel, S as SaleType, T as TransferReason, W as ZcoinTxType } from '../transport-BOlScYEv.js';
7
+ import { b as AuthUser, A as AuthGetOAuthAppInfoInput, a as AuthOAuthAppInfo, e as CollectibleGetInstanceByIdInput, f as CollectibleGetPublicInstanceInput, g as CollectibleGetPublicInstancesBatchInput, d as CollectibleGetCardProfileInput, h as CollectibleGetShellImageUrlInput, V as ZcoinGetMyBalanceOutput, W as ZcoinGetMyHistoryInput, M as ZcoinGetDepositPackagesInput, L as ZcoinDepositPackage, E as ZcoinCreateDepositOrderInput, H as ZcoinCreateDepositOrderOutput, N as ZcoinGetDepositStatusInput, O as ZcoinGetDepositStatusOutput, Q as ZcoinGetDepositUrlInput, R as ZcoinGetDepositUrlOutput, B as ZcoinCommercialTransferInput, D as ZcoinCommercialTransferOutput, X as ZcoinMintAndChargeInput, Y as ZcoinMintAndChargeOutput, Z as ZcoinChargeUserInput, z as ZcoinChargeUserOutput, J as ZcoinCreateDirectPurchaseOrderInput, K as ZcoinCreateDirectPurchaseOrderOutput, l as InventoryGetUserInventoryInput, n as InventoryItem, I as InventoryConfirmOwnershipInput, k as InventoryConfirmOwnershipOutput, o as InventoryMintInput, p as InventoryMintOutput, t as InventoryTransferInput, u as InventoryTransferOutput, q as InventoryTransferByCardInput, r as InventoryTransferByCardOutput, m as InventoryGrantMintAuthInput, s as InventoryTransferHistoryInput, x as UserGetPublicProfileInput, y as UserPublicProfile, U as UserGetPublicProfileByIdInput, F as FranchiseGetInput, v as SeriesGetInput, w as SeriesListByFranchiseInput, C as CardGetInput, c as CardListBySeriesInput } from '../transport-CzoXrUZs.js';
8
+ export { G as GoodZApiError, i as GoodZApiFieldError, j as GoodZErrorV2, P as PurchaseChannel, S as SaleType, T as TransferReason, _ as ZcoinTxType } from '../transport-CzoXrUZs.js';
9
9
 
10
10
  /**
11
11
  * @goodz-core/sdk/core — Unified GoodZ API Client
@@ -102,6 +102,24 @@ interface ZcoinNamespace {
102
102
  createDepositOrder(input: ZcoinCreateDepositOrderInput): Promise<ZcoinCreateDepositOrderOutput>;
103
103
  /** Check the status of a deposit checkout session. */
104
104
  getDepositStatus(input: ZcoinGetDepositStatusInput): Promise<ZcoinGetDepositStatusOutput>;
105
+ /**
106
+ * Generate a deposit deep link URL for Z-coin top-up.
107
+ * Returns a URL that redirects users to Core's deposit page.
108
+ * After completing the deposit, the user is redirected back to returnUrl.
109
+ *
110
+ * No authentication required — anyone can generate a deposit URL.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * const { url } = await goodz.zcoin.getDepositUrl({
115
+ * amount: 100,
116
+ * returnUrl: "https://myapp.com/shop",
117
+ * appId: "od_myapp",
118
+ * });
119
+ * window.open(url, "_blank");
120
+ * ```
121
+ */
122
+ getDepositUrl(input?: ZcoinGetDepositUrlInput): Promise<ZcoinGetDepositUrlOutput>;
105
123
  /**
106
124
  * Atomic commercial transfer: Z-coin payment + ownership transfer in one transaction.
107
125
  * This is the primary API for Commerce and Exchange purchase flows.
@@ -142,7 +160,7 @@ interface ZcoinNamespace {
142
160
  }
143
161
  interface InventoryNamespace {
144
162
  /** Get a user's inventory (owned card instances). */
145
- getUserInventory(input: InventoryGetUserInventoryInput): Promise<any[]>;
163
+ getUserInventory(input: InventoryGetUserInventoryInput): Promise<InventoryItem[]>;
146
164
  /** Check if a user owns at least one instance of a specific card. */
147
165
  confirmOwnership(input: InventoryConfirmOwnershipInput): Promise<InventoryConfirmOwnershipOutput>;
148
166
  /**
@@ -279,4 +297,4 @@ declare function createGoodZClient(config?: GoodZClientConfig): GoodZClient;
279
297
  */
280
298
  declare const createUserClient: typeof createGoodZClient;
281
299
 
282
- export { AliveNamespace, AuthGetOAuthAppInfoInput, type AuthNamespace, AuthOAuthAppInfo, AuthUser, CardGetInput, CardListBySeriesInput, CollectibleGetCardProfileInput, CollectibleGetInstanceByIdInput, CollectibleGetPublicInstanceInput, CollectibleGetPublicInstancesBatchInput, CollectibleGetShellImageUrlInput, type CollectibleNamespace, CommerceNamespace, ExchangeNamespace, FranchiseGetInput, type GoodZClient, type GoodZClientConfig, InventoryConfirmOwnershipInput, InventoryConfirmOwnershipOutput, InventoryGetUserInventoryInput, InventoryGrantMintAuthInput, InventoryMintInput, InventoryMintOutput, type InventoryNamespace, InventoryTransferByCardInput, InventoryTransferByCardOutput, InventoryTransferHistoryInput, InventoryTransferInput, InventoryTransferOutput, type IpNamespace, SeriesGetInput, SeriesListByFranchiseInput, UserGetPublicProfileByIdInput, UserGetPublicProfileInput, type UserNamespace, UserPublicProfile, ZcoinChargeUserInput, ZcoinChargeUserOutput, ZcoinCommercialTransferInput, ZcoinCommercialTransferOutput, ZcoinCreateDepositOrderInput, ZcoinCreateDepositOrderOutput, ZcoinCreateDirectPurchaseOrderInput, ZcoinCreateDirectPurchaseOrderOutput, ZcoinDepositPackage, ZcoinGetDepositPackagesInput, ZcoinGetDepositStatusInput, ZcoinGetDepositStatusOutput, ZcoinGetMyBalanceOutput, ZcoinGetMyHistoryInput, ZcoinMintAndChargeInput, ZcoinMintAndChargeOutput, type ZcoinNamespace, createGoodZClient, createUserClient };
300
+ export { AliveNamespace, AuthGetOAuthAppInfoInput, type AuthNamespace, AuthOAuthAppInfo, AuthUser, CardGetInput, CardListBySeriesInput, CollectibleGetCardProfileInput, CollectibleGetInstanceByIdInput, CollectibleGetPublicInstanceInput, CollectibleGetPublicInstancesBatchInput, CollectibleGetShellImageUrlInput, type CollectibleNamespace, CommerceNamespace, ExchangeNamespace, FranchiseGetInput, type GoodZClient, type GoodZClientConfig, InventoryConfirmOwnershipInput, InventoryConfirmOwnershipOutput, InventoryGetUserInventoryInput, InventoryGrantMintAuthInput, InventoryItem, InventoryMintInput, InventoryMintOutput, type InventoryNamespace, InventoryTransferByCardInput, InventoryTransferByCardOutput, InventoryTransferHistoryInput, InventoryTransferInput, InventoryTransferOutput, type IpNamespace, SeriesGetInput, SeriesListByFranchiseInput, UserGetPublicProfileByIdInput, UserGetPublicProfileInput, type UserNamespace, UserPublicProfile, ZcoinChargeUserInput, ZcoinChargeUserOutput, ZcoinCommercialTransferInput, ZcoinCommercialTransferOutput, ZcoinCreateDepositOrderInput, ZcoinCreateDepositOrderOutput, ZcoinCreateDirectPurchaseOrderInput, ZcoinCreateDirectPurchaseOrderOutput, ZcoinDepositPackage, ZcoinGetDepositPackagesInput, ZcoinGetDepositStatusInput, ZcoinGetDepositStatusOutput, ZcoinGetDepositUrlInput, ZcoinGetDepositUrlOutput, ZcoinGetMyBalanceOutput, ZcoinGetMyHistoryInput, ZcoinMintAndChargeInput, ZcoinMintAndChargeOutput, type ZcoinNamespace, createGoodZClient, createUserClient };
@@ -1,4 +1,4 @@
1
- export { createGoodZClient, createUserClient } from '../chunk-KLMCZG4N.js';
1
+ export { createGoodZClient, createUserClient } from '../chunk-EQUAL5M6.js';
2
2
  import '../chunk-V73MMKHI.js';
3
3
  import '../chunk-OUKZ2PRD.js';
4
4
  import '../chunk-JAVMQXJM.js';
@@ -1,4 +1,4 @@
1
- import { X as TransportConfig } from '../transport-BOlScYEv.js';
1
+ import { $ as TransportConfig } from '../transport-CzoXrUZs.js';
2
2
 
3
3
  /**
4
4
  * @goodz-core/sdk — Exchange API Type Definitions
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { AuthNamespace, CollectibleNamespace, GoodZClient, GoodZClientConfig, InventoryNamespace, IpNamespace, UserNamespace, ZcoinNamespace, createGoodZClient, createUserClient } from './core/index.js';
2
- export { A as AuthGetOAuthAppInfoInput, a as AuthOAuthAppInfo, b as AuthUser, C as CardGetInput, c as CardListBySeriesInput, d as CollectibleGetCardProfileInput, e as CollectibleGetInstanceByIdInput, f as CollectibleGetPublicInstanceInput, g as CollectibleGetPublicInstancesBatchInput, h as CollectibleGetShellImageUrlInput, F as FranchiseGetInput, G as GoodZApiError, i as GoodZApiFieldError, j as GoodZErrorV2, I as InventoryConfirmOwnershipInput, k as InventoryConfirmOwnershipOutput, l as InventoryGetUserInventoryInput, m as InventoryGrantMintAuthInput, n as InventoryMintInput, o as InventoryMintOutput, p as InventoryTransferByCardInput, q as InventoryTransferByCardOutput, r as InventoryTransferHistoryInput, s as InventoryTransferInput, t as InventoryTransferOutput, P as PurchaseChannel, S as SaleType, u as SeriesGetInput, v as SeriesListByFranchiseInput, T as TransferReason, U as UserGetPublicProfileByIdInput, w as UserGetPublicProfileInput, x as UserPublicProfile, Z as ZcoinChargeUserInput, y as ZcoinChargeUserOutput, z as ZcoinCommercialTransferInput, B as ZcoinCommercialTransferOutput, D as ZcoinCreateDepositOrderInput, E as ZcoinCreateDepositOrderOutput, H as ZcoinCreateDirectPurchaseOrderInput, J as ZcoinCreateDirectPurchaseOrderOutput, K as ZcoinDepositPackage, L as ZcoinGetDepositPackagesInput, M as ZcoinGetDepositStatusInput, N as ZcoinGetDepositStatusOutput, O as ZcoinGetMyBalanceOutput, Q as ZcoinGetMyHistoryInput, R as ZcoinMintAndChargeInput, V as ZcoinMintAndChargeOutput, W as ZcoinTxType } from './transport-BOlScYEv.js';
2
+ export { A as AuthGetOAuthAppInfoInput, a as AuthOAuthAppInfo, b as AuthUser, C as CardGetInput, c as CardListBySeriesInput, d as CollectibleGetCardProfileInput, e as CollectibleGetInstanceByIdInput, f as CollectibleGetPublicInstanceInput, g as CollectibleGetPublicInstancesBatchInput, h as CollectibleGetShellImageUrlInput, F as FranchiseGetInput, G as GoodZApiError, i as GoodZApiFieldError, j as GoodZErrorV2, I as InventoryConfirmOwnershipInput, k as InventoryConfirmOwnershipOutput, l as InventoryGetUserInventoryInput, m as InventoryGrantMintAuthInput, n as InventoryItem, o as InventoryMintInput, p as InventoryMintOutput, q as InventoryTransferByCardInput, r as InventoryTransferByCardOutput, s as InventoryTransferHistoryInput, t as InventoryTransferInput, u as InventoryTransferOutput, P as PurchaseChannel, S as SaleType, v as SeriesGetInput, w as SeriesListByFranchiseInput, T as TransferReason, U as UserGetPublicProfileByIdInput, x as UserGetPublicProfileInput, y as UserPublicProfile, Z as ZcoinChargeUserInput, z as ZcoinChargeUserOutput, B as ZcoinCommercialTransferInput, D as ZcoinCommercialTransferOutput, E as ZcoinCreateDepositOrderInput, H as ZcoinCreateDepositOrderOutput, J as ZcoinCreateDirectPurchaseOrderInput, K as ZcoinCreateDirectPurchaseOrderOutput, L as ZcoinDepositPackage, M as ZcoinGetDepositPackagesInput, N as ZcoinGetDepositStatusInput, O as ZcoinGetDepositStatusOutput, Q as ZcoinGetDepositUrlInput, R as ZcoinGetDepositUrlOutput, V as ZcoinGetMyBalanceOutput, W as ZcoinGetMyHistoryInput, X as ZcoinMintAndChargeInput, Y as ZcoinMintAndChargeOutput, _ as ZcoinTxType } from './transport-CzoXrUZs.js';
3
3
  export { AuthorizationMode, CampaignStatus, CommerceActivateCampaignInput, CommerceBatch, CommerceBatchTier, CommerceBrowseWholesaleInput, CommerceCampaign, CommerceCampaignItem, CommerceCreateBatchInput, CommerceCreateGachaPoolInput, CommerceCreateShopInput, CommerceDeleteWebhookInput, CommerceDrawResult, CommerceEndCampaignInput, CommerceExecutePurchaseInput, CommerceGachaItem, CommerceGachaPool, CommerceGetAuthUrlInput, CommerceGetCampaignInfoInput, CommerceGetCampaignItemsInput, CommerceGetMyOrdersInput, CommerceGetSettlementReportInput, CommerceGetShopDashboardInput, CommerceGetShopsByBlueprintInput, CommerceLaunchCampaignInput, CommerceListMyAppsInput, CommerceManageInventoryInput, CommerceMintToInventoryInput, CommerceNamespace, CommerceOrder, CommercePauseCampaignInput, CommercePityConfig, CommerceProcureBatchInput, CommercePublishToWholesaleInput, CommerceRedeemPhysicalInput, CommerceRegisterAppInput, CommerceRegisterInstancesInput, CommerceRegisterWebhookInput, CommerceSearchMarketplaceInput, CommerceShop, CommerceShopDashboard, CommerceTestWebhookInput, CommerceUpdateAppInput, CommerceUpdateCampaignInput, CommerceWebhook, CommerceWholesaleListing, IntegrationMode, SaleMode } from './commerce/index.js';
4
4
  export { CompensationDirection, ExchangeAddToWatchlistInput, ExchangeBid, ExchangeBrowseMarketplaceInput, ExchangeBuyListingInput, ExchangeBuyListingOutput, ExchangeCancelListingInput, ExchangeCancelWtbInput, ExchangeCreateListingInput, ExchangeCreateListingOutput, ExchangeCreateWtbInput, ExchangeFulfillWtbInput, ExchangeFulfillWtbOutput, ExchangeGetBidsInput, ExchangeGetListingDetailInput, ExchangeGetMarketDataInput, ExchangeListing, ExchangeMarketData, ExchangeNamespace, ExchangePlaceBidInput, ExchangePlaceBidOutput, ExchangePricePoint, ExchangeProposeTradeInput, ExchangeRemoveFromWatchlistInput, ExchangeRespondToTradeInput, ExchangeRespondToTradeOutput, ExchangeTradeItem, ExchangeTradeProposal, ExchangeWatchlistItem, ExchangeWtb, ListingCondition, ListingType } from './exchange/index.js';
5
5
  export { AliveBuildContextInput, AliveChatResponse, AliveClassifiedIntent, AliveClassifyIntentInput, AliveContext, AliveForgetMemoryInput, AliveGetIntimacyInput, AliveIntimacy, AliveMemory, AliveNamespace, AliveRecallMemoriesInput, AliveSendMessageInput, AliveStoreMemoryInput, AliveUpdateIntimacyInput, IntentCategory, MemoryType, MoodState } from './alive/index.js';
@@ -46,6 +46,6 @@ import 'react';
46
46
  * @module
47
47
  */
48
48
 
49
- declare const SDK_VERSION = "0.3.1";
49
+ declare const SDK_VERSION = "0.3.3";
50
50
 
51
51
  export { SDK_VERSION };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { createGoodZClient, createUserClient } from './chunk-KLMCZG4N.js';
1
+ export { createGoodZClient, createUserClient } from './chunk-EQUAL5M6.js';
2
2
  export { TokenManager, buildAuthorizationUrl, exchangeCode } from './chunk-EUKUN4JF.js';
3
3
  export { ZCOIN_PRECISION, formatZcoin, formatZcoinWithSymbol, toDisplay, toHundredths } from './chunk-2ZETOE2X.js';
4
4
  export { FORM_FACTORS, GoodZCardFocus, getAspectRatioCSS, getFormFactorSpec } from './chunk-K6IFJWLB.js';
@@ -8,7 +8,7 @@ import './chunk-JAVMQXJM.js';
8
8
  export { GoodZApiError } from './chunk-4SU7SU7K.js';
9
9
 
10
10
  // src/index.ts
11
- var SDK_VERSION = "0.3.1";
11
+ var SDK_VERSION = "0.3.3";
12
12
 
13
13
  export { SDK_VERSION };
14
14
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;AAqGO,IAAM,WAAA,GAAc","file":"index.js","sourcesContent":["/**\n * @goodz-core/sdk — Official SDK for the GoodZ Ecosystem\n *\n * One package, all services. Stripe-style unified client.\n *\n * ```ts\n * import { createGoodZClient } from \"@goodz-core/sdk\";\n *\n * const goodz = createGoodZClient({ accessToken: \"...\" });\n *\n * // Core\n * await goodz.zcoin.getMyBalance();\n * await goodz.inventory.mint({ ... });\n *\n * // Commerce\n * await goodz.commerce.createShop({ name: \"My Shop\" });\n * await goodz.commerce.executePurchase({ campaignId: 1, quantity: 1 });\n *\n * // Exchange\n * await goodz.exchange.createListing({ ... });\n * await goodz.exchange.getMarketData({ coreGoodzId: 42 });\n *\n * // Alive\n * await goodz.alive.sendMessage({ instanceId: 1, userId: 1, message: \"Hello!\" });\n * ```\n *\n * For tree-shaking, prefer importing from specific subpaths:\n *\n * ```ts\n * import { createGoodZClient } from \"@goodz-core/sdk/core\";\n * import { TokenManager } from \"@goodz-core/sdk/auth\";\n * import { GoodZCardFocus } from \"@goodz-core/sdk/ui\";\n * ```\n *\n * @module\n */\n\n// Core client (includes all namespace types)\nexport {\n createGoodZClient,\n createUserClient,\n GoodZApiError,\n type GoodZClient,\n type GoodZClientConfig,\n // Core namespaces\n type ZcoinNamespace,\n type InventoryNamespace,\n type CollectibleNamespace,\n type UserNamespace,\n type AuthNamespace,\n type IpNamespace,\n // Sub-site namespaces\n type CommerceNamespace,\n type ExchangeNamespace,\n type AliveNamespace,\n} from \"./core/index\";\n\n// All API types — Core\nexport type * from \"./types\";\n\n// All API types — Commerce\nexport type * from \"./types-commerce\";\n\n// All API types — Exchange\nexport type * from \"./types-exchange\";\n\n// All API types — Alive\nexport type * from \"./types-alive\";\n\n// Auth helpers\nexport {\n TokenManager,\n buildAuthorizationUrl,\n exchangeCode,\n type TokenManagerConfig,\n type TokenPair,\n type OAuthUrlConfig,\n} from \"./auth/index\";\n\n// Z-coin utilities\nexport {\n ZCOIN_PRECISION,\n toHundredths,\n toDisplay,\n formatZcoin,\n formatZcoinWithSymbol,\n} from \"./zcoin-utils\";\n\n// UI components (React 18+)\n// Note: Import from \"@goodz-core/sdk/ui\" for tree-shaking\nexport {\n GoodZCardFocus,\n type GoodZCardFocusProps,\n type FormFactorKey,\n type FormFactorSpec,\n FORM_FACTORS,\n getFormFactorSpec,\n getAspectRatioCSS,\n} from \"./ui/index\";\n\n// SDK version\nexport const SDK_VERSION = \"0.3.1\";\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;AAqGO,IAAM,WAAA,GAAc","file":"index.js","sourcesContent":["/**\n * @goodz-core/sdk — Official SDK for the GoodZ Ecosystem\n *\n * One package, all services. Stripe-style unified client.\n *\n * ```ts\n * import { createGoodZClient } from \"@goodz-core/sdk\";\n *\n * const goodz = createGoodZClient({ accessToken: \"...\" });\n *\n * // Core\n * await goodz.zcoin.getMyBalance();\n * await goodz.inventory.mint({ ... });\n *\n * // Commerce\n * await goodz.commerce.createShop({ name: \"My Shop\" });\n * await goodz.commerce.executePurchase({ campaignId: 1, quantity: 1 });\n *\n * // Exchange\n * await goodz.exchange.createListing({ ... });\n * await goodz.exchange.getMarketData({ coreGoodzId: 42 });\n *\n * // Alive\n * await goodz.alive.sendMessage({ instanceId: 1, userId: 1, message: \"Hello!\" });\n * ```\n *\n * For tree-shaking, prefer importing from specific subpaths:\n *\n * ```ts\n * import { createGoodZClient } from \"@goodz-core/sdk/core\";\n * import { TokenManager } from \"@goodz-core/sdk/auth\";\n * import { GoodZCardFocus } from \"@goodz-core/sdk/ui\";\n * ```\n *\n * @module\n */\n\n// Core client (includes all namespace types)\nexport {\n createGoodZClient,\n createUserClient,\n GoodZApiError,\n type GoodZClient,\n type GoodZClientConfig,\n // Core namespaces\n type ZcoinNamespace,\n type InventoryNamespace,\n type CollectibleNamespace,\n type UserNamespace,\n type AuthNamespace,\n type IpNamespace,\n // Sub-site namespaces\n type CommerceNamespace,\n type ExchangeNamespace,\n type AliveNamespace,\n} from \"./core/index\";\n\n// All API types — Core\nexport type * from \"./types\";\n\n// All API types — Commerce\nexport type * from \"./types-commerce\";\n\n// All API types — Exchange\nexport type * from \"./types-exchange\";\n\n// All API types — Alive\nexport type * from \"./types-alive\";\n\n// Auth helpers\nexport {\n TokenManager,\n buildAuthorizationUrl,\n exchangeCode,\n type TokenManagerConfig,\n type TokenPair,\n type OAuthUrlConfig,\n} from \"./auth/index\";\n\n// Z-coin utilities\nexport {\n ZCOIN_PRECISION,\n toHundredths,\n toDisplay,\n formatZcoin,\n formatZcoinWithSymbol,\n} from \"./zcoin-utils\";\n\n// UI components (React 18+)\n// Note: Import from \"@goodz-core/sdk/ui\" for tree-shaking\nexport {\n GoodZCardFocus,\n type GoodZCardFocusProps,\n type FormFactorKey,\n type FormFactorSpec,\n FORM_FACTORS,\n getFormFactorSpec,\n getAspectRatioCSS,\n} from \"./ui/index\";\n\n// SDK version\nexport const SDK_VERSION = \"0.3.3\";\n"]}
@@ -151,6 +151,30 @@ interface ZcoinDepositPackage {
151
151
  channel: PurchaseChannel;
152
152
  featured: boolean;
153
153
  }
154
+ interface ZcoinGetDepositUrlInput {
155
+ /** Suggested Z-coin amount (display units). Optional — user can change on deposit page. */
156
+ amount?: number;
157
+ /** URL to redirect back to after deposit completes. Will have ?deposit=success appended. */
158
+ returnUrl?: string;
159
+ /** Your OAuth app's client_id. Required if returnUrl is provided, for origin validation. */
160
+ appId?: string;
161
+ /** Purchase channel (affects pricing for mobile platform fees). Default: "web" */
162
+ channel?: PurchaseChannel;
163
+ }
164
+ interface ZcoinGetDepositUrlOutput {
165
+ /** The deposit deep link URL. Open this in a new tab or redirect the user. */
166
+ url: string;
167
+ /** The base URL of GoodZ Core */
168
+ baseUrl: string;
169
+ /** The suggested amount (null if not provided) */
170
+ amount: number | null;
171
+ /** The purchase channel */
172
+ channel: PurchaseChannel;
173
+ /** The return URL (null if not provided) */
174
+ returnUrl: string | null;
175
+ /** The app ID (null if not provided) */
176
+ appId: string | null;
177
+ }
154
178
  interface ZcoinCreateDepositOrderInput {
155
179
  /** Z-coin amount to purchase (display units, e.g. 100 or 100.50) */
156
180
  amount: number;
@@ -185,6 +209,37 @@ interface InventoryGetUserInventoryInput {
185
209
  limit?: number;
186
210
  offset?: number;
187
211
  }
212
+ /** A single item in the getUserInventory / mine response */
213
+ interface InventoryItem {
214
+ instanceId: number;
215
+ instanceCode: string;
216
+ shortCode: string;
217
+ instanceNumber: number;
218
+ currentOwnerId: number;
219
+ mintedVia: string;
220
+ mintedAt: number;
221
+ isRedeemed: boolean | null;
222
+ collectibleImageUrl: string | null;
223
+ shellImageUrl: string | null;
224
+ backgroundTemplate: string | null;
225
+ version: number;
226
+ cardId: number;
227
+ cardName: string;
228
+ cardImageUrl: string | null;
229
+ cardFormFactor: string | null;
230
+ /** Rarity label set by the creator (e.g. "SSR", "Rare", "Common") */
231
+ rarity: string | null;
232
+ /** Listing/display image URL — may differ from cardImageUrl */
233
+ listingImageUrl: string | null;
234
+ seriesId: number;
235
+ seriesName: string;
236
+ /** URL to the card blueprint page */
237
+ blueprintUrl: string;
238
+ /** URL to the instance profile page */
239
+ profileUrl: string;
240
+ /** Short public URL (if shortCode exists) */
241
+ publicUrl: string | null;
242
+ }
188
243
  interface InventoryConfirmOwnershipInput {
189
244
  userId: number;
190
245
  cardId: number;
@@ -374,4 +429,4 @@ interface TransportConfig {
374
429
  getHeaders: () => Record<string, string> | Promise<Record<string, string>>;
375
430
  }
376
431
 
377
- export { type AuthGetOAuthAppInfoInput as A, type ZcoinCommercialTransferOutput as B, type CardGetInput as C, type ZcoinCreateDepositOrderInput as D, type ZcoinCreateDepositOrderOutput as E, type FranchiseGetInput as F, GoodZApiError as G, type ZcoinCreateDirectPurchaseOrderInput as H, type InventoryConfirmOwnershipInput as I, type ZcoinCreateDirectPurchaseOrderOutput as J, type ZcoinDepositPackage as K, type ZcoinGetDepositPackagesInput as L, type ZcoinGetDepositStatusInput as M, type ZcoinGetDepositStatusOutput as N, type ZcoinGetMyBalanceOutput as O, type PurchaseChannel as P, type ZcoinGetMyHistoryInput as Q, type ZcoinMintAndChargeInput as R, type SaleType as S, type TransferReason as T, type UserGetPublicProfileByIdInput as U, type ZcoinMintAndChargeOutput as V, type ZcoinTxType as W, type TransportConfig as X, type ZcoinChargeUserInput as Z, type AuthOAuthAppInfo as a, type AuthUser as b, type CardListBySeriesInput as c, type CollectibleGetCardProfileInput as d, type CollectibleGetInstanceByIdInput as e, type CollectibleGetPublicInstanceInput as f, type CollectibleGetPublicInstancesBatchInput as g, type CollectibleGetShellImageUrlInput as h, type GoodZApiFieldError as i, type GoodZErrorV2 as j, type InventoryConfirmOwnershipOutput as k, type InventoryGetUserInventoryInput as l, type InventoryGrantMintAuthInput as m, type InventoryMintInput as n, type InventoryMintOutput as o, type InventoryTransferByCardInput as p, type InventoryTransferByCardOutput as q, type InventoryTransferHistoryInput as r, type InventoryTransferInput as s, type InventoryTransferOutput as t, type SeriesGetInput as u, type SeriesListByFranchiseInput as v, type UserGetPublicProfileInput as w, type UserPublicProfile as x, type ZcoinChargeUserOutput as y, type ZcoinCommercialTransferInput as z };
432
+ export { type TransportConfig as $, type AuthGetOAuthAppInfoInput as A, type ZcoinCommercialTransferInput as B, type CardGetInput as C, type ZcoinCommercialTransferOutput as D, type ZcoinCreateDepositOrderInput as E, type FranchiseGetInput as F, GoodZApiError as G, type ZcoinCreateDepositOrderOutput as H, type InventoryConfirmOwnershipInput as I, type ZcoinCreateDirectPurchaseOrderInput as J, type ZcoinCreateDirectPurchaseOrderOutput as K, type ZcoinDepositPackage as L, type ZcoinGetDepositPackagesInput as M, type ZcoinGetDepositStatusInput as N, type ZcoinGetDepositStatusOutput as O, type PurchaseChannel as P, type ZcoinGetDepositUrlInput as Q, type ZcoinGetDepositUrlOutput as R, type SaleType as S, type TransferReason as T, type UserGetPublicProfileByIdInput as U, type ZcoinGetMyBalanceOutput as V, type ZcoinGetMyHistoryInput as W, type ZcoinMintAndChargeInput as X, type ZcoinMintAndChargeOutput as Y, type ZcoinChargeUserInput as Z, type ZcoinTxType as _, type AuthOAuthAppInfo as a, type AuthUser as b, type CardListBySeriesInput as c, type CollectibleGetCardProfileInput as d, type CollectibleGetInstanceByIdInput as e, type CollectibleGetPublicInstanceInput as f, type CollectibleGetPublicInstancesBatchInput as g, type CollectibleGetShellImageUrlInput as h, type GoodZApiFieldError as i, type GoodZErrorV2 as j, type InventoryConfirmOwnershipOutput as k, type InventoryGetUserInventoryInput as l, type InventoryGrantMintAuthInput as m, type InventoryItem as n, type InventoryMintInput as o, type InventoryMintOutput as p, type InventoryTransferByCardInput as q, type InventoryTransferByCardOutput as r, type InventoryTransferHistoryInput as s, type InventoryTransferInput as t, type InventoryTransferOutput as u, type SeriesGetInput as v, type SeriesListByFranchiseInput as w, type UserGetPublicProfileInput as x, type UserPublicProfile as y, type ZcoinChargeUserOutput as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodz-core/sdk",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Official SDK for the GoodZ Ecosystem — unified API client for Core, Commerce, Exchange, and Alive. Includes OAuth helpers, Z-coin utilities, and React UI components.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":";;;;;;AAuHA,IAAM,gBAAA,GAAmB,+BAAA;AACzB,IAAM,oBAAA,GAAuB,mCAAA;AAC7B,IAAM,oBAAA,GAAuB,mCAAA;AAC7B,IAAM,iBAAA,GAAoB,gCAAA;AAiRnB,SAAS,iBAAA,CAAkB,MAAA,GAA4B,EAAC,EAAgB;AAC7E,EAAA,MAAM;AAAA,IACJ,OAAA,GAAU,gBAAA;AAAA,IACV,WAAA,GAAc,oBAAA;AAAA,IACd,WAAA,GAAc,oBAAA;AAAA,IACd,QAAA,GAAW,iBAAA;AAAA,IACX,WAAA;AAAA,IACA,cAAA;AAAA,IACA,OAAA,EAAS;AAAA,GACX,GAAI,MAAA;AAGJ,EAAA,MAAM,eAAe,YAA6C;AAChE,IAAA,MAAM,CAAA,GAA4B,EAAE,GAAG,aAAA,EAAc;AACrD,IAAA,MAAM,KAAA,GAAQ,cAAA,GAAiB,MAAM,cAAA,EAAe,GAAI,WAAA;AACxD,IAAA,IAAI,KAAA,EAAO;AACT,MAAA,CAAA,CAAE,eAAe,CAAA,GAAI,CAAA,OAAA,EAAU,KAAK,CAAA,CAAA;AAAA,IACtC;AACA,IAAA,OAAO,CAAA;AAAA,EACT,CAAA;AAGA,EAAA,MAAM,aAAA,GAAiC;AAAA,IACrC,OAAA,EAAS,OAAA,CAAQ,OAAA,CAAQ,KAAA,EAAO,EAAE,CAAA;AAAA,IAClC,UAAA,EAAY;AAAA,GACd;AAGA,EAAA,MAAM,iBAAA,GAAoB,wBAAA,CAAyB,WAAA,EAAa,YAAY,CAAA;AAC5E,EAAA,MAAM,iBAAA,GAAoB,wBAAA,CAAyB,WAAA,EAAa,YAAY,CAAA;AAC5E,EAAA,MAAM,cAAA,GAAiB,wBAAA,CAAyB,QAAA,EAAU,YAAY,CAAA;AAGtE,EAAA,MAAM,CAAA,GAAI,CAAO,IAAA,KAAiB,CAAC,UAAc,SAAA,CAAgB,aAAA,EAAe,MAAM,KAAK,CAAA;AAC3F,EAAA,MAAM,CAAA,GAAI,CAAO,IAAA,KAAiB,CAAC,UAAc,YAAA,CAAmB,aAAA,EAAe,MAAM,KAAK,CAAA;AAE9F,EAAA,OAAO;AAAA;AAAA,IAEL,KAAA,EAAO;AAAA,MACL,YAAA,EAAc,EAAiC,oBAAoB,CAAA;AAAA,MACnE,YAAA,EAAc,EAAiC,oBAAoB,CAAA;AAAA,MACnE,kBAAA,EAAoB,EAAuD,0BAA0B,CAAA;AAAA,MACrG,kBAAA,EAAoB,EAA+D,0BAA0B,CAAA;AAAA,MAC7G,gBAAA,EAAkB,EAA2D,wBAAwB,CAAA;AAAA,MACrG,kBAAA,EAAoB,EAA+D,0BAA0B,CAAA;AAAA,MAC7G,aAAA,EAAe,EAAqD,qBAAqB,CAAA;AAAA,MACzF,UAAA,EAAY,EAA+C,kBAAkB,CAAA;AAAA,MAC7E,yBAAA,EAA2B,EAA6E,iCAAiC;AAAA,KAC3I;AAAA;AAAA,IAGA,SAAA,EAAW;AAAA,MACT,gBAAA,EAAkB,EAAyC,4BAA4B,CAAA;AAAA,MACvF,gBAAA,EAAkB,EAAmE,4BAA4B,CAAA;AAAA,MACjH,IAAA,EAAM,EAA2C,gBAAgB,CAAA;AAAA,MACjE,QAAA,EAAU,EAAmD,oBAAoB,CAAA;AAAA,MACjF,cAAA,EAAgB,EAA+D,0BAA0B,CAAA;AAAA,MACzG,aAAA,EAAe,EAAoC,yBAAyB,CAAA;AAAA,MAC5E,eAAA,EAAiB,EAAwC,2BAA2B;AAAA,KACtF;AAAA;AAAA,IAGA,WAAA,EAAa;AAAA,MACX,eAAA,EAAiB,EAAwC,6BAA6B,CAAA;AAAA,MACtF,iBAAA,EAAmB,EAA0C,+BAA+B,CAAA;AAAA,MAC5F,uBAAA,EAAyB,EAAkD,qCAAqC,CAAA;AAAA,MAChH,cAAA,EAAgB,EAAuC,4BAA4B,CAAA;AAAA,MACnF,gBAAA,EAAkB,EAAyC,8BAA8B;AAAA,KAC3F;AAAA;AAAA,IAGA,IAAA,EAAM;AAAA,MACJ,gBAAA,EAAkB,EAAgD,uBAAuB,CAAA;AAAA,MACzF,oBAAA,EAAsB,EAAoD,2BAA2B;AAAA,KACvG;AAAA;AAAA,IAGA,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,EAAyB,SAAS,CAAA;AAAA,MACtC,eAAA,EAAiB,EAAqD,sBAAsB;AAAA,KAC9F;AAAA;AAAA,IAGA,EAAA,EAAI;AAAA,MACF,YAAA,EAAc,EAA0B,eAAe,CAAA;AAAA,MACvD,SAAA,EAAW,EAAuB,YAAY,CAAA;AAAA,MAC9C,qBAAA,EAAuB,EAAqC,wBAAwB,CAAA;AAAA,MACpF,OAAA,EAAS,EAAqB,UAAU,CAAA;AAAA,MACxC,iBAAA,EAAmB,EAAgC,mBAAmB;AAAA,KACxE;AAAA;AAAA,IAGA,QAAA,EAAU,wBAAwB,iBAAiB,CAAA;AAAA;AAAA,IAGnD,QAAA,EAAU,wBAAwB,iBAAiB,CAAA;AAAA;AAAA,IAGnD,KAAA,EAAO,qBAAqB,cAAc,CAAA;AAAA;AAAA,IAG1C,UAAU,CAAU,IAAA,EAAc,UAAgB,SAAA,CAAkB,aAAA,EAAe,MAAM,KAAK,CAAA;AAAA,IAC9F,aAAa,CAAU,IAAA,EAAc,UAAgB,YAAA,CAAqB,aAAA,EAAe,MAAM,KAAK;AAAA,GACtG;AACF;AAMO,IAAM,gBAAA,GAAmB","file":"chunk-KLMCZG4N.js","sourcesContent":["/**\n * @goodz-core/sdk/core — Unified GoodZ API Client\n *\n * One client, all services. Stripe-style namespace architecture:\n * goodz.zcoin.* → Core settlement & Z-coin\n * goodz.inventory.* → Core instance management\n * goodz.collectible.* → Core card queries\n * goodz.user.* → Core user profiles\n * goodz.auth.* → Core auth\n * goodz.ip.* → Core IP (franchise/series/card)\n * goodz.commerce.* → Commerce/Shops (MCP)\n * goodz.exchange.* → Exchange marketplace (MCP)\n * goodz.alive.* → Alive companions (MCP)\n *\n * Core uses tRPC HTTP wire protocol; sub-sites use MCP JSON-RPC 2.0.\n * The client handles routing transparently.\n *\n * @example\n * ```ts\n * import { createGoodZClient } from \"@goodz-core/sdk\";\n *\n * const goodz = createGoodZClient({\n * accessToken: \"your-jwt-token\",\n * });\n *\n * // Core APIs\n * const balance = await goodz.zcoin.getMyBalance();\n * const result = await goodz.zcoin.commercialTransfer({ ... });\n *\n * // Commerce APIs\n * const shop = await goodz.commerce.createShop({ name: \"My Shop\" });\n * const order = await goodz.commerce.executePurchase({ campaignId: 1, quantity: 1 });\n *\n * // Exchange APIs\n * const listing = await goodz.exchange.createListing({ ... });\n * const data = await goodz.exchange.getMarketData({ coreGoodzId: 42 });\n *\n * // Alive APIs\n * const chat = await goodz.alive.sendMessage({ instanceId: 1, userId: 1, message: \"Hello!\" });\n * const memories = await goodz.alive.recallMemories({ instanceId: 1, userId: 1, query: \"birthday\" });\n * ```\n *\n * @module\n */\n\nimport { callQuery, callMutation, GoodZApiError } from \"../transport\";\nimport type { TransportConfig } from \"../transport\";\nimport { createMcpTransportConfig } from \"../mcp-transport\";\nimport { createCommerceNamespace } from \"../commerce/index\";\nimport type { CommerceNamespace } from \"../commerce/index\";\nimport { createExchangeNamespace } from \"../exchange/index\";\nimport type { ExchangeNamespace } from \"../exchange/index\";\nimport { createAliveNamespace } from \"../alive/index\";\nimport type { AliveNamespace } from \"../alive/index\";\nimport type {\n // zcoin\n ZcoinGetMyBalanceOutput,\n ZcoinGetMyHistoryInput,\n ZcoinCommercialTransferInput,\n ZcoinCommercialTransferOutput,\n ZcoinMintAndChargeInput,\n ZcoinMintAndChargeOutput,\n ZcoinChargeUserInput,\n ZcoinChargeUserOutput,\n ZcoinCreateDirectPurchaseOrderInput,\n ZcoinCreateDirectPurchaseOrderOutput,\n ZcoinGetDepositPackagesInput,\n ZcoinDepositPackage,\n ZcoinCreateDepositOrderInput,\n ZcoinCreateDepositOrderOutput,\n ZcoinGetDepositStatusInput,\n ZcoinGetDepositStatusOutput,\n // inventory\n InventoryGetUserInventoryInput,\n InventoryConfirmOwnershipInput,\n InventoryConfirmOwnershipOutput,\n InventoryMintInput,\n InventoryMintOutput,\n InventoryTransferInput,\n InventoryTransferOutput,\n InventoryTransferByCardInput,\n InventoryTransferByCardOutput,\n InventoryGrantMintAuthInput,\n InventoryTransferHistoryInput,\n // collectible\n CollectibleGetInstanceByIdInput,\n CollectibleGetPublicInstanceInput,\n CollectibleGetPublicInstancesBatchInput,\n CollectibleGetCardProfileInput,\n CollectibleGetShellImageUrlInput,\n // user\n UserGetPublicProfileInput,\n UserPublicProfile,\n UserGetPublicProfileByIdInput,\n // auth\n AuthGetOAuthAppInfoInput,\n AuthOAuthAppInfo,\n AuthUser,\n // ip\n FranchiseGetInput,\n SeriesGetInput,\n SeriesListByFranchiseInput,\n CardGetInput,\n CardListBySeriesInput,\n} from \"../types\";\n\n// ─── Re-export types and error class ─────────────────────────\n\nexport { GoodZApiError } from \"../transport\";\nexport type * from \"../types\";\nexport type * from \"../types-commerce\";\nexport type * from \"../types-exchange\";\nexport type * from \"../types-alive\";\nexport type { CommerceNamespace } from \"../commerce/index\";\nexport type { ExchangeNamespace } from \"../exchange/index\";\nexport type { AliveNamespace } from \"../alive/index\";\n\n// ─── Default sub-site URLs ──────────────────────────────────\n\nconst DEFAULT_CORE_URL = \"https://goodzcore.manus.space\";\nconst DEFAULT_COMMERCE_URL = \"https://goodzcommerce.manus.space\";\nconst DEFAULT_EXCHANGE_URL = \"https://goodzexchange.manus.space\";\nconst DEFAULT_ALIVE_URL = \"https://goodzalive.manus.space\";\n\n// ─── Client config ───────────────────────────────────────────\n\nexport interface GoodZClientConfig {\n /**\n * GoodZ.Core base URL.\n * @default \"https://goodzcore.manus.space\"\n */\n coreUrl?: string;\n\n /**\n * GoodZ.Commerce (Shops) base URL.\n * @default \"https://goodzcommerce.manus.space\"\n */\n commerceUrl?: string;\n\n /**\n * GoodZ.Exchange base URL.\n * @default \"https://goodzexchange.manus.space\"\n */\n exchangeUrl?: string;\n\n /**\n * GoodZ.Alive base URL.\n * @default \"https://goodzalive.manus.space\"\n */\n aliveUrl?: string;\n\n /**\n * Static access token (JWT) for authentication.\n * For server-to-server calls, obtain this via OAuth client_credentials flow.\n * For user-context calls, pass the user's access token.\n */\n accessToken?: string;\n\n /**\n * Dynamic token provider — called before every request.\n * Use this when tokens may rotate (e.g., auto-refresh).\n * Takes precedence over `accessToken` if both are set.\n */\n getAccessToken?: () => string | Promise<string>;\n\n /**\n * Custom headers to include in every request.\n * Useful for passing app identifiers or tracing headers.\n */\n headers?: Record<string, string>;\n}\n\n// ─── Core namespace interfaces (tRPC) ───────────────────────\n\nexport interface ZcoinNamespace {\n /** Get the authenticated user's Z-coin balance. */\n getMyBalance(): Promise<ZcoinGetMyBalanceOutput>;\n\n /** Get the authenticated user's Z-coin transaction history. */\n getMyHistory(input?: ZcoinGetMyHistoryInput): Promise<any[]>;\n\n /** Get available Z-coin deposit packages with pricing. */\n getDepositPackages(input?: ZcoinGetDepositPackagesInput): Promise<ZcoinDepositPackage[]>;\n\n /** Create a Stripe checkout session for Z-coin deposit. */\n createDepositOrder(input: ZcoinCreateDepositOrderInput): Promise<ZcoinCreateDepositOrderOutput>;\n\n /** Check the status of a deposit checkout session. */\n getDepositStatus(input: ZcoinGetDepositStatusInput): Promise<ZcoinGetDepositStatusOutput>;\n\n /**\n * Atomic commercial transfer: Z-coin payment + ownership transfer in one transaction.\n * This is the primary API for Commerce and Exchange purchase flows.\n *\n * Idempotent via referenceId — duplicate calls return the same result.\n *\n * @throws {GoodZApiError} BAD_REQUEST — insufficient balance\n * @throws {GoodZApiError} CONFLICT — version conflict (retry)\n * @throws {GoodZApiError} FORBIDDEN — seller doesn't own instance\n */\n commercialTransfer(input: ZcoinCommercialTransferInput): Promise<ZcoinCommercialTransferOutput>;\n\n /**\n * Mint a new card instance and charge the buyer in one atomic transaction.\n * Used by Commerce for gacha and direct-from-creator purchases.\n *\n * Requires mint authorization (granted via inventory.grantMintAuth).\n * Idempotent via referenceId.\n *\n * @throws {GoodZApiError} FORBIDDEN — no mint authorization\n * @throws {GoodZApiError} BAD_REQUEST — insufficient balance\n */\n mintAndCharge(input: ZcoinMintAndChargeInput): Promise<ZcoinMintAndChargeOutput>;\n\n /**\n * Charge a user's Z-coin balance for an in-app purchase.\n * Used by apps that sell non-GoodZ digital goods/services.\n *\n * Idempotent via appOrderId.\n *\n * @throws {GoodZApiError} BAD_REQUEST — insufficient balance\n * @throws {GoodZApiError} CONFLICT — version conflict\n */\n chargeUser(input: ZcoinChargeUserInput): Promise<ZcoinChargeUserOutput>;\n\n /**\n * Create a direct purchase checkout session (fiat → Z-coin → transfer).\n * Transparent intermediation: user sees fiat price, Core handles conversion.\n */\n createDirectPurchaseOrder(input: ZcoinCreateDirectPurchaseOrderInput): Promise<ZcoinCreateDirectPurchaseOrderOutput>;\n}\n\nexport interface InventoryNamespace {\n /** Get a user's inventory (owned card instances). */\n getUserInventory(input: InventoryGetUserInventoryInput): Promise<any[]>;\n\n /** Check if a user owns at least one instance of a specific card. */\n confirmOwnership(input: InventoryConfirmOwnershipInput): Promise<InventoryConfirmOwnershipOutput>;\n\n /**\n * Mint new card instances. Requires franchise ownership or admin role.\n * For Commerce/Exchange, use zcoin.mintAndCharge instead (includes payment).\n */\n mint(input: InventoryMintInput): Promise<InventoryMintOutput>;\n\n /**\n * Transfer a specific card instance to another user.\n * For commercial transfers, use zcoin.commercialTransfer instead.\n *\n * @deprecated for reason=\"purchase\"|\"trade\" — use commercialTransfer\n */\n transfer(input: InventoryTransferInput): Promise<InventoryTransferOutput>;\n\n /**\n * Transfer card instances by cardId (transfers oldest instances).\n * For commercial transfers, use zcoin.commercialTransfer instead.\n *\n * @deprecated for reason=\"purchase\"|\"trade\" — use commercialTransfer\n */\n transferByCard(input: InventoryTransferByCardInput): Promise<InventoryTransferByCardOutput>;\n\n /**\n * Grant mint authorization to another user/app for a specific card.\n * Required before Commerce can call zcoin.mintAndCharge for that card.\n */\n grantMintAuth(input: InventoryGrantMintAuthInput): Promise<any>;\n\n /** Get transfer/ownership history for an instance, card, or user. */\n transferHistory(input: InventoryTransferHistoryInput): Promise<any[]>;\n}\n\nexport interface CollectibleNamespace {\n /** Get a card instance by its numeric ID. Returns full instance data with card chain. */\n getInstanceById(input: CollectibleGetInstanceByIdInput): Promise<any>;\n\n /** Get a card instance by its instance code (public-facing identifier). */\n getPublicInstance(input: CollectibleGetPublicInstanceInput): Promise<any>;\n\n /** Batch-fetch multiple card instances by their IDs (max 100). */\n getPublicInstancesBatch(input: CollectibleGetPublicInstancesBatchInput): Promise<any[]>;\n\n /** Get the card profile (metadata, rarity, series info). */\n getCardProfile(input: CollectibleGetCardProfileInput): Promise<any>;\n\n /** Get the shell (packaging) image URL for a card. */\n getShellImageUrl(input: CollectibleGetShellImageUrlInput): Promise<any>;\n}\n\nexport interface UserNamespace {\n /** Get a user's public profile by openId. */\n getPublicProfile(input: UserGetPublicProfileInput): Promise<UserPublicProfile>;\n\n /** Get a user's public profile by internal userId. */\n getPublicProfileById(input: UserGetPublicProfileByIdInput): Promise<UserPublicProfile>;\n}\n\nexport interface AuthNamespace {\n /** Get the authenticated user's profile. Returns null if not authenticated. */\n me(): Promise<AuthUser | null>;\n\n /** Get public info about an OAuth app by its client ID. */\n getOAuthAppInfo(input: AuthGetOAuthAppInfoInput): Promise<AuthOAuthAppInfo | null>;\n}\n\nexport interface IpNamespace {\n /** Get a franchise by ID or slug. */\n getFranchise(input: FranchiseGetInput): Promise<any>;\n\n /** Get a series by ID or slug. */\n getSeries(input: SeriesGetInput): Promise<any>;\n\n /** List all series in a franchise. */\n listSeriesByFranchise(input: SeriesListByFranchiseInput): Promise<any[]>;\n\n /** Get a card by ID. */\n getCard(input: CardGetInput): Promise<any>;\n\n /** List all cards in a series. */\n listCardsBySeries(input: CardListBySeriesInput): Promise<any[]>;\n}\n\n// ─── GoodZClient type ────────────────────────────────────────\n\nexport interface GoodZClient {\n // ── Core namespaces (tRPC) ──\n readonly zcoin: ZcoinNamespace;\n readonly inventory: InventoryNamespace;\n readonly collectible: CollectibleNamespace;\n readonly user: UserNamespace;\n readonly auth: AuthNamespace;\n readonly ip: IpNamespace;\n\n // ── Sub-site namespaces (MCP) ──\n readonly commerce: CommerceNamespace;\n readonly exchange: ExchangeNamespace;\n readonly alive: AliveNamespace;\n\n /**\n * Make a raw tRPC query call to Core. Use this for routes not yet covered\n * by the typed namespaces.\n */\n rawQuery<T = any>(path: string, input?: any): Promise<T>;\n\n /**\n * Make a raw tRPC mutation call to Core. Use this for routes not yet covered\n * by the typed namespaces.\n */\n rawMutation<T = any>(path: string, input?: any): Promise<T>;\n}\n\n// ─── Client factory ──────────────────────────────────────────\n\n/**\n * Create a unified GoodZ API client — one client for all services.\n *\n * @example Server-to-server with static token\n * ```ts\n * const goodz = createGoodZClient({\n * accessToken: process.env.CORE_ACCESS_TOKEN,\n * });\n *\n * // Core\n * const balance = await goodz.zcoin.getMyBalance();\n *\n * // Commerce\n * const shop = await goodz.commerce.createShop({ name: \"My Shop\" });\n *\n * // Exchange\n * const listings = await goodz.exchange.browseMarketplace();\n *\n * // Alive\n * const chat = await goodz.alive.sendMessage({ instanceId: 1, userId: 1, message: \"Hi!\" });\n * ```\n *\n * @example With dynamic token provider (auto-refresh)\n * ```ts\n * const goodz = createGoodZClient({\n * getAccessToken: async () => {\n * const token = await refreshTokenIfNeeded();\n * return token;\n * },\n * });\n * ```\n *\n * @example Custom sub-site URLs (e.g., staging environment)\n * ```ts\n * const goodz = createGoodZClient({\n * accessToken: \"...\",\n * coreUrl: \"https://staging-core.goodz.dev\",\n * commerceUrl: \"https://staging-commerce.goodz.dev\",\n * exchangeUrl: \"https://staging-exchange.goodz.dev\",\n * aliveUrl: \"https://staging-alive.goodz.dev\",\n * });\n * ```\n */\nexport function createGoodZClient(config: GoodZClientConfig = {}): GoodZClient {\n const {\n coreUrl = DEFAULT_CORE_URL,\n commerceUrl = DEFAULT_COMMERCE_URL,\n exchangeUrl = DEFAULT_EXCHANGE_URL,\n aliveUrl = DEFAULT_ALIVE_URL,\n accessToken,\n getAccessToken,\n headers: customHeaders,\n } = config;\n\n // Shared header builder — used by both tRPC and MCP transports\n const buildHeaders = async (): Promise<Record<string, string>> => {\n const h: Record<string, string> = { ...customHeaders };\n const token = getAccessToken ? await getAccessToken() : accessToken;\n if (token) {\n h[\"Authorization\"] = `Bearer ${token}`;\n }\n return h;\n };\n\n // ── Core transport (tRPC) ──\n const coreTransport: TransportConfig = {\n baseUrl: coreUrl.replace(/\\/$/, \"\"),\n getHeaders: buildHeaders,\n };\n\n // ── Sub-site transports (MCP) ──\n const commerceTransport = createMcpTransportConfig(commerceUrl, buildHeaders);\n const exchangeTransport = createMcpTransportConfig(exchangeUrl, buildHeaders);\n const aliveTransport = createMcpTransportConfig(aliveUrl, buildHeaders);\n\n // Helper shortcuts for Core tRPC\n const q = <I, O>(path: string) => (input?: I) => callQuery<I, O>(coreTransport, path, input);\n const m = <I, O>(path: string) => (input?: I) => callMutation<I, O>(coreTransport, path, input);\n\n return {\n // ── zcoin ──────────────────────────────────────────────\n zcoin: {\n getMyBalance: q<void, ZcoinGetMyBalanceOutput>(\"zcoin.getMyBalance\"),\n getMyHistory: q<ZcoinGetMyHistoryInput, any[]>(\"zcoin.getMyHistory\"),\n getDepositPackages: q<ZcoinGetDepositPackagesInput, ZcoinDepositPackage[]>(\"zcoin.getDepositPackages\"),\n createDepositOrder: m<ZcoinCreateDepositOrderInput, ZcoinCreateDepositOrderOutput>(\"zcoin.createDepositOrder\"),\n getDepositStatus: q<ZcoinGetDepositStatusInput, ZcoinGetDepositStatusOutput>(\"zcoin.getDepositStatus\"),\n commercialTransfer: m<ZcoinCommercialTransferInput, ZcoinCommercialTransferOutput>(\"zcoin.commercialTransfer\"),\n mintAndCharge: m<ZcoinMintAndChargeInput, ZcoinMintAndChargeOutput>(\"zcoin.mintAndCharge\"),\n chargeUser: m<ZcoinChargeUserInput, ZcoinChargeUserOutput>(\"zcoin.chargeUser\"),\n createDirectPurchaseOrder: m<ZcoinCreateDirectPurchaseOrderInput, ZcoinCreateDirectPurchaseOrderOutput>(\"zcoin.createDirectPurchaseOrder\"),\n },\n\n // ── inventory ──────────────────────────────────────────\n inventory: {\n getUserInventory: q<InventoryGetUserInventoryInput, any[]>(\"inventory.getUserInventory\"),\n confirmOwnership: q<InventoryConfirmOwnershipInput, InventoryConfirmOwnershipOutput>(\"inventory.confirmOwnership\"),\n mint: m<InventoryMintInput, InventoryMintOutput>(\"inventory.mint\"),\n transfer: m<InventoryTransferInput, InventoryTransferOutput>(\"inventory.transfer\"),\n transferByCard: m<InventoryTransferByCardInput, InventoryTransferByCardOutput>(\"inventory.transferByCard\"),\n grantMintAuth: m<InventoryGrantMintAuthInput, any>(\"inventory.grantMintAuth\"),\n transferHistory: q<InventoryTransferHistoryInput, any[]>(\"inventory.transferHistory\"),\n },\n\n // ── collectible ────────────────────────────────────────\n collectible: {\n getInstanceById: q<CollectibleGetInstanceByIdInput, any>(\"collectible.getInstanceById\"),\n getPublicInstance: q<CollectibleGetPublicInstanceInput, any>(\"collectible.getPublicInstance\"),\n getPublicInstancesBatch: q<CollectibleGetPublicInstancesBatchInput, any[]>(\"collectible.getPublicInstancesBatch\"),\n getCardProfile: q<CollectibleGetCardProfileInput, any>(\"collectible.getCardProfile\"),\n getShellImageUrl: q<CollectibleGetShellImageUrlInput, any>(\"collectible.getShellImageUrl\"),\n },\n\n // ── user ───────────────────────────────────────────────\n user: {\n getPublicProfile: q<UserGetPublicProfileInput, UserPublicProfile>(\"user.getPublicProfile\"),\n getPublicProfileById: q<UserGetPublicProfileByIdInput, UserPublicProfile>(\"user.getPublicProfileById\"),\n },\n\n // ── auth ───────────────────────────────────────────────\n auth: {\n me: q<void, AuthUser | null>(\"auth.me\"),\n getOAuthAppInfo: q<AuthGetOAuthAppInfoInput, AuthOAuthAppInfo | null>(\"auth.getOAuthAppInfo\"),\n },\n\n // ── ip (franchise/series/card) ─────────────────────────\n ip: {\n getFranchise: q<FranchiseGetInput, any>(\"franchise.get\"),\n getSeries: q<SeriesGetInput, any>(\"series.get\"),\n listSeriesByFranchise: q<SeriesListByFranchiseInput, any[]>(\"series.listByFranchise\"),\n getCard: q<CardGetInput, any>(\"card.get\"),\n listCardsBySeries: q<CardListBySeriesInput, any[]>(\"card.listBySeries\"),\n },\n\n // ── commerce (MCP) ─────────────────────────────────────\n commerce: createCommerceNamespace(commerceTransport),\n\n // ── exchange (MCP) ─────────────────────────────────────\n exchange: createExchangeNamespace(exchangeTransport),\n\n // ── alive (MCP) ────────────────────────────────────────\n alive: createAliveNamespace(aliveTransport),\n\n // ── raw escape hatches (Core tRPC only) ────────────────\n rawQuery: <T = any>(path: string, input?: any) => callQuery<any, T>(coreTransport, path, input),\n rawMutation: <T = any>(path: string, input?: any) => callMutation<any, T>(coreTransport, path, input),\n };\n}\n\n/**\n * Alias for createGoodZClient — creates a client acting on behalf of a user.\n * Semantically identical, but makes the intent clearer in server-to-server code.\n */\nexport const createUserClient = createGoodZClient;\n"]}