@crowdedkingdoms/crowdyjs 16.0.0 → 16.2.0-dev.1
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/default-origin.d.ts +6 -6
- package/dist/default-origin.d.ts.map +1 -1
- package/dist/default-origin.js +6 -6
- package/dist/domains/billing.d.ts +10 -4
- package/dist/domains/billing.d.ts.map +1 -1
- package/dist/domains/billing.js +10 -4
- package/dist/domains/playerWallet.d.ts +30 -20
- package/dist/domains/playerWallet.d.ts.map +1 -1
- package/dist/domains/playerWallet.js +16 -3
- package/dist/generated/graphql.d.ts +175 -8
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +9 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/kit/npcs.d.ts.map +1 -1
- package/dist/kit/social.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/default-origin.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED — do not edit. The operator tooling's
|
|
3
|
-
* `sync-client-origins.mjs --write --tier
|
|
3
|
+
* `sync-client-origins.mjs --write --tier dev` writes this file, and
|
|
4
4
|
* `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
|
|
5
5
|
* host that declaration does not carry. Regenerate; never hand-edit.
|
|
6
6
|
*
|
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
* than no default at all. Every fallback this SDK ever removed named a host that
|
|
11
11
|
* was already dead. A generated file plus a gate is what makes this one different.
|
|
12
12
|
*
|
|
13
|
-
* Source: the operator's per-tier public CK API origin declaration, tier '
|
|
13
|
+
* Source: the operator's per-tier public CK API origin declaration, tier 'dev'
|
|
14
14
|
*/
|
|
15
15
|
/** The tier this build of the SDK is published for. */
|
|
16
|
-
export declare const CROWDY_DEFAULT_TIER = "
|
|
16
|
+
export declare const CROWDY_DEFAULT_TIER = "dev";
|
|
17
17
|
/** The public CK API origin for that tier. */
|
|
18
|
-
export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.
|
|
18
|
+
export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.dev.crowdedkingdoms.com";
|
|
19
19
|
/** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
|
|
20
|
-
export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.
|
|
20
|
+
export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.dev.crowdedkingdoms.com";
|
|
21
21
|
/** The bare hostname, for callers that need to compare rather than dial. */
|
|
22
|
-
export declare const CROWDY_DEFAULT_HOST = "ck.
|
|
22
|
+
export declare const CROWDY_DEFAULT_HOST = "ck.dev.crowdedkingdoms.com";
|
|
23
23
|
//# sourceMappingURL=default-origin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,uCAAuC,CAAC;AAE/E,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAE3E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,+BAA+B,CAAC"}
|
package/dist/default-origin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED — do not edit. The operator tooling's
|
|
3
|
-
* `sync-client-origins.mjs --write --tier
|
|
3
|
+
* `sync-client-origins.mjs --write --tier dev` writes this file, and
|
|
4
4
|
* `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
|
|
5
5
|
* host that declaration does not carry. Regenerate; never hand-edit.
|
|
6
6
|
*
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
* than no default at all. Every fallback this SDK ever removed named a host that
|
|
11
11
|
* was already dead. A generated file plus a gate is what makes this one different.
|
|
12
12
|
*
|
|
13
|
-
* Source: the operator's per-tier public CK API origin declaration, tier '
|
|
13
|
+
* Source: the operator's per-tier public CK API origin declaration, tier 'dev'
|
|
14
14
|
*/
|
|
15
15
|
/** The tier this build of the SDK is published for. */
|
|
16
|
-
export const CROWDY_DEFAULT_TIER = '
|
|
16
|
+
export const CROWDY_DEFAULT_TIER = 'dev';
|
|
17
17
|
/** The public CK API origin for that tier. */
|
|
18
|
-
export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.
|
|
18
|
+
export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.dev.crowdedkingdoms.com';
|
|
19
19
|
/** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
|
|
20
|
-
export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.
|
|
20
|
+
export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.dev.crowdedkingdoms.com';
|
|
21
21
|
/** The bare hostname, for callers that need to compare rather than dial. */
|
|
22
|
-
export const CROWDY_DEFAULT_HOST = 'ck.
|
|
22
|
+
export const CROWDY_DEFAULT_HOST = 'ck.dev.crowdedkingdoms.com';
|
|
@@ -5,9 +5,13 @@ import { type WalletBalanceQuery, type WalletTransactionsQuery, type WalletTrans
|
|
|
5
5
|
* `client.admin`).
|
|
6
6
|
*
|
|
7
7
|
* Part of the management surface. Reads require the `view_billing` org/app
|
|
8
|
-
* permission; {@link setAppBudget} requires `manage_billing`.
|
|
9
|
-
*
|
|
10
|
-
* strings
|
|
8
|
+
* permission; {@link setAppBudget} requires `manage_billing`. Wallet money is
|
|
9
|
+
* MICRO-USD (`*Microusd`, 1 USD = 1,000,000) serialized as `BigInt` decimal
|
|
10
|
+
* strings -- the unit of account since the lossless ledger (ck-api 2026-09-11),
|
|
11
|
+
* in which nothing is rounded. The `*Cents` fields remain as deprecated
|
|
12
|
+
* derived values (micro-USD / 10,000, truncated toward zero) and will be
|
|
13
|
+
* removed in a later major. Budget caps (`monthlyLimitCents`) stay in cents:
|
|
14
|
+
* they are limits, not money of record.
|
|
11
15
|
*
|
|
12
16
|
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` / `SCOPE_MISSING`
|
|
13
17
|
* per the permission notes above.
|
|
@@ -20,7 +24,9 @@ export declare class BillingAPI {
|
|
|
20
24
|
* permission.
|
|
21
25
|
*
|
|
22
26
|
* @param orgId - Numeric org id (`BigInt` as a decimal string).
|
|
23
|
-
* @returns The wallet balance
|
|
27
|
+
* @returns The wallet balance: `balanceMicrousd` and `holdsMicrousd`
|
|
28
|
+
* (micro-USD as decimal strings; spendable = balance − holds), plus the
|
|
29
|
+
* deprecated `balanceCents`.
|
|
24
30
|
*/
|
|
25
31
|
walletBalance(orgId: string): Promise<WalletBalanceQuery['walletBalance']>;
|
|
26
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../src/domains/billing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAOL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,iCAAiC,EACtC,KAAK,0CAA0C,EAC/C,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../src/domains/billing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAOL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,iCAAiC,EACtC,KAAK,0CAA0C,EAC/C,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAC1B,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,aAAa;IAE/C;;;;;;;;OAQG;IACG,aAAa,CACjB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;IAK/C;;;;;;;OAOG;IACG,kBAAkB,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAC7C,OAAO,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;IASzD;;;;;;;OAOG;IACG,SAAS,CACb,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;IAQvC;;;;;;OAMG;IACG,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAKvE;;;;;;;;;OASG;IACG,YAAY,CAChB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,iBAAiB,EAAE,MAAM,GACxB,OAAO,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IAShD;;;;;;;;OAQG;IACG,4BAA4B,CAChC,IAAI,EAAE,0CAA0C,GAC/C,OAAO,CACR,iCAAiC,CAAC,8BAA8B,CAAC,CAClE;CAWF"}
|
package/dist/domains/billing.js
CHANGED
|
@@ -4,9 +4,13 @@ import { WalletBalanceDocument, WalletTransactionsDocument, WalletTransactionsCo
|
|
|
4
4
|
* `client.admin`).
|
|
5
5
|
*
|
|
6
6
|
* Part of the management surface. Reads require the `view_billing` org/app
|
|
7
|
-
* permission; {@link setAppBudget} requires `manage_billing`.
|
|
8
|
-
*
|
|
9
|
-
* strings
|
|
7
|
+
* permission; {@link setAppBudget} requires `manage_billing`. Wallet money is
|
|
8
|
+
* MICRO-USD (`*Microusd`, 1 USD = 1,000,000) serialized as `BigInt` decimal
|
|
9
|
+
* strings -- the unit of account since the lossless ledger (ck-api 2026-09-11),
|
|
10
|
+
* in which nothing is rounded. The `*Cents` fields remain as deprecated
|
|
11
|
+
* derived values (micro-USD / 10,000, truncated toward zero) and will be
|
|
12
|
+
* removed in a later major. Budget caps (`monthlyLimitCents`) stay in cents:
|
|
13
|
+
* they are limits, not money of record.
|
|
10
14
|
*
|
|
11
15
|
* @throws {CrowdyGraphQLError} `UNAUTHENTICATED` / `FORBIDDEN` / `SCOPE_MISSING`
|
|
12
16
|
* per the permission notes above.
|
|
@@ -20,7 +24,9 @@ export class BillingAPI {
|
|
|
20
24
|
* permission.
|
|
21
25
|
*
|
|
22
26
|
* @param orgId - Numeric org id (`BigInt` as a decimal string).
|
|
23
|
-
* @returns The wallet balance
|
|
27
|
+
* @returns The wallet balance: `balanceMicrousd` and `holdsMicrousd`
|
|
28
|
+
* (micro-USD as decimal strings; spendable = balance − holds), plus the
|
|
29
|
+
* deprecated `balanceCents`.
|
|
24
30
|
*/
|
|
25
31
|
async walletBalance(orgId) {
|
|
26
32
|
const data = await this.api.request(WalletBalanceDocument, { orgId });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GraphQLClient } from
|
|
2
|
-
import { type BeginPlayerCardSetupMutation, type PlayerWalletBalanceQuery, type PlayerWalletTransactionsQuery, type PlayerWalletTransactionsQueryVariables, type PlayerUsageChargesQuery, type PlayerUsageChargesQueryVariables, type PlayerSpendCapsQuery, type SetPlayerSpendCapMutation, type SetPlayerSpendCapMutationVariables, type PlayerAutoBillingQuery, type SetPlayerAutoBillingMutation, type SetPlayerAutoBillingMutationVariables, type PlayerRuntimeStatesQuery, type PlayerWasmPoliciesQuery, type PlayerWasmPoliciesQueryVariables, type SetPlayerWasmPolicyMutation, type SetPlayerWasmPolicyMutationVariables, type DeletePlayerWasmPolicyMutation, type DeletePlayerWasmPolicyMutationVariables, type PlayerRateMarkupQuery, type PlayerRateMarkupQueryVariables, type SetPlayerRateMarkupMutation, type SetPlayerRateMarkupMutationVariables, type AppPlayerUsageQuery, type AppPlayerUsageQueryVariables, type AppPlayerMarkupAccruedQuery, type AppPlayerMarkupAccruedQueryVariables } from
|
|
1
|
+
import type { GraphQLClient } from "../client.js";
|
|
2
|
+
import { type BeginPlayerCardSetupMutation, type PlayerWalletBalanceQuery, type PlayerWalletTransactionsQuery, type PlayerWalletTransactionsQueryVariables, type PlayerUsageChargesQuery, type PlayerUsageChargesQueryVariables, type PlayerSpendCapsQuery, type SetPlayerSpendCapMutation, type SetPlayerSpendCapMutationVariables, type PlayerAutoBillingQuery, type SetPlayerAutoBillingMutation, type SetPlayerAutoBillingMutationVariables, type PlayerRuntimeStatesQuery, type PlayerWasmPoliciesQuery, type PlayerWasmPoliciesQueryVariables, type SetPlayerWasmPolicyMutation, type SetPlayerWasmPolicyMutationVariables, type DeletePlayerWasmPolicyMutation, type DeletePlayerWasmPolicyMutationVariables, type PlayerRateMarkupQuery, type PlayerRateMarkupQueryVariables, type SetPlayerRateMarkupMutation, type SetPlayerRateMarkupMutationVariables, type AppPlayerUsageQuery, type AppPlayerUsageQueryVariables, type AppPlayerMarkupAccruedQuery, type AppPlayerMarkupAccruedQueryVariables, type AppPlayerMarkupAccruedMicrousdQuery, type AppPlayerMarkupAccruedMicrousdQueryVariables } from "../generated/graphql.js";
|
|
3
3
|
/**
|
|
4
4
|
* The player wallet and player-billing surface (player compute P2, DN-5) —
|
|
5
5
|
* exposed as `client.playerWallet` and routed to the Management API.
|
|
@@ -16,44 +16,54 @@ import { type BeginPlayerCardSetupMutation, type PlayerWalletBalanceQuery, type
|
|
|
16
16
|
export declare class PlayerWalletAPI {
|
|
17
17
|
private readonly graphql;
|
|
18
18
|
constructor(graphql: GraphQLClient);
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The caller's wallet, created empty on first access (never null).
|
|
21
|
+
* `balanceMicrousd` / `holdsMicrousd` are micro-USD (1 USD = 1,000,000)
|
|
22
|
+
* decimal strings; spendable = balance − holds (a model turn holds its
|
|
23
|
+
* worst case while it runs). `balanceCents` is the deprecated truncation.
|
|
24
|
+
*/
|
|
25
|
+
balance(): Promise<PlayerWalletBalanceQuery["playerWalletBalance"]>;
|
|
21
26
|
/** The caller's wallet ledger, newest first. */
|
|
22
|
-
transactions(variables?: PlayerWalletTransactionsQueryVariables): Promise<PlayerWalletTransactionsQuery[
|
|
27
|
+
transactions(variables?: PlayerWalletTransactionsQueryVariables): Promise<PlayerWalletTransactionsQuery["playerWalletTransactions"]>;
|
|
23
28
|
/**
|
|
24
29
|
* The caller's posted hourly usage charges; each splits platformCents vs
|
|
25
30
|
* markupCents with a per-metric snapshot ("what is this grid costing me").
|
|
26
31
|
*/
|
|
27
|
-
charges(variables?: PlayerUsageChargesQueryVariables): Promise<PlayerUsageChargesQuery[
|
|
32
|
+
charges(variables?: PlayerUsageChargesQueryVariables): Promise<PlayerUsageChargesQuery["playerUsageCharges"]>;
|
|
28
33
|
/** The caller's self-set spend caps with running counters. */
|
|
29
|
-
spendCaps(): Promise<PlayerSpendCapsQuery[
|
|
34
|
+
spendCaps(): Promise<PlayerSpendCapsQuery["playerSpendCaps"]>;
|
|
30
35
|
/** Set (or clear with null limits) a global or per-app self spend cap. */
|
|
31
|
-
setSpendCap(variables: SetPlayerSpendCapMutationVariables): Promise<SetPlayerSpendCapMutation[
|
|
36
|
+
setSpendCap(variables: SetPlayerSpendCapMutationVariables): Promise<SetPlayerSpendCapMutation["setPlayerSpendCap"]>;
|
|
32
37
|
/** The caller's auto-recharge settings. */
|
|
33
|
-
autoBilling(): Promise<PlayerAutoBillingQuery[
|
|
38
|
+
autoBilling(): Promise<PlayerAutoBillingQuery["playerAutoBilling"]>;
|
|
34
39
|
/** Configure auto-recharge (requires a vaulted payment method to enable). */
|
|
35
|
-
setAutoBilling(variables: SetPlayerAutoBillingMutationVariables): Promise<SetPlayerAutoBillingMutation[
|
|
40
|
+
setAutoBilling(variables: SetPlayerAutoBillingMutationVariables): Promise<SetPlayerAutoBillingMutation["setPlayerAutoBilling"]>;
|
|
36
41
|
/**
|
|
37
42
|
* Begin vaulting a card on the caller's player wallet (P4b): returns the
|
|
38
43
|
* Stripe SetupIntent client secret + publishable key the browser confirms.
|
|
39
44
|
* On success the card is saved for wallet auto-recharge and rent auto-renew.
|
|
40
45
|
*/
|
|
41
|
-
beginCardSetup(): Promise<BeginPlayerCardSetupMutation[
|
|
46
|
+
beginCardSetup(): Promise<BeginPlayerCardSetupMutation["beginPlayerCardSetup"]>;
|
|
42
47
|
/** The caller's per-app gate states (absence means active). */
|
|
43
|
-
runtimeStates(): Promise<PlayerRuntimeStatesQuery[
|
|
48
|
+
runtimeStates(): Promise<PlayerRuntimeStatesQuery["playerRuntimeStates"]>;
|
|
44
49
|
/** Studio: list an app's player policy rows (`view_compute_diagnostics`). */
|
|
45
|
-
policies(variables: PlayerWasmPoliciesQueryVariables): Promise<PlayerWasmPoliciesQuery[
|
|
50
|
+
policies(variables: PlayerWasmPoliciesQueryVariables): Promise<PlayerWasmPoliciesQuery["playerWasmPolicies"]>;
|
|
46
51
|
/** Studio: upsert a player policy row (`manage_compute`). */
|
|
47
|
-
setPolicy(variables: SetPlayerWasmPolicyMutationVariables): Promise<SetPlayerWasmPolicyMutation[
|
|
52
|
+
setPolicy(variables: SetPlayerWasmPolicyMutationVariables): Promise<SetPlayerWasmPolicyMutation["setPlayerWasmPolicy"]>;
|
|
48
53
|
/** Studio: delete a player policy row (`manage_compute`). */
|
|
49
|
-
deletePolicy(variables: DeletePlayerWasmPolicyMutationVariables): Promise<DeletePlayerWasmPolicyMutation[
|
|
54
|
+
deletePolicy(variables: DeletePlayerWasmPolicyMutationVariables): Promise<DeletePlayerWasmPolicyMutation["deletePlayerWasmPolicy"]>;
|
|
50
55
|
/** Studio: read the app's player rate-card markup in bps (`view_billing`). */
|
|
51
|
-
rateMarkup(variables: PlayerRateMarkupQueryVariables): Promise<PlayerRateMarkupQuery[
|
|
56
|
+
rateMarkup(variables: PlayerRateMarkupQueryVariables): Promise<PlayerRateMarkupQuery["playerRateMarkup"]>;
|
|
52
57
|
/** Studio: set the app's player rate-card markup in bps (`manage_billing`). */
|
|
53
|
-
setRateMarkup(variables: SetPlayerRateMarkupMutationVariables): Promise<SetPlayerRateMarkupMutation[
|
|
58
|
+
setRateMarkup(variables: SetPlayerRateMarkupMutationVariables): Promise<SetPlayerRateMarkupMutation["setPlayerRateMarkup"]>;
|
|
54
59
|
/** Studio: per-player usage aggregate (`view_compute_diagnostics`). */
|
|
55
|
-
appPlayerUsage(variables: AppPlayerUsageQueryVariables): Promise<AppPlayerUsageQuery[
|
|
56
|
-
/**
|
|
57
|
-
|
|
60
|
+
appPlayerUsage(variables: AppPlayerUsageQueryVariables): Promise<AppPlayerUsageQuery["appPlayerUsage"]>;
|
|
61
|
+
/**
|
|
62
|
+
* Studio: total accrued markup income in cents (`view_billing`).
|
|
63
|
+
* @deprecated Cents truncate; `appMarkupAccruedMicrousd` carries the exact amount.
|
|
64
|
+
*/
|
|
65
|
+
appMarkupAccrued(variables: AppPlayerMarkupAccruedQueryVariables): Promise<AppPlayerMarkupAccruedQuery["appPlayerMarkupAccrued"]>;
|
|
66
|
+
/** Studio: total accrued markup income in micro-USD, exact (`view_billing`). */
|
|
67
|
+
appMarkupAccruedMicrousd(variables: AppPlayerMarkupAccruedMicrousdQueryVariables): Promise<AppPlayerMarkupAccruedMicrousdQuery["appPlayerMarkupAccruedMicrousd"]>;
|
|
58
68
|
}
|
|
59
69
|
//# sourceMappingURL=playerWallet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerWallet.d.ts","sourceRoot":"","sources":["../../src/domains/playerWallet.ts"],"names":[],"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;IAKjD;;;OAGG;IACG,gBAAgB,CACpB,SAAS,EAAE,oCAAoC,GAC9C,OAAO,CAAC,2BAA2B,CAAC,wBAAwB,CAAC,CAAC;IAQjE,gFAAgF;IAC1E,wBAAwB,CAC5B,SAAS,EAAE,4CAA4C,GACtD,OAAO,CACR,mCAAmC,CAAC,gCAAgC,CAAC,CACtE;CAOF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlayerWalletBalanceDocument, PlayerWalletTransactionsDocument, PlayerUsageChargesDocument, PlayerSpendCapsDocument, SetPlayerSpendCapDocument, PlayerAutoBillingDocument, SetPlayerAutoBillingDocument, BeginPlayerCardSetupDocument, PlayerRuntimeStatesDocument, PlayerWasmPoliciesDocument, SetPlayerWasmPolicyDocument, DeletePlayerWasmPolicyDocument, PlayerRateMarkupDocument, SetPlayerRateMarkupDocument, AppPlayerUsageDocument, AppPlayerMarkupAccruedDocument, } from
|
|
1
|
+
import { PlayerWalletBalanceDocument, PlayerWalletTransactionsDocument, PlayerUsageChargesDocument, PlayerSpendCapsDocument, SetPlayerSpendCapDocument, PlayerAutoBillingDocument, SetPlayerAutoBillingDocument, BeginPlayerCardSetupDocument, PlayerRuntimeStatesDocument, PlayerWasmPoliciesDocument, SetPlayerWasmPolicyDocument, DeletePlayerWasmPolicyDocument, PlayerRateMarkupDocument, SetPlayerRateMarkupDocument, AppPlayerUsageDocument, AppPlayerMarkupAccruedDocument, AppPlayerMarkupAccruedMicrousdDocument, } from "../generated/graphql.js";
|
|
2
2
|
/**
|
|
3
3
|
* The player wallet and player-billing surface (player compute P2, DN-5) —
|
|
4
4
|
* exposed as `client.playerWallet` and routed to the Management API.
|
|
@@ -16,7 +16,12 @@ export class PlayerWalletAPI {
|
|
|
16
16
|
constructor(graphql) {
|
|
17
17
|
this.graphql = graphql;
|
|
18
18
|
}
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* The caller's wallet, created empty on first access (never null).
|
|
21
|
+
* `balanceMicrousd` / `holdsMicrousd` are micro-USD (1 USD = 1,000,000)
|
|
22
|
+
* decimal strings; spendable = balance − holds (a model turn holds its
|
|
23
|
+
* worst case while it runs). `balanceCents` is the deprecated truncation.
|
|
24
|
+
*/
|
|
20
25
|
async balance() {
|
|
21
26
|
const data = await this.graphql.request(PlayerWalletBalanceDocument, {});
|
|
22
27
|
return data.playerWalletBalance;
|
|
@@ -98,9 +103,17 @@ export class PlayerWalletAPI {
|
|
|
98
103
|
const data = await this.graphql.request(AppPlayerUsageDocument, variables);
|
|
99
104
|
return data.appPlayerUsage;
|
|
100
105
|
}
|
|
101
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Studio: total accrued markup income in cents (`view_billing`).
|
|
108
|
+
* @deprecated Cents truncate; `appMarkupAccruedMicrousd` carries the exact amount.
|
|
109
|
+
*/
|
|
102
110
|
async appMarkupAccrued(variables) {
|
|
103
111
|
const data = await this.graphql.request(AppPlayerMarkupAccruedDocument, variables);
|
|
104
112
|
return data.appPlayerMarkupAccrued;
|
|
105
113
|
}
|
|
114
|
+
/** Studio: total accrued markup income in micro-USD, exact (`view_billing`). */
|
|
115
|
+
async appMarkupAccruedMicrousd(variables) {
|
|
116
|
+
const data = await this.graphql.request(AppPlayerMarkupAccruedMicrousdDocument, variables);
|
|
117
|
+
return data.appPlayerMarkupAccruedMicrousd;
|
|
118
|
+
}
|
|
106
119
|
}
|