@opentabs-dev/opentabs-plugin-coinbase 0.0.74
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 +159 -0
- package/dist/adapter.iife.js +15111 -0
- package/dist/adapter.iife.js.map +7 -0
- package/dist/coinbase-api.d.ts +14 -0
- package/dist/coinbase-api.d.ts.map +1 -0
- package/dist/coinbase-api.js +74 -0
- package/dist/coinbase-api.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +64 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/add-watchlist-item.d.ts +8 -0
- package/dist/tools/add-watchlist-item.d.ts.map +1 -0
- package/dist/tools/add-watchlist-item.js +33 -0
- package/dist/tools/add-watchlist-item.js.map +1 -0
- package/dist/tools/compare-asset-prices.d.ts +17 -0
- package/dist/tools/compare-asset-prices.d.ts.map +1 -0
- package/dist/tools/compare-asset-prices.js +47 -0
- package/dist/tools/compare-asset-prices.js.map +1 -0
- package/dist/tools/create-price-alert.d.ts +12 -0
- package/dist/tools/create-price-alert.d.ts.map +1 -0
- package/dist/tools/create-price-alert.js +37 -0
- package/dist/tools/create-price-alert.js.map +1 -0
- package/dist/tools/create-watchlist.d.ts +7 -0
- package/dist/tools/create-watchlist.d.ts.map +1 -0
- package/dist/tools/create-watchlist.js +27 -0
- package/dist/tools/create-watchlist.js.map +1 -0
- package/dist/tools/delete-price-alert.d.ts +7 -0
- package/dist/tools/delete-price-alert.d.ts.map +1 -0
- package/dist/tools/delete-price-alert.js +29 -0
- package/dist/tools/delete-price-alert.js.map +1 -0
- package/dist/tools/delete-watchlist.d.ts +7 -0
- package/dist/tools/delete-watchlist.d.ts.map +1 -0
- package/dist/tools/delete-watchlist.js +27 -0
- package/dist/tools/delete-watchlist.js.map +1 -0
- package/dist/tools/get-asset-by-slug.d.ts +27 -0
- package/dist/tools/get-asset-by-slug.d.ts.map +1 -0
- package/dist/tools/get-asset-by-slug.js +39 -0
- package/dist/tools/get-asset-by-slug.js.map +1 -0
- package/dist/tools/get-asset-by-symbol.d.ts +27 -0
- package/dist/tools/get-asset-by-symbol.d.ts.map +1 -0
- package/dist/tools/get-asset-by-symbol.js +39 -0
- package/dist/tools/get-asset-by-symbol.js.map +1 -0
- package/dist/tools/get-asset-by-uuid.d.ts +38 -0
- package/dist/tools/get-asset-by-uuid.d.ts.map +1 -0
- package/dist/tools/get-asset-by-uuid.js +45 -0
- package/dist/tools/get-asset-by-uuid.js.map +1 -0
- package/dist/tools/get-asset-categories.d.ts +12 -0
- package/dist/tools/get-asset-categories.d.ts.map +1 -0
- package/dist/tools/get-asset-categories.js +30 -0
- package/dist/tools/get-asset-categories.js.map +1 -0
- package/dist/tools/get-asset-networks.d.ts +13 -0
- package/dist/tools/get-asset-networks.d.ts.map +1 -0
- package/dist/tools/get-asset-networks.js +36 -0
- package/dist/tools/get-asset-networks.js.map +1 -0
- package/dist/tools/get-asset-price.d.ts +14 -0
- package/dist/tools/get-asset-price.d.ts.map +1 -0
- package/dist/tools/get-asset-price.js +40 -0
- package/dist/tools/get-asset-price.js.map +1 -0
- package/dist/tools/get-current-user.d.ts +14 -0
- package/dist/tools/get-current-user.d.ts.map +1 -0
- package/dist/tools/get-current-user.js +27 -0
- package/dist/tools/get-current-user.js.map +1 -0
- package/dist/tools/list-portfolios.d.ts +9 -0
- package/dist/tools/list-portfolios.d.ts.map +1 -0
- package/dist/tools/list-portfolios.js +26 -0
- package/dist/tools/list-portfolios.js.map +1 -0
- package/dist/tools/list-price-alerts.d.ts +14 -0
- package/dist/tools/list-price-alerts.d.ts.map +1 -0
- package/dist/tools/list-price-alerts.js +42 -0
- package/dist/tools/list-price-alerts.js.map +1 -0
- package/dist/tools/list-watchlists.d.ts +14 -0
- package/dist/tools/list-watchlists.d.ts.map +1 -0
- package/dist/tools/list-watchlists.js +34 -0
- package/dist/tools/list-watchlists.js.map +1 -0
- package/dist/tools/remove-watchlist-item.d.ts +8 -0
- package/dist/tools/remove-watchlist-item.d.ts.map +1 -0
- package/dist/tools/remove-watchlist-item.js +33 -0
- package/dist/tools/remove-watchlist-item.js.map +1 -0
- package/dist/tools/schemas.d.ts +220 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +171 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools.json +1272 -0
- package/package.json +55 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { gql } from '../coinbase-api.js';
|
|
4
|
+
import { assetSchema, latestPriceSchema, mapAsset, mapLatestPrice, } from './schemas.js';
|
|
5
|
+
const QUERY = `query GetAssetBySymbol($symbol: String!, $quoteCurrency: TickerSymbol!) {
|
|
6
|
+
assetBySymbol(symbol: $symbol) {
|
|
7
|
+
uuid name symbol slug description color imageUrl
|
|
8
|
+
circulatingSupply maxSupply marketCap volume24h allTimeHigh unitPriceScale
|
|
9
|
+
latestPrice(quoteCurrency: $quoteCurrency) { price timestamp quoteCurrency }
|
|
10
|
+
}
|
|
11
|
+
}`;
|
|
12
|
+
export const getAssetBySymbol = defineTool({
|
|
13
|
+
name: 'get_asset_by_symbol',
|
|
14
|
+
displayName: 'Get Asset by Symbol',
|
|
15
|
+
description: 'Get detailed information about a cryptocurrency asset by its ticker symbol (e.g. "BTC", "ETH", "SOL"). Returns market data and current price.',
|
|
16
|
+
summary: 'Get asset details by ticker symbol',
|
|
17
|
+
icon: 'circle-dollar-sign',
|
|
18
|
+
group: 'Assets',
|
|
19
|
+
input: z.object({
|
|
20
|
+
symbol: z.string().describe('Ticker symbol (e.g. "BTC", "ETH", "SOL", "DOGE")'),
|
|
21
|
+
quote_currency: z.string().optional().describe('Quote currency for price (default "USD")'),
|
|
22
|
+
}),
|
|
23
|
+
output: z.object({
|
|
24
|
+
asset: assetSchema,
|
|
25
|
+
latest_price: latestPriceSchema,
|
|
26
|
+
}),
|
|
27
|
+
handle: async (params) => {
|
|
28
|
+
const data = await gql(QUERY, {
|
|
29
|
+
symbol: params.symbol,
|
|
30
|
+
quoteCurrency: params.quote_currency ?? 'USD',
|
|
31
|
+
});
|
|
32
|
+
const a = data.assetBySymbol;
|
|
33
|
+
return {
|
|
34
|
+
asset: mapAsset(a),
|
|
35
|
+
latest_price: mapLatestPrice(a.latestPrice ?? {}),
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=get-asset-by-symbol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-asset-by-symbol.js","sourceRoot":"","sources":["../../src/tools/get-asset-by-symbol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAGL,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,MAAM,KAAK,GAAG;;;;;;EAMZ,CAAC;AAMH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACzC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EACT,+IAA+I;IACjJ,OAAO,EAAE,oCAAoC;IAC7C,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;QAC/E,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;KAC3F,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,WAAW;QAClB,YAAY,EAAE,iBAAiB;KAChC,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAW,KAAK,EAAE;YACtC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,aAAa,EAAE,MAAM,CAAC,cAAc,IAAI,KAAK;SAC9C,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC;QAC7B,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;YAClB,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,WAAW,IAAI,EAAE,CAAC;SAClD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getAssetByUuid: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
uuid: z.ZodString;
|
|
4
|
+
quote_currency: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
asset: z.ZodObject<{
|
|
7
|
+
uuid: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
symbol: z.ZodString;
|
|
10
|
+
slug: z.ZodString;
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
color: z.ZodString;
|
|
13
|
+
image_url: z.ZodString;
|
|
14
|
+
circulating_supply: z.ZodString;
|
|
15
|
+
max_supply: z.ZodString;
|
|
16
|
+
market_cap: z.ZodString;
|
|
17
|
+
volume_24h: z.ZodString;
|
|
18
|
+
all_time_high: z.ZodString;
|
|
19
|
+
unit_price_scale: z.ZodNumber;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
latest_price: z.ZodObject<{
|
|
22
|
+
price: z.ZodString;
|
|
23
|
+
timestamp: z.ZodString;
|
|
24
|
+
quote_currency: z.ZodString;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
27
|
+
uuid: z.ZodString;
|
|
28
|
+
name: z.ZodString;
|
|
29
|
+
slug: z.ZodString;
|
|
30
|
+
description: z.ZodString;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
networks: z.ZodArray<z.ZodObject<{
|
|
33
|
+
display_name: z.ZodString;
|
|
34
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
35
|
+
contract_address: z.ZodNullable<z.ZodString>;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
//# sourceMappingURL=get-asset-by-uuid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-asset-by-uuid.d.ts","sourceRoot":"","sources":["../../src/tools/get-asset-by-uuid.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmCxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+BzB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { gql } from '../coinbase-api.js';
|
|
4
|
+
import { assetCategorySchema, assetNetworkSchema, assetSchema, latestPriceSchema, mapAsset, mapAssetCategory, mapAssetNetwork, mapLatestPrice, } from './schemas.js';
|
|
5
|
+
const QUERY = `query GetAssetByUuid($uuid: Uuid!, $quoteCurrency: TickerSymbol!) {
|
|
6
|
+
assetByUuid(uuid: $uuid) {
|
|
7
|
+
uuid name symbol slug description color imageUrl
|
|
8
|
+
circulatingSupply maxSupply marketCap volume24h allTimeHigh unitPriceScale
|
|
9
|
+
latestPrice(quoteCurrency: $quoteCurrency) { price timestamp quoteCurrency }
|
|
10
|
+
categories { uuid name slug description }
|
|
11
|
+
networks { displayName chainId contractAddress }
|
|
12
|
+
}
|
|
13
|
+
}`;
|
|
14
|
+
export const getAssetByUuid = defineTool({
|
|
15
|
+
name: 'get_asset_by_uuid',
|
|
16
|
+
displayName: 'Get Asset by UUID',
|
|
17
|
+
description: 'Get detailed information about a cryptocurrency asset by its Coinbase UUID. Returns market data, price, categories, and supported networks.',
|
|
18
|
+
summary: 'Get asset details by UUID',
|
|
19
|
+
icon: 'circle-dollar-sign',
|
|
20
|
+
group: 'Assets',
|
|
21
|
+
input: z.object({
|
|
22
|
+
uuid: z.string().describe('Asset UUID (e.g. "5b71fc48-3dd3-540c-809b-f8c94d0e68b5" for Bitcoin)'),
|
|
23
|
+
quote_currency: z.string().optional().describe('Quote currency for price (default "USD")'),
|
|
24
|
+
}),
|
|
25
|
+
output: z.object({
|
|
26
|
+
asset: assetSchema,
|
|
27
|
+
latest_price: latestPriceSchema,
|
|
28
|
+
categories: z.array(assetCategorySchema).describe('Asset categories'),
|
|
29
|
+
networks: z.array(assetNetworkSchema).describe('Supported blockchain networks'),
|
|
30
|
+
}),
|
|
31
|
+
handle: async (params) => {
|
|
32
|
+
const data = await gql(QUERY, {
|
|
33
|
+
uuid: params.uuid,
|
|
34
|
+
quoteCurrency: params.quote_currency ?? 'USD',
|
|
35
|
+
});
|
|
36
|
+
const a = data.assetByUuid;
|
|
37
|
+
return {
|
|
38
|
+
asset: mapAsset(a),
|
|
39
|
+
latest_price: mapLatestPrice(a.latestPrice ?? {}),
|
|
40
|
+
categories: (a.categories ?? []).map(mapAssetCategory),
|
|
41
|
+
networks: (a.networks ?? []).map(mapAssetNetwork),
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=get-asset-by-uuid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-asset-by-uuid.js","sourceRoot":"","sources":["../../src/tools/get-asset-by-uuid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAKL,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,MAAM,KAAK,GAAG;;;;;;;;EAQZ,CAAC;AAUH,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EACT,6IAA6I;IAC/I,OAAO,EAAE,2BAA2B;IACpC,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sEAAsE,CAAC;QACjG,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;KAC3F,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,WAAW;QAClB,YAAY,EAAE,iBAAiB;QAC/B,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QACrE,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC;KAChF,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAW,KAAK,EAAE;YACtC,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,aAAa,EAAE,MAAM,CAAC,cAAc,IAAI,KAAK;SAC9C,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;QAC3B,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;YAClB,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,WAAW,IAAI,EAAE,CAAC;YACjD,UAAU,EAAE,CAAC,CAAC,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC;YACtD,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC;SAClD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getAssetCategories: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
uuid: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
categories: z.ZodArray<z.ZodObject<{
|
|
6
|
+
uuid: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
slug: z.ZodString;
|
|
9
|
+
description: z.ZodString;
|
|
10
|
+
}, z.core.$strip>>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
//# sourceMappingURL=get-asset-categories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-asset-categories.d.ts","sourceRoot":"","sources":["../../src/tools/get-asset-categories.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,kBAAkB;;;;;;;;;kBAoB7B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { gql } from '../coinbase-api.js';
|
|
4
|
+
import { assetCategorySchema, mapAssetCategory } from './schemas.js';
|
|
5
|
+
const QUERY = `query GetAssetCategories($uuid: Uuid!) {
|
|
6
|
+
assetByUuid(uuid: $uuid) {
|
|
7
|
+
categories { uuid name slug description }
|
|
8
|
+
}
|
|
9
|
+
}`;
|
|
10
|
+
export const getAssetCategories = defineTool({
|
|
11
|
+
name: 'get_asset_categories',
|
|
12
|
+
displayName: 'Get Asset Categories',
|
|
13
|
+
description: 'Get the categories that a cryptocurrency asset belongs to (e.g. "Currencies", "DeFi", "Layer 2"). Use get_asset_by_symbol to find the asset UUID first.',
|
|
14
|
+
summary: 'Get categories for an asset',
|
|
15
|
+
icon: 'tag',
|
|
16
|
+
group: 'Assets',
|
|
17
|
+
input: z.object({
|
|
18
|
+
uuid: z.string().describe('Asset UUID'),
|
|
19
|
+
}),
|
|
20
|
+
output: z.object({
|
|
21
|
+
categories: z.array(assetCategorySchema).describe('Categories the asset belongs to'),
|
|
22
|
+
}),
|
|
23
|
+
handle: async (params) => {
|
|
24
|
+
const data = await gql(QUERY, { uuid: params.uuid });
|
|
25
|
+
return {
|
|
26
|
+
categories: (data.assetByUuid.categories ?? []).map(mapAssetCategory),
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=get-asset-categories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-asset-categories.js","sourceRoot":"","sources":["../../src/tools/get-asset-categories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAyB,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE5F,MAAM,KAAK,GAAG;;;;EAIZ,CAAC;AAMH,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;IAC3C,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EACT,yJAAyJ;IAC3J,OAAO,EAAE,6BAA6B;IACtC,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;KACxC,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,iCAAiC,CAAC;KACrF,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAW,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/D,OAAO;YACL,UAAU,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC;SACtE,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getAssetNetworks: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
uuid: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
asset_name: z.ZodString;
|
|
6
|
+
asset_symbol: z.ZodString;
|
|
7
|
+
networks: z.ZodArray<z.ZodObject<{
|
|
8
|
+
display_name: z.ZodString;
|
|
9
|
+
chain_id: z.ZodNullable<z.ZodNumber>;
|
|
10
|
+
contract_address: z.ZodNullable<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
//# sourceMappingURL=get-asset-networks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-asset-networks.d.ts","sourceRoot":"","sources":["../../src/tools/get-asset-networks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,gBAAgB;;;;;;;;;;kBAyB3B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { gql } from '../coinbase-api.js';
|
|
4
|
+
import { assetNetworkSchema, mapAssetNetwork } from './schemas.js';
|
|
5
|
+
const QUERY = `query GetAssetNetworks($uuid: Uuid!) {
|
|
6
|
+
assetByUuid(uuid: $uuid) {
|
|
7
|
+
name symbol
|
|
8
|
+
networks { displayName chainId contractAddress }
|
|
9
|
+
}
|
|
10
|
+
}`;
|
|
11
|
+
export const getAssetNetworks = defineTool({
|
|
12
|
+
name: 'get_asset_networks',
|
|
13
|
+
displayName: 'Get Asset Networks',
|
|
14
|
+
description: 'Get the blockchain networks that support a cryptocurrency asset, including network name, EVM chain ID, and token contract address. Useful for identifying which chains an asset can be sent/received on.',
|
|
15
|
+
summary: 'Get supported networks for an asset',
|
|
16
|
+
icon: 'network',
|
|
17
|
+
group: 'Assets',
|
|
18
|
+
input: z.object({
|
|
19
|
+
uuid: z.string().describe('Asset UUID'),
|
|
20
|
+
}),
|
|
21
|
+
output: z.object({
|
|
22
|
+
asset_name: z.string().describe('Asset name'),
|
|
23
|
+
asset_symbol: z.string().describe('Ticker symbol'),
|
|
24
|
+
networks: z.array(assetNetworkSchema).describe('Supported blockchain networks'),
|
|
25
|
+
}),
|
|
26
|
+
handle: async (params) => {
|
|
27
|
+
const data = await gql(QUERY, { uuid: params.uuid });
|
|
28
|
+
const a = data.assetByUuid;
|
|
29
|
+
return {
|
|
30
|
+
asset_name: a.name ?? '',
|
|
31
|
+
asset_symbol: a.symbol ?? '',
|
|
32
|
+
networks: (a.networks ?? []).map(mapAssetNetwork),
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=get-asset-networks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-asset-networks.js","sourceRoot":"","sources":["../../src/tools/get-asset-networks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAwB,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEzF,MAAM,KAAK,GAAG;;;;;EAKZ,CAAC;AAUH,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACzC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EACT,0MAA0M;IAC5M,OAAO,EAAE,qCAAqC;IAC9C,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;KACxC,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC7C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;QAClD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC;KAChF,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAW,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC/D,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;QAC3B,OAAO;YACL,UAAU,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;YACxB,YAAY,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;YAC5B,QAAQ,EAAE,CAAC,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC;SAClD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getAssetPrice: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
uuid: z.ZodString;
|
|
4
|
+
quote_currency: z.ZodOptional<z.ZodString>;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
symbol: z.ZodString;
|
|
8
|
+
latest_price: z.ZodObject<{
|
|
9
|
+
price: z.ZodString;
|
|
10
|
+
timestamp: z.ZodString;
|
|
11
|
+
quote_currency: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
//# sourceMappingURL=get-asset-price.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-asset-price.d.ts","sourceRoot":"","sources":["../../src/tools/get-asset-price.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB,eAAO,MAAM,aAAa;;;;;;;;;;;kBA6BxB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { gql } from '../coinbase-api.js';
|
|
4
|
+
import { latestPriceSchema, mapLatestPrice } from './schemas.js';
|
|
5
|
+
const QUERY = `query GetAssetPrice($uuid: Uuid!, $quoteCurrency: TickerSymbol!) {
|
|
6
|
+
assetByUuid(uuid: $uuid) {
|
|
7
|
+
name symbol
|
|
8
|
+
latestPrice(quoteCurrency: $quoteCurrency) { price timestamp quoteCurrency }
|
|
9
|
+
}
|
|
10
|
+
}`;
|
|
11
|
+
export const getAssetPrice = defineTool({
|
|
12
|
+
name: 'get_asset_price',
|
|
13
|
+
displayName: 'Get Asset Price',
|
|
14
|
+
description: 'Get the current price of a cryptocurrency asset by UUID. Returns the latest price, timestamp, and quote currency. Use get_asset_by_symbol or get_asset_by_slug first to find the UUID if needed.',
|
|
15
|
+
summary: 'Get current price for an asset',
|
|
16
|
+
icon: 'trending-up',
|
|
17
|
+
group: 'Prices',
|
|
18
|
+
input: z.object({
|
|
19
|
+
uuid: z.string().describe('Asset UUID'),
|
|
20
|
+
quote_currency: z.string().optional().describe('Quote currency for price (default "USD")'),
|
|
21
|
+
}),
|
|
22
|
+
output: z.object({
|
|
23
|
+
name: z.string().describe('Asset name'),
|
|
24
|
+
symbol: z.string().describe('Ticker symbol'),
|
|
25
|
+
latest_price: latestPriceSchema,
|
|
26
|
+
}),
|
|
27
|
+
handle: async (params) => {
|
|
28
|
+
const data = await gql(QUERY, {
|
|
29
|
+
uuid: params.uuid,
|
|
30
|
+
quoteCurrency: params.quote_currency ?? 'USD',
|
|
31
|
+
});
|
|
32
|
+
const a = data.assetByUuid;
|
|
33
|
+
return {
|
|
34
|
+
name: a.name ?? '',
|
|
35
|
+
symbol: a.symbol ?? '',
|
|
36
|
+
latest_price: mapLatestPrice(a.latestPrice ?? {}),
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=get-asset-price.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-asset-price.js","sourceRoot":"","sources":["../../src/tools/get-asset-price.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAuB,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEtF,MAAM,KAAK,GAAG;;;;;EAKZ,CAAC;AAUH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EACT,kMAAkM;IACpM,OAAO,EAAE,gCAAgC;IACzC,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;QACvC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;KAC3F,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;QACvC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;QAC5C,YAAY,EAAE,iBAAiB;KAChC,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAW,KAAK,EAAE;YACtC,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,aAAa,EAAE,MAAM,CAAC,cAAc,IAAI,KAAK;SAC9C,CAAC,CAAC;QACH,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;QAC3B,OAAO;YACL,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,EAAE;YAClB,MAAM,EAAE,CAAC,CAAC,MAAM,IAAI,EAAE;YACtB,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,WAAW,IAAI,EAAE,CAAC;SAClD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const getCurrentUser: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
3
|
+
user: z.ZodObject<{
|
|
4
|
+
uuid: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
email: z.ZodString;
|
|
7
|
+
native_currency: z.ZodString;
|
|
8
|
+
avatar_url: z.ZodString;
|
|
9
|
+
created_at: z.ZodString;
|
|
10
|
+
country_code: z.ZodString;
|
|
11
|
+
country_name: z.ZodString;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
//# sourceMappingURL=get-current-user.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-current-user.d.ts","sourceRoot":"","sources":["../../src/tools/get-current-user.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,cAAc;;;;;;;;;;;kBAczB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { gql } from '../coinbase-api.js';
|
|
4
|
+
import { mapUserProperties, userPropertiesSchema } from './schemas.js';
|
|
5
|
+
const QUERY = `query GetCurrentUser {
|
|
6
|
+
viewer {
|
|
7
|
+
userProperties {
|
|
8
|
+
uuid name email nativeCurrency avatarUrl createdAt
|
|
9
|
+
country { code name }
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}`;
|
|
13
|
+
export const getCurrentUser = defineTool({
|
|
14
|
+
name: 'get_current_user',
|
|
15
|
+
displayName: 'Get Current User',
|
|
16
|
+
description: 'Get the authenticated Coinbase user profile including name, email, native currency, avatar, account creation date, and country.',
|
|
17
|
+
summary: 'Get the authenticated user profile',
|
|
18
|
+
icon: 'user',
|
|
19
|
+
group: 'Account',
|
|
20
|
+
input: z.object({}),
|
|
21
|
+
output: z.object({ user: userPropertiesSchema }),
|
|
22
|
+
handle: async () => {
|
|
23
|
+
const data = await gql(QUERY);
|
|
24
|
+
return { user: mapUserProperties(data.viewer.userProperties) };
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=get-current-user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-current-user.js","sourceRoot":"","sources":["../../src/tools/get-current-user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAA0B,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE/F,MAAM,KAAK,GAAG;;;;;;;EAOZ,CAAC;AAMH,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EACT,iIAAiI;IACnI,OAAO,EAAE,oCAAoC;IAC7C,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;IAChD,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAW,KAAK,CAAC,CAAC;QACxC,OAAO,EAAE,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC;IACjE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listPortfolios: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
3
|
+
portfolios: z.ZodArray<z.ZodObject<{
|
|
4
|
+
uuid: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
type: z.ZodString;
|
|
7
|
+
}, z.core.$strip>>;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
//# sourceMappingURL=list-portfolios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-portfolios.d.ts","sourceRoot":"","sources":["../../src/tools/list-portfolios.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,cAAc;;;;;;kBAgBzB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { gql } from '../coinbase-api.js';
|
|
4
|
+
import { mapPortfolio, portfolioSchema } from './schemas.js';
|
|
5
|
+
const QUERY = `query ListPortfolios {
|
|
6
|
+
viewer {
|
|
7
|
+
portfolios { uuid name type }
|
|
8
|
+
}
|
|
9
|
+
}`;
|
|
10
|
+
export const listPortfolios = defineTool({
|
|
11
|
+
name: 'list_portfolios',
|
|
12
|
+
displayName: 'List Portfolios',
|
|
13
|
+
description: 'List all portfolios in the Coinbase account. Most users have a single "Primary" portfolio of type DEFAULT.',
|
|
14
|
+
summary: 'List all portfolios',
|
|
15
|
+
icon: 'briefcase',
|
|
16
|
+
group: 'Portfolio',
|
|
17
|
+
input: z.object({}),
|
|
18
|
+
output: z.object({
|
|
19
|
+
portfolios: z.array(portfolioSchema).describe('List of portfolios'),
|
|
20
|
+
}),
|
|
21
|
+
handle: async () => {
|
|
22
|
+
const data = await gql(QUERY);
|
|
23
|
+
return { portfolios: (data.viewer.portfolios ?? []).map(mapPortfolio) };
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=list-portfolios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-portfolios.js","sourceRoot":"","sources":["../../src/tools/list-portfolios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAqB,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhF,MAAM,KAAK,GAAG;;;;EAIZ,CAAC;AAMH,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EACT,4GAA4G;IAC9G,OAAO,EAAE,qBAAqB;IAC9B,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KACpE,CAAC;IACF,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAW,KAAK,CAAC,CAAC;QACxC,OAAO,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;IAC1E,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listPriceAlerts: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
alerts: z.ZodArray<z.ZodObject<{
|
|
6
|
+
uuid: z.ZodString;
|
|
7
|
+
target_price: z.ZodString;
|
|
8
|
+
direction: z.ZodString;
|
|
9
|
+
asset_name: z.ZodString;
|
|
10
|
+
asset_symbol: z.ZodString;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
total_count: z.ZodNumber;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
//# sourceMappingURL=list-price-alerts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-price-alerts.d.ts","sourceRoot":"","sources":["../../src/tools/list-price-alerts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6BxB,eAAO,MAAM,eAAe;;;;;;;;;;;kBAuB1B,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { gql } from '../coinbase-api.js';
|
|
4
|
+
import { mapPriceAlert, priceAlertSchema } from './schemas.js';
|
|
5
|
+
const QUERY = `query ListPriceAlerts($first: Int!) {
|
|
6
|
+
viewer {
|
|
7
|
+
priceAlerts(first: $first) {
|
|
8
|
+
edges {
|
|
9
|
+
node {
|
|
10
|
+
uuid targetPrice direction
|
|
11
|
+
asset { name symbol }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
totalCount
|
|
15
|
+
pageInfo { hasNextPage endCursor }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}`;
|
|
19
|
+
export const listPriceAlerts = defineTool({
|
|
20
|
+
name: 'list_price_alerts',
|
|
21
|
+
displayName: 'List Price Alerts',
|
|
22
|
+
description: 'List all active price alerts for the authenticated user. Price alerts notify the user when an asset reaches a target price. Returns alert details including target price, direction, and associated asset.',
|
|
23
|
+
summary: 'List all price alerts',
|
|
24
|
+
icon: 'bell',
|
|
25
|
+
group: 'Alerts',
|
|
26
|
+
input: z.object({
|
|
27
|
+
limit: z.number().int().min(1).max(100).optional().describe('Maximum number of alerts to return (default 50)'),
|
|
28
|
+
}),
|
|
29
|
+
output: z.object({
|
|
30
|
+
alerts: z.array(priceAlertSchema).describe('List of active price alerts'),
|
|
31
|
+
total_count: z.number().describe('Total number of alerts'),
|
|
32
|
+
}),
|
|
33
|
+
handle: async (params) => {
|
|
34
|
+
const data = await gql(QUERY, { first: params.limit ?? 50 });
|
|
35
|
+
const conn = data.viewer.priceAlerts;
|
|
36
|
+
return {
|
|
37
|
+
alerts: (conn.edges ?? []).map(e => mapPriceAlert(e.node)),
|
|
38
|
+
total_count: conn.totalCount ?? 0,
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=list-price-alerts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-price-alerts.js","sourceRoot":"","sources":["../../src/tools/list-price-alerts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAsB,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEnF,MAAM,KAAK,GAAG;;;;;;;;;;;;;EAaZ,CAAC;AAYH,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACxC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EACT,4MAA4M;IAC9M,OAAO,EAAE,uBAAuB;IAChC,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;KAC/G,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QACzE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wBAAwB,CAAC;KAC3D,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAW,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC,CAAC;QACvE,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACrC,OAAO;YACL,MAAM,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC1D,WAAW,EAAE,IAAI,CAAC,UAAU,IAAI,CAAC;SAClC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listWatchlists: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
3
|
+
watchlists: z.ZodArray<z.ZodObject<{
|
|
4
|
+
uuid: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
description: z.ZodString;
|
|
7
|
+
items: z.ZodArray<z.ZodObject<{
|
|
8
|
+
uuid: z.ZodString;
|
|
9
|
+
type: z.ZodString;
|
|
10
|
+
created_at: z.ZodString;
|
|
11
|
+
}, z.core.$strip>>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
}, z.core.$strip>>;
|
|
14
|
+
//# sourceMappingURL=list-watchlists.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-watchlists.d.ts","sourceRoot":"","sources":["../../src/tools/list-watchlists.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuBxB,eAAO,MAAM,cAAc;;;;;;;;;;;kBAiBzB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { gql } from '../coinbase-api.js';
|
|
4
|
+
import { mapWatchlist, watchlistSchema } from './schemas.js';
|
|
5
|
+
const QUERY = `query ListWatchlists {
|
|
6
|
+
viewer {
|
|
7
|
+
watchlists {
|
|
8
|
+
edges {
|
|
9
|
+
node {
|
|
10
|
+
uuid name description
|
|
11
|
+
items { uuid type createdAt }
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}`;
|
|
17
|
+
export const listWatchlists = defineTool({
|
|
18
|
+
name: 'list_watchlists',
|
|
19
|
+
displayName: 'List Watchlists',
|
|
20
|
+
description: 'List all watchlists for the authenticated user. Each watchlist contains items (assets) the user is tracking. Items include their UUID and type but not full asset details — use get_asset_by_uuid for that.',
|
|
21
|
+
summary: 'List all watchlists',
|
|
22
|
+
icon: 'eye',
|
|
23
|
+
group: 'Watchlists',
|
|
24
|
+
input: z.object({}),
|
|
25
|
+
output: z.object({
|
|
26
|
+
watchlists: z.array(watchlistSchema).describe('List of watchlists'),
|
|
27
|
+
}),
|
|
28
|
+
handle: async () => {
|
|
29
|
+
const data = await gql(QUERY);
|
|
30
|
+
const edges = data.viewer.watchlists?.edges ?? [];
|
|
31
|
+
return { watchlists: edges.map(e => mapWatchlist(e.node)) };
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=list-watchlists.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-watchlists.js","sourceRoot":"","sources":["../../src/tools/list-watchlists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAqB,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhF,MAAM,KAAK,GAAG;;;;;;;;;;;EAWZ,CAAC;AAQH,MAAM,CAAC,MAAM,cAAc,GAAG,UAAU,CAAC;IACvC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EACT,6MAA6M;IAC/M,OAAO,EAAE,qBAAqB;IAC9B,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KACpE,CAAC;IACF,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAW,KAAK,CAAC,CAAC;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC;QAClD,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;IAC9D,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const removeWatchlistItem: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
watchlist_uuid: z.ZodString;
|
|
4
|
+
item_uuid: z.ZodString;
|
|
5
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
6
|
+
success: z.ZodBoolean;
|
|
7
|
+
}, z.core.$strip>>;
|
|
8
|
+
//# sourceMappingURL=remove-watchlist-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-watchlist-item.d.ts","sourceRoot":"","sources":["../../src/tools/remove-watchlist-item.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,mBAAmB;;;;;kBAwB9B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { gql } from '../coinbase-api.js';
|
|
4
|
+
const MUTATION = `mutation RemoveWatchlistItem($input: RemoveWatchlistItemInput!) {
|
|
5
|
+
removeWatchlistItem(input: $input) {
|
|
6
|
+
__typename
|
|
7
|
+
}
|
|
8
|
+
}`;
|
|
9
|
+
export const removeWatchlistItem = defineTool({
|
|
10
|
+
name: 'remove_watchlist_item',
|
|
11
|
+
displayName: 'Remove Watchlist Item',
|
|
12
|
+
description: 'Remove an asset from a watchlist. Use list_watchlists to find the watchlist item UUID for the asset you want to remove.',
|
|
13
|
+
summary: 'Remove an asset from a watchlist',
|
|
14
|
+
icon: 'eye-off',
|
|
15
|
+
group: 'Watchlists',
|
|
16
|
+
input: z.object({
|
|
17
|
+
watchlist_uuid: z.string().describe('Watchlist UUID (from list_watchlists)'),
|
|
18
|
+
item_uuid: z.string().describe('Watchlist item UUID to remove (from the items array in list_watchlists)'),
|
|
19
|
+
}),
|
|
20
|
+
output: z.object({
|
|
21
|
+
success: z.boolean().describe('Whether the operation succeeded'),
|
|
22
|
+
}),
|
|
23
|
+
handle: async (params) => {
|
|
24
|
+
await gql(MUTATION, {
|
|
25
|
+
input: {
|
|
26
|
+
watchlistUuid: params.watchlist_uuid,
|
|
27
|
+
itemUuid: params.item_uuid,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
return { success: true };
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=remove-watchlist-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-watchlist-item.js","sourceRoot":"","sources":["../../src/tools/remove-watchlist-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,MAAM,QAAQ,GAAG;;;;EAIf,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;IAC5C,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EACT,yHAAyH;IAC3H,OAAO,EAAE,kCAAkC;IAC3C,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,YAAY;IACnB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QAC5E,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yEAAyE,CAAC;KAC1G,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;KACjE,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,GAAG,CAAC,QAAQ,EAAE;YAClB,KAAK,EAAE;gBACL,aAAa,EAAE,MAAM,CAAC,cAAc;gBACpC,QAAQ,EAAE,MAAM,CAAC,SAAS;aAC3B;SACF,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF,CAAC,CAAC"}
|