@tokagent/tokagentos 2.0.11 → 2.0.13
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/package.json +1 -1
- package/scaffold-patches/packages/app-core/src/components/pages/BillingPageView.tsx +0 -37
- package/templates/fullstack-app/plugins/plugin-tokagent-billing/package.json +1 -1
- package/templates/fullstack-app/plugins/plugin-tokagent-billing/src/dashboard/index.html +0 -24
- package/templates/fullstack-app/plugins/plugin-tokagent-billing/src/routes/credits-routes.ts +2 -0
- package/templates/fullstack-app/plugins/plugin-tokagent-billing/src/routes/estimate-routes.ts +6 -0
- package/templates/fullstack-app/plugins/plugin-tokagent-billing/src/routes/keys-routes.ts +6 -0
- package/templates/fullstack-app/plugins/plugin-tokagent-billing/src/routes/topup-routes.ts +14 -0
- package/templates/fullstack-app/plugins/plugin-tokagent-billing/src/routes/usage-routes.ts +6 -0
- package/templates-manifest.json +1 -1
package/package.json
CHANGED
|
@@ -113,43 +113,6 @@ function BillingPageView(): React.ReactElement {
|
|
|
113
113
|
background: "#0a0a0f",
|
|
114
114
|
}}
|
|
115
115
|
>
|
|
116
|
-
{/* BETA ticker — rendered in the parent React tree (not the iframe)
|
|
117
|
-
so dashboard rebuilds don't overwrite it. Slim strip, non-sticky,
|
|
118
|
-
uses the parent's locked lime accent. */}
|
|
119
|
-
<div
|
|
120
|
-
style={{
|
|
121
|
-
display: "flex",
|
|
122
|
-
alignItems: "center",
|
|
123
|
-
gap: "0.5rem",
|
|
124
|
-
padding: "8px 16px",
|
|
125
|
-
background: "rgba(196, 245, 71, 0.08)",
|
|
126
|
-
borderBottom: "1px solid rgba(196, 245, 71, 0.25)",
|
|
127
|
-
color: "#c4f547",
|
|
128
|
-
fontSize: "0.75rem",
|
|
129
|
-
fontWeight: 600,
|
|
130
|
-
letterSpacing: "0.06em",
|
|
131
|
-
textTransform: "uppercase",
|
|
132
|
-
flexShrink: 0,
|
|
133
|
-
}}
|
|
134
|
-
>
|
|
135
|
-
<span
|
|
136
|
-
style={{
|
|
137
|
-
display: "inline-block",
|
|
138
|
-
padding: "2px 8px",
|
|
139
|
-
borderRadius: "999px",
|
|
140
|
-
background: "#c4f547",
|
|
141
|
-
color: "#0a0a0f",
|
|
142
|
-
fontSize: "0.65rem",
|
|
143
|
-
fontWeight: 700,
|
|
144
|
-
letterSpacing: "0.08em",
|
|
145
|
-
}}
|
|
146
|
-
>
|
|
147
|
-
BETA
|
|
148
|
-
</span>
|
|
149
|
-
<span style={{ color: "#9ca3af", fontWeight: 500, textTransform: "none", letterSpacing: 0 }}>
|
|
150
|
-
The x402 rail is in active development — expect rapid iteration.
|
|
151
|
-
</span>
|
|
152
|
-
</div>
|
|
153
116
|
{loading ? (
|
|
154
117
|
<div
|
|
155
118
|
style={{
|
|
@@ -121,30 +121,6 @@
|
|
|
121
121
|
</article>
|
|
122
122
|
</section>
|
|
123
123
|
|
|
124
|
-
<!-- ---- Faucet (test/fork only) ---- -->
|
|
125
|
-
<section class="card section-card">
|
|
126
|
-
<header>
|
|
127
|
-
<h2>Test PTON faucet</h2>
|
|
128
|
-
<span class="card-sub">Mint PTON to your wallet (works only when the deployed PTON has <code>faucetEnabled=true</code>)</span>
|
|
129
|
-
</header>
|
|
130
|
-
<div class="topup-row">
|
|
131
|
-
<div class="topup-amount">
|
|
132
|
-
<label for="faucet-amount">Amount</label>
|
|
133
|
-
<div class="topup-input">
|
|
134
|
-
<input id="faucet-amount" type="number" step="1" min="1" value="100" inputmode="decimal" />
|
|
135
|
-
<span class="suffix">PTON</span>
|
|
136
|
-
</div>
|
|
137
|
-
<p class="muted small">
|
|
138
|
-
Calls <code>PTON.faucet(amount)</code> from your wallet. Requires a small amount of native gas.
|
|
139
|
-
</p>
|
|
140
|
-
</div>
|
|
141
|
-
<div class="topup-action">
|
|
142
|
-
<button id="faucet-btn" class="btn btn-ghost" type="button">Mint test PTON</button>
|
|
143
|
-
<p id="faucet-status" class="status-line" role="status" aria-live="polite"></p>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
</section>
|
|
147
|
-
|
|
148
124
|
<!-- ---- Top up ---- -->
|
|
149
125
|
<section class="card section-card">
|
|
150
126
|
<header>
|
package/templates/fullstack-app/plugins/plugin-tokagent-billing/src/routes/credits-routes.ts
CHANGED
|
@@ -100,6 +100,7 @@ export const creditsRoutes: Route[] = [
|
|
|
100
100
|
type: "GET",
|
|
101
101
|
path: "/v1/credits/me",
|
|
102
102
|
rawPath: true,
|
|
103
|
+
public: true,
|
|
103
104
|
name: "billing-credits-me",
|
|
104
105
|
handler: handleGetCreditsMe,
|
|
105
106
|
},
|
|
@@ -115,6 +116,7 @@ function clientCreditsRoutes(): Route[] {
|
|
|
115
116
|
type: "GET",
|
|
116
117
|
path: "/v1/credits/me",
|
|
117
118
|
rawPath: true,
|
|
119
|
+
public: true,
|
|
118
120
|
name: "billing-credits-me",
|
|
119
121
|
handler: async (req, res) => {
|
|
120
122
|
if (!ensureClientReady(res)) return;
|
package/templates/fullstack-app/plugins/plugin-tokagent-billing/src/routes/estimate-routes.ts
CHANGED
|
@@ -331,6 +331,7 @@ export const estimateRoutes: Route[] = [
|
|
|
331
331
|
type: "POST",
|
|
332
332
|
path: "/v1/estimate",
|
|
333
333
|
rawPath: true,
|
|
334
|
+
public: true,
|
|
334
335
|
name: "billing-estimate",
|
|
335
336
|
handler: handleEstimate,
|
|
336
337
|
},
|
|
@@ -338,6 +339,7 @@ export const estimateRoutes: Route[] = [
|
|
|
338
339
|
type: "POST",
|
|
339
340
|
path: "/v1/messages/count_tokens",
|
|
340
341
|
rawPath: true,
|
|
342
|
+
public: true,
|
|
341
343
|
name: "billing-count-tokens",
|
|
342
344
|
handler: handleCountTokens,
|
|
343
345
|
},
|
|
@@ -345,6 +347,7 @@ export const estimateRoutes: Route[] = [
|
|
|
345
347
|
type: "GET",
|
|
346
348
|
path: "/v1/price",
|
|
347
349
|
rawPath: true,
|
|
350
|
+
public: true,
|
|
348
351
|
name: "billing-price-debug",
|
|
349
352
|
handler: handlePrice,
|
|
350
353
|
},
|
|
@@ -360,6 +363,7 @@ function clientEstimateRoutes(): Route[] {
|
|
|
360
363
|
type: "POST",
|
|
361
364
|
path: "/v1/estimate",
|
|
362
365
|
rawPath: true,
|
|
366
|
+
public: true,
|
|
363
367
|
name: "billing-estimate",
|
|
364
368
|
handler: async (req, res) => {
|
|
365
369
|
if (!ensureClientReady(res)) return;
|
|
@@ -372,6 +376,7 @@ function clientEstimateRoutes(): Route[] {
|
|
|
372
376
|
type: "POST",
|
|
373
377
|
path: "/v1/messages/count_tokens",
|
|
374
378
|
rawPath: true,
|
|
379
|
+
public: true,
|
|
375
380
|
name: "billing-count-tokens",
|
|
376
381
|
handler: async (req, res) => {
|
|
377
382
|
if (!ensureClientReady(res)) return;
|
|
@@ -387,6 +392,7 @@ function clientEstimateRoutes(): Route[] {
|
|
|
387
392
|
type: "GET",
|
|
388
393
|
path: "/v1/price",
|
|
389
394
|
rawPath: true,
|
|
395
|
+
public: true,
|
|
390
396
|
name: "billing-price-debug",
|
|
391
397
|
handler: async (_req, res) => {
|
|
392
398
|
if (!ensureClientReady(res)) return;
|
|
@@ -177,6 +177,7 @@ export const keysRoutes: Route[] = [
|
|
|
177
177
|
type: "POST",
|
|
178
178
|
path: "/v1/keys",
|
|
179
179
|
rawPath: true,
|
|
180
|
+
public: true,
|
|
180
181
|
name: "billing-keys-mint",
|
|
181
182
|
handler: handleMintKey,
|
|
182
183
|
},
|
|
@@ -184,6 +185,7 @@ export const keysRoutes: Route[] = [
|
|
|
184
185
|
type: "GET",
|
|
185
186
|
path: "/v1/keys",
|
|
186
187
|
rawPath: true,
|
|
188
|
+
public: true,
|
|
187
189
|
name: "billing-keys-list",
|
|
188
190
|
handler: handleListKeys,
|
|
189
191
|
},
|
|
@@ -191,6 +193,7 @@ export const keysRoutes: Route[] = [
|
|
|
191
193
|
type: "DELETE",
|
|
192
194
|
path: "/v1/keys/:id",
|
|
193
195
|
rawPath: true,
|
|
196
|
+
public: true,
|
|
194
197
|
name: "billing-keys-revoke",
|
|
195
198
|
handler: handleRevokeKey,
|
|
196
199
|
},
|
|
@@ -206,6 +209,7 @@ function clientKeysRoutes(): Route[] {
|
|
|
206
209
|
type: "POST",
|
|
207
210
|
path: "/v1/keys",
|
|
208
211
|
rawPath: true,
|
|
212
|
+
public: true,
|
|
209
213
|
name: "billing-keys-mint",
|
|
210
214
|
handler: async (req, res) => {
|
|
211
215
|
if (!ensureClientReady(res)) return;
|
|
@@ -219,6 +223,7 @@ function clientKeysRoutes(): Route[] {
|
|
|
219
223
|
type: "GET",
|
|
220
224
|
path: "/v1/keys",
|
|
221
225
|
rawPath: true,
|
|
226
|
+
public: true,
|
|
222
227
|
name: "billing-keys-list",
|
|
223
228
|
handler: async (req, res) => {
|
|
224
229
|
if (!ensureClientReady(res)) return;
|
|
@@ -231,6 +236,7 @@ function clientKeysRoutes(): Route[] {
|
|
|
231
236
|
type: "DELETE",
|
|
232
237
|
path: "/v1/keys/:id",
|
|
233
238
|
rawPath: true,
|
|
239
|
+
public: true,
|
|
234
240
|
name: "billing-keys-revoke",
|
|
235
241
|
handler: async (req, res) => {
|
|
236
242
|
if (!ensureClientReady(res)) return;
|
|
@@ -808,6 +808,7 @@ export const topupRoutes: Route[] = [
|
|
|
808
808
|
type: "GET",
|
|
809
809
|
path: "/v1/topup/info",
|
|
810
810
|
rawPath: true,
|
|
811
|
+
public: true,
|
|
811
812
|
name: "billing-topup-info",
|
|
812
813
|
handler: handleTopupInfo,
|
|
813
814
|
},
|
|
@@ -815,6 +816,7 @@ export const topupRoutes: Route[] = [
|
|
|
815
816
|
type: "POST",
|
|
816
817
|
path: "/v1/topup/quote",
|
|
817
818
|
rawPath: true,
|
|
819
|
+
public: true,
|
|
818
820
|
name: "billing-topup-quote",
|
|
819
821
|
handler: handleTopupQuote,
|
|
820
822
|
},
|
|
@@ -822,6 +824,7 @@ export const topupRoutes: Route[] = [
|
|
|
822
824
|
type: "POST",
|
|
823
825
|
path: "/v1/topup/settle",
|
|
824
826
|
rawPath: true,
|
|
827
|
+
public: true,
|
|
825
828
|
name: "billing-topup-settle",
|
|
826
829
|
handler: handleTopupSettle,
|
|
827
830
|
},
|
|
@@ -829,6 +832,7 @@ export const topupRoutes: Route[] = [
|
|
|
829
832
|
type: "POST",
|
|
830
833
|
path: "/v1/topup/preauth",
|
|
831
834
|
rawPath: true,
|
|
835
|
+
public: true,
|
|
832
836
|
name: "billing-topup-preauth",
|
|
833
837
|
handler: handleTopupPreauth,
|
|
834
838
|
},
|
|
@@ -836,6 +840,7 @@ export const topupRoutes: Route[] = [
|
|
|
836
840
|
type: "GET",
|
|
837
841
|
path: "/v1/topup/status",
|
|
838
842
|
rawPath: true,
|
|
843
|
+
public: true,
|
|
839
844
|
name: "billing-topup-status",
|
|
840
845
|
handler: handleTopupStatus,
|
|
841
846
|
},
|
|
@@ -843,6 +848,7 @@ export const topupRoutes: Route[] = [
|
|
|
843
848
|
type: "POST",
|
|
844
849
|
path: "/v1/topup/revoke",
|
|
845
850
|
rawPath: true,
|
|
851
|
+
public: true,
|
|
846
852
|
name: "billing-topup-revoke",
|
|
847
853
|
handler: handleTopupRevoke,
|
|
848
854
|
},
|
|
@@ -850,6 +856,7 @@ export const topupRoutes: Route[] = [
|
|
|
850
856
|
type: "GET",
|
|
851
857
|
path: "/v1/quote/:id",
|
|
852
858
|
rawPath: true,
|
|
859
|
+
public: true,
|
|
853
860
|
name: "billing-quote-debug",
|
|
854
861
|
handler: handleGetQuote,
|
|
855
862
|
},
|
|
@@ -865,6 +872,7 @@ function clientTopupRoutes(): Route[] {
|
|
|
865
872
|
type: "GET",
|
|
866
873
|
path: "/v1/topup/info",
|
|
867
874
|
rawPath: true,
|
|
875
|
+
public: true,
|
|
868
876
|
name: "billing-topup-info",
|
|
869
877
|
handler: async (req, res) => {
|
|
870
878
|
if (!ensureClientReady(res)) return;
|
|
@@ -877,6 +885,7 @@ function clientTopupRoutes(): Route[] {
|
|
|
877
885
|
type: "POST",
|
|
878
886
|
path: "/v1/topup/quote",
|
|
879
887
|
rawPath: true,
|
|
888
|
+
public: true,
|
|
880
889
|
name: "billing-topup-quote",
|
|
881
890
|
handler: async (req, res) => {
|
|
882
891
|
if (!ensureClientReady(res)) return;
|
|
@@ -889,6 +898,7 @@ function clientTopupRoutes(): Route[] {
|
|
|
889
898
|
type: "POST",
|
|
890
899
|
path: "/v1/topup/settle",
|
|
891
900
|
rawPath: true,
|
|
901
|
+
public: true,
|
|
892
902
|
name: "billing-topup-settle",
|
|
893
903
|
handler: async (req, res) => {
|
|
894
904
|
if (!ensureClientReady(res)) return;
|
|
@@ -901,6 +911,7 @@ function clientTopupRoutes(): Route[] {
|
|
|
901
911
|
type: "POST",
|
|
902
912
|
path: "/v1/topup/preauth",
|
|
903
913
|
rawPath: true,
|
|
914
|
+
public: true,
|
|
904
915
|
name: "billing-topup-preauth",
|
|
905
916
|
handler: async (req, res) => {
|
|
906
917
|
if (!ensureClientReady(res)) return;
|
|
@@ -913,6 +924,7 @@ function clientTopupRoutes(): Route[] {
|
|
|
913
924
|
type: "GET",
|
|
914
925
|
path: "/v1/topup/status",
|
|
915
926
|
rawPath: true,
|
|
927
|
+
public: true,
|
|
916
928
|
name: "billing-topup-status",
|
|
917
929
|
handler: async (req, res) => {
|
|
918
930
|
if (!ensureClientReady(res)) return;
|
|
@@ -925,6 +937,7 @@ function clientTopupRoutes(): Route[] {
|
|
|
925
937
|
type: "POST",
|
|
926
938
|
path: "/v1/topup/revoke",
|
|
927
939
|
rawPath: true,
|
|
940
|
+
public: true,
|
|
928
941
|
name: "billing-topup-revoke",
|
|
929
942
|
handler: async (req, res) => {
|
|
930
943
|
if (!ensureClientReady(res)) return;
|
|
@@ -937,6 +950,7 @@ function clientTopupRoutes(): Route[] {
|
|
|
937
950
|
type: "GET",
|
|
938
951
|
path: "/v1/quote/:id",
|
|
939
952
|
rawPath: true,
|
|
953
|
+
public: true,
|
|
940
954
|
name: "billing-quote-debug",
|
|
941
955
|
handler: async (req, res) => {
|
|
942
956
|
if (!ensureClientReady(res)) return;
|
|
@@ -414,6 +414,7 @@ export const usageRoutes: Route[] = [
|
|
|
414
414
|
type: "GET",
|
|
415
415
|
path: "/v1/usage/summary",
|
|
416
416
|
rawPath: true,
|
|
417
|
+
public: true,
|
|
417
418
|
name: "billing-usage-summary",
|
|
418
419
|
handler: handleUsageSummary,
|
|
419
420
|
},
|
|
@@ -421,6 +422,7 @@ export const usageRoutes: Route[] = [
|
|
|
421
422
|
type: "GET",
|
|
422
423
|
path: "/v1/usage/calls",
|
|
423
424
|
rawPath: true,
|
|
425
|
+
public: true,
|
|
424
426
|
name: "billing-usage-calls",
|
|
425
427
|
handler: handleUsageCalls,
|
|
426
428
|
},
|
|
@@ -428,6 +430,7 @@ export const usageRoutes: Route[] = [
|
|
|
428
430
|
type: "GET",
|
|
429
431
|
path: "/v1/usage/keys",
|
|
430
432
|
rawPath: true,
|
|
433
|
+
public: true,
|
|
431
434
|
name: "billing-usage-keys",
|
|
432
435
|
handler: handleUsageKeys,
|
|
433
436
|
},
|
|
@@ -451,6 +454,7 @@ function clientUsageRoutes(): Route[] {
|
|
|
451
454
|
type: "GET",
|
|
452
455
|
path: "/v1/usage/summary",
|
|
453
456
|
rawPath: true,
|
|
457
|
+
public: true,
|
|
454
458
|
name: "billing-usage-summary",
|
|
455
459
|
handler: async (req, res) => {
|
|
456
460
|
if (!ensureClientReady(res)) return;
|
|
@@ -466,6 +470,7 @@ function clientUsageRoutes(): Route[] {
|
|
|
466
470
|
type: "GET",
|
|
467
471
|
path: "/v1/usage/calls",
|
|
468
472
|
rawPath: true,
|
|
473
|
+
public: true,
|
|
469
474
|
name: "billing-usage-calls",
|
|
470
475
|
handler: async (req, res) => {
|
|
471
476
|
if (!ensureClientReady(res)) return;
|
|
@@ -481,6 +486,7 @@ function clientUsageRoutes(): Route[] {
|
|
|
481
486
|
type: "GET",
|
|
482
487
|
path: "/v1/usage/keys",
|
|
483
488
|
rawPath: true,
|
|
489
|
+
public: true,
|
|
484
490
|
name: "billing-usage-keys",
|
|
485
491
|
handler: async (req, res) => {
|
|
486
492
|
if (!ensureClientReady(res)) return;
|