@1ly/mcp-server 0.1.2 → 0.1.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 +112 -2
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/tools/create-link.d.ts +4 -0
- package/dist/tools/create-link.d.ts.map +1 -1
- package/dist/tools/create-link.js +3 -0
- package/dist/tools/create-link.js.map +1 -1
- package/dist/tools/list-withdrawals.d.ts +26 -0
- package/dist/tools/list-withdrawals.d.ts.map +1 -0
- package/dist/tools/list-withdrawals.js +43 -0
- package/dist/tools/list-withdrawals.js.map +1 -0
- package/dist/tools/update-avatar.d.ts +34 -0
- package/dist/tools/update-avatar.d.ts.map +1 -0
- package/dist/tools/update-avatar.js +63 -0
- package/dist/tools/update-avatar.js.map +1 -0
- package/dist/tools/update-link.d.ts +3 -0
- package/dist/tools/update-link.d.ts.map +1 -1
- package/dist/tools/update-link.js +3 -0
- package/dist/tools/update-link.js.map +1 -1
- package/dist/tools/update-profile.d.ts +30 -0
- package/dist/tools/update-profile.d.ts.map +1 -0
- package/dist/tools/update-profile.js +42 -0
- package/dist/tools/update-profile.js.map +1 -0
- package/dist/tools/update-socials.d.ts +41 -0
- package/dist/tools/update-socials.d.ts.map +1 -0
- package/dist/tools/update-socials.js +85 -0
- package/dist/tools/update-socials.js.map +1 -0
- package/dist/tools/withdraw.d.ts +27 -0
- package/dist/tools/withdraw.d.ts.map +1 -0
- package/dist/tools/withdraw.js +45 -0
- package/dist/tools/withdraw.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -362,13 +362,15 @@ Create a new API link (paid or free).
|
|
|
362
362
|
| `currency` | string | No | Always `"USDC"` |
|
|
363
363
|
| `isPublic` | boolean | No | List publicly (default: `true`) |
|
|
364
364
|
| `isStealth` | boolean | No | Hide from search (default: `false`) |
|
|
365
|
+
| `webhookUrl` | string | No | Optional webhook URL for purchase events |
|
|
365
366
|
|
|
366
367
|
```json
|
|
367
368
|
{
|
|
368
369
|
"title": "Premium Weather API",
|
|
369
370
|
"url": "https://api.example.com/weather",
|
|
370
371
|
"price": "0.05",
|
|
371
|
-
"description": "Real-time weather data"
|
|
372
|
+
"description": "Real-time weather data",
|
|
373
|
+
"webhookUrl": "https://example.com/webhooks/1ly"
|
|
372
374
|
}
|
|
373
375
|
```
|
|
374
376
|
|
|
@@ -452,6 +454,7 @@ Update an existing API link.
|
|
|
452
454
|
| `slug` | string | No | New slug |
|
|
453
455
|
| `isPublic` | boolean | No | Update visibility |
|
|
454
456
|
| `isStealth` | boolean | No | Update stealth mode |
|
|
457
|
+
| `webhookUrl` | string | No | Update webhook URL (set to `null` to clear) |
|
|
455
458
|
|
|
456
459
|
```json
|
|
457
460
|
{
|
|
@@ -636,6 +639,98 @@ Revoke an API key.
|
|
|
636
639
|
|
|
637
640
|
---
|
|
638
641
|
|
|
642
|
+
#### `1ly_update_profile`
|
|
643
|
+
|
|
644
|
+
Update basic profile fields.
|
|
645
|
+
|
|
646
|
+
| Parameter | Type | Required | Description |
|
|
647
|
+
|-----------|------|----------|-------------|
|
|
648
|
+
| `username` | string | No | New username (lowercase + underscores) |
|
|
649
|
+
| `displayName` | string | No | Public display name |
|
|
650
|
+
| `bio` | string | No | Short bio (max 160 chars) |
|
|
651
|
+
|
|
652
|
+
```json
|
|
653
|
+
{
|
|
654
|
+
"displayName": "My Store",
|
|
655
|
+
"bio": "We build paid APIs for agents."
|
|
656
|
+
}
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
---
|
|
660
|
+
|
|
661
|
+
#### `1ly_update_socials`
|
|
662
|
+
|
|
663
|
+
Replace socials list (up to 10).
|
|
664
|
+
|
|
665
|
+
| Parameter | Type | Required | Description |
|
|
666
|
+
|-----------|------|----------|-------------|
|
|
667
|
+
| `socials` | array | **Yes** | Social links |
|
|
668
|
+
|
|
669
|
+
```json
|
|
670
|
+
{
|
|
671
|
+
"socials": [
|
|
672
|
+
{ "type": "x", "url": "https://x.com/1ly_store", "displayOrder": 0, "isVisible": true },
|
|
673
|
+
{ "type": "website", "url": "https://1ly.store", "displayOrder": 1 }
|
|
674
|
+
]
|
|
675
|
+
}
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
---
|
|
679
|
+
|
|
680
|
+
#### `1ly_update_avatar`
|
|
681
|
+
|
|
682
|
+
Update store avatar using a public URL or base64 image.
|
|
683
|
+
|
|
684
|
+
| Parameter | Type | Required | Description |
|
|
685
|
+
|-----------|------|----------|-------------|
|
|
686
|
+
| `avatarUrl` | string | No | Public image URL |
|
|
687
|
+
| `imageBase64` | string | No | Base64-encoded image bytes |
|
|
688
|
+
| `mimeType` | string | No | `image/png`, `image/jpeg`, `image/webp`, `image/gif` |
|
|
689
|
+
| `filename` | string | No | Optional filename |
|
|
690
|
+
|
|
691
|
+
```json
|
|
692
|
+
{
|
|
693
|
+
"avatarUrl": "https://example.com/avatar.png"
|
|
694
|
+
}
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
---
|
|
698
|
+
|
|
699
|
+
#### `1ly_withdraw`
|
|
700
|
+
|
|
701
|
+
Request a withdrawal (Solana only).
|
|
702
|
+
|
|
703
|
+
| Parameter | Type | Required | Description |
|
|
704
|
+
|-----------|------|----------|-------------|
|
|
705
|
+
| `amount` | string | **Yes** | Amount in USDC (min `0.1`) |
|
|
706
|
+
| `walletAddress` | string | **Yes** | Solana wallet address |
|
|
707
|
+
|
|
708
|
+
```json
|
|
709
|
+
{
|
|
710
|
+
"amount": "1.25",
|
|
711
|
+
"walletAddress": "7GmjjDitbCwW77dZmJko3pBDWhEh12soGNLR7zwAkf6M"
|
|
712
|
+
}
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
---
|
|
716
|
+
|
|
717
|
+
#### `1ly_list_withdrawals`
|
|
718
|
+
|
|
719
|
+
List recent withdrawals.
|
|
720
|
+
|
|
721
|
+
| Parameter | Type | Required | Description |
|
|
722
|
+
|-----------|------|----------|-------------|
|
|
723
|
+
| `limit` | number | No | Max items (default 25, max 100) |
|
|
724
|
+
| `cursor` | string | No | Pagination cursor |
|
|
725
|
+
|
|
726
|
+
```json
|
|
727
|
+
{
|
|
728
|
+
"limit": 10
|
|
729
|
+
}
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
---
|
|
733
|
+
|
|
639
734
|
## Common Workflows
|
|
640
735
|
|
|
641
736
|
### Workflow 1: Pay for an API
|
|
@@ -651,7 +746,7 @@ Revoke an API key.
|
|
|
651
746
|
|
|
652
747
|
```
|
|
653
748
|
1. 1ly_create_store({ "username": "mystore", "displayName": "My Store" })
|
|
654
|
-
2. 1ly_create_link({ "title": "My API", "url": "https://api.example.com", "price": "0.10" })
|
|
749
|
+
2. 1ly_create_link({ "title": "My API", "url": "https://api.example.com", "price": "0.10", "webhookUrl": "https://example.com/webhooks/1ly" })
|
|
655
750
|
3. 1ly_get_stats({ "period": "7d" })
|
|
656
751
|
```
|
|
657
752
|
|
|
@@ -663,6 +758,21 @@ Revoke an API key.
|
|
|
663
758
|
3. 1ly_delete_link({ "id": "..." })
|
|
664
759
|
```
|
|
665
760
|
|
|
761
|
+
### Workflow 4: Update Profile + Socials
|
|
762
|
+
|
|
763
|
+
```
|
|
764
|
+
1. 1ly_update_profile({ "displayName": "My Store", "bio": "We build paid APIs." })
|
|
765
|
+
2. 1ly_update_socials({ "socials": [{ "type": "x", "url": "https://x.com/1ly_store" }] })
|
|
766
|
+
3. 1ly_update_avatar({ "avatarUrl": "https://example.com/avatar.png" })
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
### Workflow 5: Withdraw Funds
|
|
770
|
+
|
|
771
|
+
```
|
|
772
|
+
1. 1ly_withdraw({ "amount": "1.25", "walletAddress": "7GmjjDitbCwW77dZmJko3pBDWhEh12soGNLR7zwAkf6M" })
|
|
773
|
+
2. 1ly_list_withdrawals({ "limit": 10 })
|
|
774
|
+
```
|
|
775
|
+
|
|
666
776
|
---
|
|
667
777
|
|
|
668
778
|
## Wallet Setup
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,11 @@ const create_store_js_1 = require("./tools/create-store.js");
|
|
|
17
17
|
const list_keys_js_1 = require("./tools/list-keys.js");
|
|
18
18
|
const create_key_js_1 = require("./tools/create-key.js");
|
|
19
19
|
const revoke_key_js_1 = require("./tools/revoke-key.js");
|
|
20
|
+
const withdraw_js_1 = require("./tools/withdraw.js");
|
|
21
|
+
const list_withdrawals_js_1 = require("./tools/list-withdrawals.js");
|
|
22
|
+
const update_profile_js_1 = require("./tools/update-profile.js");
|
|
23
|
+
const update_socials_js_1 = require("./tools/update-socials.js");
|
|
24
|
+
const update_avatar_js_1 = require("./tools/update-avatar.js");
|
|
20
25
|
const config_js_1 = require("./config.js");
|
|
21
26
|
const selftest_js_1 = require("./selftest.js");
|
|
22
27
|
const mcp_js_1 = require("./mcp.js");
|
|
@@ -50,6 +55,11 @@ async function main() {
|
|
|
50
55
|
list_keys_js_1.listKeysTool,
|
|
51
56
|
create_key_js_1.createKeyTool,
|
|
52
57
|
revoke_key_js_1.revokeKeyTool,
|
|
58
|
+
withdraw_js_1.withdrawTool,
|
|
59
|
+
list_withdrawals_js_1.listWithdrawalsTool,
|
|
60
|
+
update_profile_js_1.updateProfileTool,
|
|
61
|
+
update_socials_js_1.updateSocialsTool,
|
|
62
|
+
update_avatar_js_1.updateAvatarTool,
|
|
53
63
|
],
|
|
54
64
|
}));
|
|
55
65
|
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
@@ -83,6 +93,16 @@ async function main() {
|
|
|
83
93
|
return await (0, create_key_js_1.handleCreateKey)(args, config);
|
|
84
94
|
case "1ly_revoke_key":
|
|
85
95
|
return await (0, revoke_key_js_1.handleRevokeKey)(args, config);
|
|
96
|
+
case "1ly_withdraw":
|
|
97
|
+
return await (0, withdraw_js_1.handleWithdraw)(args, config);
|
|
98
|
+
case "1ly_list_withdrawals":
|
|
99
|
+
return await (0, list_withdrawals_js_1.handleListWithdrawals)(args, config);
|
|
100
|
+
case "1ly_update_profile":
|
|
101
|
+
return await (0, update_profile_js_1.handleUpdateProfile)(args, config);
|
|
102
|
+
case "1ly_update_socials":
|
|
103
|
+
return await (0, update_socials_js_1.handleUpdateSocials)(args, config);
|
|
104
|
+
case "1ly_update_avatar":
|
|
105
|
+
return await (0, update_avatar_js_1.handleUpdateAvatar)(args, config);
|
|
86
106
|
default:
|
|
87
107
|
return {
|
|
88
108
|
content: [{ type: "text", text: `Unknown tool: ${name}` }],
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,wEAAmE;AACnE,wEAAiF;AACjF,iEAG4C;AAE5C,iDAA6D;AAC7D,mDAAgE;AAChE,6CAAuD;AACvD,iDAA6D;AAC7D,2DAA0E;AAC1E,yDAAuE;AACvE,2DAA0E;AAC1E,2DAA0E;AAC1E,uDAAoE;AACpE,6DAA6E;AAC7E,uDAAoE;AACpE,yDAAuE;AACvE,yDAAuE;AACvE,2CAAsD;AACtD,+CAA4C;AAC5C,qCAAoC;AAEpC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AAEhD,KAAK,UAAU,IAAI;IACjB,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,IAAI,GAAG,MAAM,IAAA,yBAAW,EAAC,IAAI,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,iBAAM,CACvB;QACE,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,OAAO;KACjB,EACD;QACE,YAAY,EAAE;YACZ,KAAK,EAAE,EAAE;SACV;KACF,CACF,CAAC;IAEF,MAAM,CAAC,iBAAiB,CAAC,iCAAsB,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,CAAC;YACzE,OAAO,IAAA,iBAAQ,EAAC,OAAO,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAC1C,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-link.d.ts","sourceRoot":"","sources":["../../src/tools/create-link.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"create-link.d.ts","sourceRoot":"","sources":["../../src/tools/create-link.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkB1B,CAAC;AAcF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;;;;;;GA4BnE"}
|
|
@@ -19,6 +19,7 @@ exports.createLinkTool = {
|
|
|
19
19
|
currency: { type: "string", enum: ["USDC"] },
|
|
20
20
|
isPublic: { type: "boolean" },
|
|
21
21
|
isStealth: { type: "boolean" },
|
|
22
|
+
webhookUrl: { type: "string", description: "Optional webhook URL for purchase events" },
|
|
22
23
|
},
|
|
23
24
|
required: ["title", "url"],
|
|
24
25
|
},
|
|
@@ -32,6 +33,7 @@ const InputSchema = zod_1.z.object({
|
|
|
32
33
|
currency: zod_1.z.literal("USDC").optional(),
|
|
33
34
|
isPublic: zod_1.z.boolean().optional(),
|
|
34
35
|
isStealth: zod_1.z.boolean().optional(),
|
|
36
|
+
webhookUrl: zod_1.z.string().url().optional(),
|
|
35
37
|
});
|
|
36
38
|
async function handleCreateLink(args, config) {
|
|
37
39
|
const input = InputSchema.parse(args);
|
|
@@ -53,6 +55,7 @@ async function handleCreateLink(args, config) {
|
|
|
53
55
|
currency: input.currency || "USDC",
|
|
54
56
|
isPublic: input.isPublic ?? true,
|
|
55
57
|
isStealth: input.isStealth ?? false,
|
|
58
|
+
webhookUrl: input.webhookUrl,
|
|
56
59
|
}),
|
|
57
60
|
});
|
|
58
61
|
await (0, http_js_1.assertOk)(res, "Create link failed");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-link.js","sourceRoot":"","sources":["../../src/tools/create-link.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"create-link.js","sourceRoot":"","sources":["../../src/tools/create-link.ts"],"names":[],"mappings":";;;AAqCA,4CA4BC;AAjED,6BAAwB;AAExB,wCAAwD;AACxD,sCAAkC;AAErB,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,wEAAwE;IACrF,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACvB,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC/B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE;YAC5C,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7B,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YAC9B,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CA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AAe,EAAE;QACnE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE;SACzC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,MAAM;YAClC,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,IAAI;YAChC,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,KAAK;YACnC,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CAAC;KACH,CAAC,CAAC;IAEH,MAAM,IAAA,kBAAQ,EAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,OAAO,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Config } from "../config.js";
|
|
2
|
+
export declare const listWithdrawalsTool: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
limit: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
cursor: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare function handleListWithdrawals(args: unknown, config: Config): Promise<{
|
|
20
|
+
isError?: true | undefined;
|
|
21
|
+
content: {
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
}[];
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=list-withdrawals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-withdrawals.d.ts","sourceRoot":"","sources":["../../src/tools/list-withdrawals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;CAU/B,CAAC;AAOF,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;;;;;;GAoBxE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listWithdrawalsTool = void 0;
|
|
4
|
+
exports.handleListWithdrawals = handleListWithdrawals;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const http_js_1 = require("../http.js");
|
|
7
|
+
const mcp_js_1 = require("../mcp.js");
|
|
8
|
+
exports.listWithdrawalsTool = {
|
|
9
|
+
name: "1ly_list_withdrawals",
|
|
10
|
+
description: "List withdrawal requests for your store (requires ONELY_API_KEY).",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
limit: { type: "number", description: "Max items (default 25, max 100)" },
|
|
15
|
+
cursor: { type: "string", description: "Pagination cursor from previous response" },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const InputSchema = zod_1.z.object({
|
|
20
|
+
limit: zod_1.z.number().min(1).max(100).optional(),
|
|
21
|
+
cursor: zod_1.z.string().optional(),
|
|
22
|
+
});
|
|
23
|
+
async function handleListWithdrawals(args, config) {
|
|
24
|
+
const input = InputSchema.parse(args);
|
|
25
|
+
if (!config.apiKey) {
|
|
26
|
+
throw new Error("Missing ONELY_API_KEY for listing withdrawals");
|
|
27
|
+
}
|
|
28
|
+
const url = new URL(`${config.apiBase}/api/v1/withdrawals`);
|
|
29
|
+
if (input.limit)
|
|
30
|
+
url.searchParams.set("limit", String(input.limit));
|
|
31
|
+
if (input.cursor)
|
|
32
|
+
url.searchParams.set("cursor", input.cursor);
|
|
33
|
+
const res = await (0, http_js_1.fetchWithTimeout)(url.toString(), {
|
|
34
|
+
method: "GET",
|
|
35
|
+
headers: {
|
|
36
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
await (0, http_js_1.assertOk)(res, "List withdrawals failed");
|
|
40
|
+
const data = await res.json();
|
|
41
|
+
return (0, mcp_js_1.mcpOk)(data);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=list-withdrawals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-withdrawals.js","sourceRoot":"","sources":["../../src/tools/list-withdrawals.ts"],"names":[],"mappings":";;;AAsBA,sDAoBC;AA1CD,6BAAwB;AAExB,wCAAwD;AACxD,sCAAkC;AAErB,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,mEAAmE;IAChF,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iCAAiC,EAAE;YACzE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CAA0C,EAAE;SACpF;KACF;CACF,CAAC;AAEF,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC5C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEI,KAAK,UAAU,qBAAqB,CAAC,IAAa,EAAE,MAAc;IACvE,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;IAC5D,IAAI,KAAK,CAAC,KAAK;QAAE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACpE,IAAI,KAAK,CAAC,MAAM;QAAE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE/D,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAgB,EAAC,GAAG,CAAC,QAAQ,EAAE,EAAE;QACjD,MAAM,EAAE,KAAK;QACb,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE;SACzC;KACF,CAAC,CAAC;IAEH,MAAM,IAAA,kBAAQ,EAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,OAAO,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Config } from "../config.js";
|
|
2
|
+
export declare const updateAvatarTool: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
avatarUrl: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
imageBase64: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
mimeType: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
filename: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare function handleUpdateAvatar(args: unknown, config: Config): Promise<{
|
|
28
|
+
isError?: true | undefined;
|
|
29
|
+
content: {
|
|
30
|
+
type: "text";
|
|
31
|
+
text: string;
|
|
32
|
+
}[];
|
|
33
|
+
}>;
|
|
34
|
+
//# sourceMappingURL=update-avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-avatar.d.ts","sourceRoot":"","sources":["../../src/tools/update-avatar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;CAY5B,CAAC;AASF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;;;;;;GAyCrE"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateAvatarTool = void 0;
|
|
4
|
+
exports.handleUpdateAvatar = handleUpdateAvatar;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const http_js_1 = require("../http.js");
|
|
7
|
+
const mcp_js_1 = require("../mcp.js");
|
|
8
|
+
exports.updateAvatarTool = {
|
|
9
|
+
name: "1ly_update_avatar",
|
|
10
|
+
description: "Update your store avatar image (requires ONELY_API_KEY).",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
avatarUrl: { type: "string", description: "Public image URL to use as avatar" },
|
|
15
|
+
imageBase64: { type: "string", description: "Base64-encoded image bytes" },
|
|
16
|
+
mimeType: { type: "string", description: "Image MIME type (image/png, image/jpeg, image/webp, image/gif)" },
|
|
17
|
+
filename: { type: "string", description: "Optional filename (default: avatar.png)" },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
const InputSchema = zod_1.z.object({
|
|
22
|
+
avatarUrl: zod_1.z.string().url().optional(),
|
|
23
|
+
imageBase64: zod_1.z.string().min(1).optional(),
|
|
24
|
+
mimeType: zod_1.z.string().min(3).optional(),
|
|
25
|
+
filename: zod_1.z.string().optional(),
|
|
26
|
+
});
|
|
27
|
+
async function handleUpdateAvatar(args, config) {
|
|
28
|
+
const input = InputSchema.parse(args);
|
|
29
|
+
if (!config.apiKey) {
|
|
30
|
+
throw new Error("Missing ONELY_API_KEY for updating avatar");
|
|
31
|
+
}
|
|
32
|
+
if (input.avatarUrl) {
|
|
33
|
+
const res = await (0, http_js_1.fetchWithTimeout)(`${config.apiBase}/api/v1/avatar`, {
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: {
|
|
36
|
+
"Content-Type": "application/json",
|
|
37
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
38
|
+
},
|
|
39
|
+
body: JSON.stringify({ avatarUrl: input.avatarUrl }),
|
|
40
|
+
});
|
|
41
|
+
await (0, http_js_1.assertOk)(res, "Update avatar failed");
|
|
42
|
+
const data = await res.json();
|
|
43
|
+
return (0, mcp_js_1.mcpOk)(data);
|
|
44
|
+
}
|
|
45
|
+
if (!input.imageBase64 || !input.mimeType) {
|
|
46
|
+
throw new Error("Provide either avatarUrl or imageBase64 + mimeType");
|
|
47
|
+
}
|
|
48
|
+
const buffer = Buffer.from(input.imageBase64, "base64");
|
|
49
|
+
const blob = new Blob([buffer], { type: input.mimeType });
|
|
50
|
+
const formData = new FormData();
|
|
51
|
+
formData.append("file", blob, input.filename || "avatar.png");
|
|
52
|
+
const res = await (0, http_js_1.fetchWithTimeout)(`${config.apiBase}/api/v1/avatar`, {
|
|
53
|
+
method: "POST",
|
|
54
|
+
headers: {
|
|
55
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
56
|
+
},
|
|
57
|
+
body: formData,
|
|
58
|
+
});
|
|
59
|
+
await (0, http_js_1.assertOk)(res, "Update avatar failed");
|
|
60
|
+
const data = await res.json();
|
|
61
|
+
return (0, mcp_js_1.mcpOk)(data);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=update-avatar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-avatar.js","sourceRoot":"","sources":["../../src/tools/update-avatar.ts"],"names":[],"mappings":";;;AA0BA,gDAyCC;AAnED,6BAAwB;AAExB,wCAAwD;AACxD,sCAAkC;AAErB,QAAA,gBAAgB,GAAG;IAC9B,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,0DAA0D;IACvE,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mCAAmC,EAAE;YAC/E,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;YAC1E,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gEAAgE,EAAE;YAC3G,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;SACrF;KACF;CACF,CAAC;AAEF,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACzC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CA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;IAC1D,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,QAAQ,IAAI,YAAY,CAAC,CAAC;IAE9D,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAgB,EAAC,GAAG,MAAM,CAAC,OAAO,gBAAgB,EAAE;QACpE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE;SACzC;QACD,IAAI,EAAE,QAAQ;KACf,CAAC,CAAC;IAEH,MAAM,IAAA,kBAAQ,EAAC,GAAG,EAAE,sBAAsB,CAAC,CAAC;IAC5C,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,OAAO,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-link.d.ts","sourceRoot":"","sources":["../../src/tools/update-link.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"update-link.d.ts","sourceRoot":"","sources":["../../src/tools/update-link.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkB1B,CAAC;AAcF,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;;;;;;GA2BnE"}
|
|
@@ -19,6 +19,7 @@ exports.updateLinkTool = {
|
|
|
19
19
|
price: { type: "string" },
|
|
20
20
|
isPublic: { type: "boolean" },
|
|
21
21
|
isStealth: { type: "boolean" },
|
|
22
|
+
webhookUrl: { type: "string" },
|
|
22
23
|
},
|
|
23
24
|
required: ["id"],
|
|
24
25
|
},
|
|
@@ -32,6 +33,7 @@ const InputSchema = zod_1.z.object({
|
|
|
32
33
|
price: zod_1.z.string().regex(/^\d+(\.\d{1,18})?$/).optional(),
|
|
33
34
|
isPublic: zod_1.z.boolean().optional(),
|
|
34
35
|
isStealth: zod_1.z.boolean().optional(),
|
|
36
|
+
webhookUrl: zod_1.z.string().url().optional().nullable(),
|
|
35
37
|
});
|
|
36
38
|
async function handleUpdateLink(args, config) {
|
|
37
39
|
const input = InputSchema.parse(args);
|
|
@@ -52,6 +54,7 @@ async function handleUpdateLink(args, config) {
|
|
|
52
54
|
price: input.price,
|
|
53
55
|
isPublic: input.isPublic,
|
|
54
56
|
isStealth: input.isStealth,
|
|
57
|
+
webhookUrl: input.webhookUrl,
|
|
55
58
|
}),
|
|
56
59
|
});
|
|
57
60
|
await (0, http_js_1.assertOk)(res, "Update link failed");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-link.js","sourceRoot":"","sources":["../../src/tools/update-link.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"update-link.js","sourceRoot":"","sources":["../../src/tools/update-link.ts"],"names":[],"mappings":";;;AAqCA,4CA2BC;AAhED,6BAAwB;AAExB,wCAAwD;AACxD,sCAAkC;AAErB,QAAA,cAAc,GAAG;IAC5B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,oDAAoD;IACjE,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACtB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACvB,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC/B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACxB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAA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AAC;IACtC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAgB,EAAC,GAAG,MAAM,CAAC,OAAO,iBAAiB,KAAK,CAAC,EAAE,EAAE,EAAE;QAC/E,MAAM,EAAE,OAAO;QACf,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE;SACzC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B,CAAC;KACH,CAAC,CAAC;IAEH,MAAM,IAAA,kBAAQ,EAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,OAAO,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Config } from "../config.js";
|
|
2
|
+
export declare const updateProfileTool: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
username: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
displayName: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
bio: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare function handleUpdateProfile(args: unknown, config: Config): Promise<{
|
|
24
|
+
isError?: true | undefined;
|
|
25
|
+
content: {
|
|
26
|
+
type: "text";
|
|
27
|
+
text: string;
|
|
28
|
+
}[];
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=update-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-profile.d.ts","sourceRoot":"","sources":["../../src/tools/update-profile.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;CAW7B,CAAC;AAQF,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;;;;;;GAkBtE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateProfileTool = void 0;
|
|
4
|
+
exports.handleUpdateProfile = handleUpdateProfile;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const http_js_1 = require("../http.js");
|
|
7
|
+
const mcp_js_1 = require("../mcp.js");
|
|
8
|
+
exports.updateProfileTool = {
|
|
9
|
+
name: "1ly_update_profile",
|
|
10
|
+
description: "Update basic store profile details (requires ONELY_API_KEY).",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
username: { type: "string", description: "New username (lowercase, underscores)" },
|
|
15
|
+
displayName: { type: "string", description: "Public display name" },
|
|
16
|
+
bio: { type: "string", description: "Short bio (max 160 chars)" },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const InputSchema = zod_1.z.object({
|
|
21
|
+
username: zod_1.z.string().min(3).max(32).regex(/^[a-z0-9_]+$/).optional(),
|
|
22
|
+
displayName: zod_1.z.string().max(50).optional(),
|
|
23
|
+
bio: zod_1.z.string().max(160).optional(),
|
|
24
|
+
});
|
|
25
|
+
async function handleUpdateProfile(args, config) {
|
|
26
|
+
const input = InputSchema.parse(args);
|
|
27
|
+
if (!config.apiKey) {
|
|
28
|
+
throw new Error("Missing ONELY_API_KEY for updating profile");
|
|
29
|
+
}
|
|
30
|
+
const res = await (0, http_js_1.fetchWithTimeout)(`${config.apiBase}/api/v1/profile`, {
|
|
31
|
+
method: "PATCH",
|
|
32
|
+
headers: {
|
|
33
|
+
"Content-Type": "application/json",
|
|
34
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
35
|
+
},
|
|
36
|
+
body: JSON.stringify(input),
|
|
37
|
+
});
|
|
38
|
+
await (0, http_js_1.assertOk)(res, "Update profile failed");
|
|
39
|
+
const data = await res.json();
|
|
40
|
+
return (0, mcp_js_1.mcpOk)(data);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=update-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-profile.js","sourceRoot":"","sources":["../../src/tools/update-profile.ts"],"names":[],"mappings":";;;AAwBA,kDAkBC;AA1CD,6BAAwB;AAExB,wCAAwD;AACxD,sCAAkC;AAErB,QAAA,iBAAiB,GAAG;IAC/B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,8DAA8D;IAC3E,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE;YAClF,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;YACnE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE;SAClE;KACF;C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
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
socials: {
|
|
9
|
+
type: string;
|
|
10
|
+
items: {
|
|
11
|
+
type: string;
|
|
12
|
+
properties: {
|
|
13
|
+
type: {
|
|
14
|
+
type: string;
|
|
15
|
+
enum: string[];
|
|
16
|
+
};
|
|
17
|
+
url: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
displayOrder: {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
isVisible: {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
required: string[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
required: string[];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export declare function handleUpdateSocials(args: unknown, config: Config): Promise<{
|
|
35
|
+
isError?: true | undefined;
|
|
36
|
+
content: {
|
|
37
|
+
type: "text";
|
|
38
|
+
text: string;
|
|
39
|
+
}[];
|
|
40
|
+
}>;
|
|
41
|
+
//# sourceMappingURL=update-socials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-socials.d.ts","sourceRoot":"","sources":["../../src/tools/update-socials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC7B,CAAC;AA2BF,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;;;;;;GAkBtE"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateSocialsTool = void 0;
|
|
4
|
+
exports.handleUpdateSocials = handleUpdateSocials;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const http_js_1 = require("../http.js");
|
|
7
|
+
const mcp_js_1 = require("../mcp.js");
|
|
8
|
+
exports.updateSocialsTool = {
|
|
9
|
+
name: "1ly_update_socials",
|
|
10
|
+
description: "Update socials for your store (requires ONELY_API_KEY).",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
socials: {
|
|
15
|
+
type: "array",
|
|
16
|
+
items: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
type: {
|
|
20
|
+
type: "string",
|
|
21
|
+
enum: [
|
|
22
|
+
"x",
|
|
23
|
+
"github",
|
|
24
|
+
"telegram",
|
|
25
|
+
"web3_bio",
|
|
26
|
+
"website",
|
|
27
|
+
"youtube",
|
|
28
|
+
"linkedin",
|
|
29
|
+
"discord",
|
|
30
|
+
"facebook",
|
|
31
|
+
"tiktok",
|
|
32
|
+
"instagram",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
url: { type: "string" },
|
|
36
|
+
displayOrder: { type: "number" },
|
|
37
|
+
isVisible: { type: "boolean" },
|
|
38
|
+
},
|
|
39
|
+
required: ["type", "url"],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
required: ["socials"],
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
const socialTypeEnum = zod_1.z.enum([
|
|
47
|
+
"x",
|
|
48
|
+
"github",
|
|
49
|
+
"telegram",
|
|
50
|
+
"web3_bio",
|
|
51
|
+
"website",
|
|
52
|
+
"youtube",
|
|
53
|
+
"linkedin",
|
|
54
|
+
"discord",
|
|
55
|
+
"facebook",
|
|
56
|
+
"tiktok",
|
|
57
|
+
"instagram",
|
|
58
|
+
]);
|
|
59
|
+
const socialSchema = zod_1.z.object({
|
|
60
|
+
type: socialTypeEnum,
|
|
61
|
+
url: zod_1.z.string().url(),
|
|
62
|
+
displayOrder: zod_1.z.number().min(0).max(50).optional(),
|
|
63
|
+
isVisible: zod_1.z.boolean().optional(),
|
|
64
|
+
});
|
|
65
|
+
const InputSchema = zod_1.z.object({
|
|
66
|
+
socials: zod_1.z.array(socialSchema).max(10),
|
|
67
|
+
});
|
|
68
|
+
async function handleUpdateSocials(args, config) {
|
|
69
|
+
const input = InputSchema.parse(args);
|
|
70
|
+
if (!config.apiKey) {
|
|
71
|
+
throw new Error("Missing ONELY_API_KEY for updating socials");
|
|
72
|
+
}
|
|
73
|
+
const res = await (0, http_js_1.fetchWithTimeout)(`${config.apiBase}/api/v1/socials`, {
|
|
74
|
+
method: "POST",
|
|
75
|
+
headers: {
|
|
76
|
+
"Content-Type": "application/json",
|
|
77
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
78
|
+
},
|
|
79
|
+
body: JSON.stringify({ socials: input.socials }),
|
|
80
|
+
});
|
|
81
|
+
await (0, http_js_1.assertOk)(res, "Update socials failed");
|
|
82
|
+
const data = await res.json();
|
|
83
|
+
return (0, mcp_js_1.mcpOk)(data);
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=update-socials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-socials.js","sourceRoot":"","sources":["../../src/tools/update-socials.ts"],"names":[],"mappings":";;;AAqEA,kDAkBC;AAvFD,6BAAwB;AAExB,wCAAwD;AACxD,sCAAkC;AAErB,QAAA,iBAAiB,GAAG;IAC/B,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,yDAAyD;IACtE,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,IAAI,EAAE;4BACJ,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE;gCACJ,GAAG;gCACH,QAAQ;gCACR,UAAU;gCACV,UAAU;gCACV,SAAS;gCACT,SAAS;gCACT,UAAU;gCACV,SAAS;gC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ED,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAgB,EAAC,GAAG,MAAM,CAAC,OAAO,iBAAiB,EAAE;QACrE,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE;SACzC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;KACjD,CAAC,CAAC;IAEH,MAAM,IAAA,kBAAQ,EAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,OAAO,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Config } from "../config.js";
|
|
2
|
+
export declare const withdrawTool: {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object";
|
|
7
|
+
properties: {
|
|
8
|
+
amount: {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
walletAddress: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
required: string[];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare function handleWithdraw(args: unknown, config: Config): Promise<{
|
|
21
|
+
isError?: true | undefined;
|
|
22
|
+
content: {
|
|
23
|
+
type: "text";
|
|
24
|
+
text: string;
|
|
25
|
+
}[];
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=withdraw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../../src/tools/withdraw.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;CAWxB,CAAC;AAOF,wBAAsB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;;;;;;GAsBjE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withdrawTool = void 0;
|
|
4
|
+
exports.handleWithdraw = handleWithdraw;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const http_js_1 = require("../http.js");
|
|
7
|
+
const mcp_js_1 = require("../mcp.js");
|
|
8
|
+
exports.withdrawTool = {
|
|
9
|
+
name: "1ly_withdraw",
|
|
10
|
+
description: "Request a withdrawal of your available balance to a Solana wallet (requires ONELY_API_KEY).",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
amount: { type: "string", description: "Amount in USDC (e.g. '1.25')" },
|
|
15
|
+
walletAddress: { type: "string", description: "Solana wallet address to receive funds" },
|
|
16
|
+
},
|
|
17
|
+
required: ["amount", "walletAddress"],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const InputSchema = zod_1.z.object({
|
|
21
|
+
amount: zod_1.z.string().regex(/^\d+(\.\d{1,18})?$/),
|
|
22
|
+
walletAddress: zod_1.z.string().min(26),
|
|
23
|
+
});
|
|
24
|
+
async function handleWithdraw(args, config) {
|
|
25
|
+
const input = InputSchema.parse(args);
|
|
26
|
+
if (!config.apiKey) {
|
|
27
|
+
throw new Error("Missing ONELY_API_KEY for withdrawals");
|
|
28
|
+
}
|
|
29
|
+
const res = await (0, http_js_1.fetchWithTimeout)(`${config.apiBase}/api/v1/withdrawals`, {
|
|
30
|
+
method: "POST",
|
|
31
|
+
headers: {
|
|
32
|
+
"Content-Type": "application/json",
|
|
33
|
+
Authorization: `Bearer ${config.apiKey}`,
|
|
34
|
+
},
|
|
35
|
+
body: JSON.stringify({
|
|
36
|
+
amount: input.amount,
|
|
37
|
+
walletAddress: input.walletAddress,
|
|
38
|
+
chain: "solana",
|
|
39
|
+
}),
|
|
40
|
+
});
|
|
41
|
+
await (0, http_js_1.assertOk)(res, "Withdraw request failed");
|
|
42
|
+
const data = await res.json();
|
|
43
|
+
return (0, mcp_js_1.mcpOk)(data);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=withdraw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withdraw.js","sourceRoot":"","sources":["../../src/tools/withdraw.ts"],"names":[],"mappings":";;;AAuBA,wCAsBC;AA7CD,6BAAwB;AAExB,wCAAwD;AACxD,sCAAkC;AAErB,QAAA,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,6FAA6F;IAC1G,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;YACvE,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;SACzF;QACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,eAAe,CAAC;KACtC;CACF,CAAC;AAEF,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,oBAAoB,CAAC;IAC9C,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;CAClC,CAAC,CAAC;AAEI,KAAK,UAAU,cAAc,CAAC,IAAa,EAAE,MAAc;IAChE,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CA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