@cann4n/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-providers/actionDecorator.d.ts +22 -0
- package/dist/action-providers/actionDecorator.d.ts.map +1 -0
- package/dist/action-providers/actionDecorator.js +30 -0
- package/dist/action-providers/actionDecorator.js.map +1 -0
- package/dist/action-providers/actionProvider.d.ts +13 -0
- package/dist/action-providers/actionProvider.d.ts.map +1 -0
- package/dist/action-providers/actionProvider.js +40 -0
- package/dist/action-providers/actionProvider.js.map +1 -0
- package/dist/action-providers/customActionProvider.d.ts +19 -0
- package/dist/action-providers/customActionProvider.d.ts.map +1 -0
- package/dist/action-providers/customActionProvider.js +23 -0
- package/dist/action-providers/customActionProvider.js.map +1 -0
- package/dist/action-providers/index.d.ts +7 -0
- package/dist/action-providers/index.d.ts.map +1 -0
- package/dist/action-providers/index.js +4 -0
- package/dist/action-providers/index.js.map +1 -0
- package/dist/agentkit.d.ts +24 -0
- package/dist/agentkit.d.ts.map +1 -0
- package/dist/agentkit.js +38 -0
- package/dist/agentkit.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/mocks/index.d.ts +2 -0
- package/dist/mocks/index.d.ts.map +1 -0
- package/dist/mocks/index.js +2 -0
- package/dist/mocks/index.js.map +1 -0
- package/dist/mocks/mockWalletProvider.d.ts +24 -0
- package/dist/mocks/mockWalletProvider.d.ts.map +1 -0
- package/dist/mocks/mockWalletProvider.js +47 -0
- package/dist/mocks/mockWalletProvider.js.map +1 -0
- package/dist/network/index.d.ts +3 -0
- package/dist/network/index.d.ts.map +1 -0
- package/dist/network/index.js +2 -0
- package/dist/network/index.js.map +1 -0
- package/dist/network/network.d.ts +45 -0
- package/dist/network/network.d.ts.map +1 -0
- package/dist/network/network.js +46 -0
- package/dist/network/network.js.map +1 -0
- package/dist/types/action.d.ts +10 -0
- package/dist/types/action.d.ts.map +1 -0
- package/dist/types/action.js +2 -0
- package/dist/types/action.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/plugin.d.ts +6 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +2 -0
- package/dist/types/plugin.js.map +1 -0
- package/dist/types/wallet.d.ts +5 -0
- package/dist/types/wallet.d.ts.map +1 -0
- package/dist/types/wallet.js +2 -0
- package/dist/types/wallet.js.map +1 -0
- package/dist/wallet-providers/index.d.ts +2 -0
- package/dist/wallet-providers/index.d.ts.map +1 -0
- package/dist/wallet-providers/index.js +2 -0
- package/dist/wallet-providers/index.js.map +1 -0
- package/dist/wallet-providers/walletProvider.d.ts +21 -0
- package/dist/wallet-providers/walletProvider.d.ts.map +1 -0
- package/dist/wallet-providers/walletProvider.js +35 -0
- package/dist/wallet-providers/walletProvider.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
export declare const ACTION_DECORATOR_KEY: unique symbol;
|
|
3
|
+
export interface ActionDecoratorParams {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
similes?: string[];
|
|
7
|
+
schema: import("zod").ZodSchema;
|
|
8
|
+
returnDirect?: boolean;
|
|
9
|
+
needsWallet?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ActionMetadata {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
similes: string[];
|
|
15
|
+
schema: import("zod").ZodSchema;
|
|
16
|
+
invoke: (...args: unknown[]) => Promise<string>;
|
|
17
|
+
needsWallet: boolean;
|
|
18
|
+
returnDirect?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Decorator that registers a method as an agent action. Auto-prefixes action name from the class name. */
|
|
21
|
+
export declare function Action(params: ActionDecoratorParams): (target: object, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
22
|
+
//# sourceMappingURL=actionDecorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionDecorator.d.ts","sourceRoot":"","sources":["../../src/action-providers/actionDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,eAAO,MAAM,oBAAoB,eAA4B,CAAC;AAE9D,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,OAAO,KAAK,EAAE,SAAS,CAAC;IAChC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,2GAA2G;AAC3G,wBAAgB,MAAM,CAAC,MAAM,EAAE,qBAAqB,IAC1C,QAAQ,MAAM,EAAE,aAAa,MAAM,EAAE,YAAY,kBAAkB,wBA+B5E"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
export const ACTION_DECORATOR_KEY = Symbol("agentkit:action");
|
|
3
|
+
/** Decorator that registers a method as an agent action. Auto-prefixes action name from the class name. */
|
|
4
|
+
export function Action(params) {
|
|
5
|
+
return (target, propertyKey, descriptor) => {
|
|
6
|
+
const baseName = target.constructor.name.replace(/Provider$/, "");
|
|
7
|
+
const snakeName = baseName.replace(/([A-Z])/g, "_$1").replace(/^_/, "").toLowerCase();
|
|
8
|
+
const prefixedName = `${snakeName}_${params.name}`;
|
|
9
|
+
const needsWallet = params.needsWallet ?? (() => {
|
|
10
|
+
const paramTypes = Reflect.getMetadata("design:paramtypes", target, propertyKey) || [];
|
|
11
|
+
return paramTypes.length > 0 &&
|
|
12
|
+
(paramTypes[0]?.name?.includes("WalletProvider") ||
|
|
13
|
+
paramTypes[0]?.name === "WalletProvider");
|
|
14
|
+
})();
|
|
15
|
+
const originalMethod = descriptor.value;
|
|
16
|
+
const existingMetadata = Reflect.getMetadata(ACTION_DECORATOR_KEY, target.constructor) || new Map();
|
|
17
|
+
existingMetadata.set(propertyKey, {
|
|
18
|
+
name: prefixedName,
|
|
19
|
+
description: params.description,
|
|
20
|
+
similes: params.similes || [],
|
|
21
|
+
schema: params.schema,
|
|
22
|
+
invoke: originalMethod,
|
|
23
|
+
needsWallet,
|
|
24
|
+
returnDirect: params.returnDirect,
|
|
25
|
+
});
|
|
26
|
+
Reflect.defineMetadata(ACTION_DECORATOR_KEY, existingMetadata, target.constructor);
|
|
27
|
+
return descriptor;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=actionDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionDecorator.js","sourceRoot":"","sources":["../../src/action-providers/actionDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAqB9D,2GAA2G;AAC3G,MAAM,UAAU,MAAM,CAAC,MAA6B;IAClD,OAAO,CAAC,MAAc,EAAE,WAAmB,EAAE,UAA8B,EAAE,EAAE;QAC7E,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAClE,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACtF,MAAM,YAAY,GAAG,GAAG,SAAS,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAEnD,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,CAAC,GAAG,EAAE;YAC9C,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,mBAAmB,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,CAAC;YACvF,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC;gBAC1B,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,gBAAgB,CAAC;oBAC9C,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,gBAAgB,CAAC,CAAC;QAChD,CAAC,CAAC,EAAE,CAAC;QAEL,MAAM,cAAc,GAAG,UAAU,CAAC,KAAgD,CAAC;QAEnF,MAAM,gBAAgB,GACpB,OAAO,CAAC,WAAW,CAAC,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;QAE7E,gBAAgB,CAAC,GAAG,CAAC,WAAW,EAAE;YAChC,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE;YAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,MAAM,EAAE,cAAc;YACtB,WAAW;YACX,YAAY,EAAE,MAAM,CAAC,YAAY;SAClC,CAAC,CAAC;QAEH,OAAO,CAAC,cAAc,CAAC,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QAEnF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WalletProvider } from "../wallet-providers/walletProvider";
|
|
2
|
+
import type { Action } from "../types/action";
|
|
3
|
+
import type { StellarNetwork } from "../network/network";
|
|
4
|
+
export declare abstract class ActionProvider<TWalletProvider extends WalletProvider = WalletProvider> {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
readonly actionProviders: ActionProvider[];
|
|
7
|
+
constructor(name: string, actionProviders?: ActionProvider[]);
|
|
8
|
+
/** Get all actions from @Action-decorated methods, plus sub-provider actions filtered by network. */
|
|
9
|
+
getActions(walletProvider: TWalletProvider): Action[];
|
|
10
|
+
/** Check whether this provider supports the given network. Override to restrict networks. */
|
|
11
|
+
supportsNetwork(_network: StellarNetwork): boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=actionProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionProvider.d.ts","sourceRoot":"","sources":["../../src/action-providers/actionProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAIzD,8BAAsB,cAAc,CAAC,eAAe,SAAS,cAAc,GAAG,cAAc;IAC1F,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,eAAe,EAAE,cAAc,EAAE,CAAC;gBAEtC,IAAI,EAAE,MAAM,EAAE,eAAe,GAAE,cAAc,EAAO;IAKhE,qGAAqG;IACrG,UAAU,CAAC,cAAc,EAAE,eAAe,GAAG,MAAM,EAAE;IA+BrD,6FAA6F;IAC7F,eAAe,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO;CAGnD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ACTION_DECORATOR_KEY } from "./actionDecorator";
|
|
2
|
+
export class ActionProvider {
|
|
3
|
+
name;
|
|
4
|
+
actionProviders;
|
|
5
|
+
constructor(name, actionProviders = []) {
|
|
6
|
+
this.name = name;
|
|
7
|
+
this.actionProviders = actionProviders;
|
|
8
|
+
}
|
|
9
|
+
/** Get all actions from @Action-decorated methods, plus sub-provider actions filtered by network. */
|
|
10
|
+
getActions(walletProvider) {
|
|
11
|
+
const actions = [];
|
|
12
|
+
const actionsMetadataMap = Reflect.getMetadata(ACTION_DECORATOR_KEY, this.constructor);
|
|
13
|
+
if (actionsMetadataMap) {
|
|
14
|
+
for (const [, metadata] of actionsMetadataMap) {
|
|
15
|
+
actions.push({
|
|
16
|
+
name: metadata.name,
|
|
17
|
+
description: metadata.description,
|
|
18
|
+
similes: metadata.similes,
|
|
19
|
+
schema: metadata.schema,
|
|
20
|
+
returnDirect: metadata.returnDirect,
|
|
21
|
+
invoke: async (args) => {
|
|
22
|
+
const params = metadata.needsWallet ? [walletProvider, args] : [args];
|
|
23
|
+
return metadata.invoke.apply(this, params);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (const subProvider of this.actionProviders) {
|
|
29
|
+
if (subProvider.supportsNetwork(walletProvider.getNetwork())) {
|
|
30
|
+
actions.push(...subProvider.getActions(walletProvider));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return actions;
|
|
34
|
+
}
|
|
35
|
+
/** Check whether this provider supports the given network. Override to restrict networks. */
|
|
36
|
+
supportsNetwork(_network) {
|
|
37
|
+
return _network.protocolFamily === "stellar";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=actionProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actionProvider.js","sourceRoot":"","sources":["../../src/action-providers/actionProvider.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAGzD,MAAM,OAAgB,cAAc;IAClB,IAAI,CAAS;IACb,eAAe,CAAmB;IAElD,YAAY,IAAY,EAAE,kBAAoC,EAAE;QAC9D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;IAED,qGAAqG;IACrG,UAAU,CAAC,cAA+B;QACxC,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,MAAM,kBAAkB,GACtB,OAAO,CAAC,WAAW,CAAC,oBAAoB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAE9D,IAAI,kBAAkB,EAAE,CAAC;YACvB,KAAK,MAAM,CAAC,EAAE,QAAQ,CAAC,IAAI,kBAAkB,EAAE,CAAC;gBAC9C,OAAO,CAAC,IAAI,CAAC;oBACX,IAAI,EAAE,QAAQ,CAAC,IAAI;oBACnB,WAAW,EAAE,QAAQ,CAAC,WAAW;oBACjC,OAAO,EAAE,QAAQ,CAAC,OAAO;oBACzB,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,YAAY,EAAE,QAAQ,CAAC,YAAY;oBACnC,MAAM,EAAE,KAAK,EAAE,IAA6B,EAAE,EAAE;wBAC9C,MAAM,MAAM,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;wBACtE,OAAO,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;oBAC7C,CAAC;iBACF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YAC/C,IAAI,WAAW,CAAC,eAAe,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;gBAC7D,OAAO,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC;YAC1D,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,6FAA6F;IAC7F,eAAe,CAAC,QAAwB;QACtC,OAAO,QAAQ,CAAC,cAAc,KAAK,SAAS,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ActionProvider } from "./actionProvider";
|
|
3
|
+
import type { WalletProvider } from "../wallet-providers/walletProvider";
|
|
4
|
+
import type { StellarNetwork } from "../network/network";
|
|
5
|
+
export interface CustomActionProviderParams<TWalletProvider extends WalletProvider = WalletProvider> {
|
|
6
|
+
name: string;
|
|
7
|
+
actions: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
similes?: string[];
|
|
11
|
+
schema: z.ZodSchema;
|
|
12
|
+
invoke: (wallet: TWalletProvider, args: unknown) => Promise<string>;
|
|
13
|
+
returnDirect?: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
supportsNetwork?: (network: StellarNetwork) => boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Create an inline action provider without a class. Actions are prefixed with `{name}_`. */
|
|
18
|
+
export declare function customActionProvider<TWalletProvider extends WalletProvider = WalletProvider>(params: CustomActionProviderParams<TWalletProvider>): ActionProvider<TWalletProvider>;
|
|
19
|
+
//# sourceMappingURL=customActionProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customActionProvider.d.ts","sourceRoot":"","sources":["../../src/action-providers/customActionProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,MAAM,WAAW,0BAA0B,CAAC,eAAe,SAAS,cAAc,GAAG,cAAc;IACjG,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC;QACpB,MAAM,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;QACpE,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC,CAAC;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC;CACxD;AAED,6FAA6F;AAC7F,wBAAgB,oBAAoB,CAAC,eAAe,SAAS,cAAc,GAAG,cAAc,EAC1F,MAAM,EAAE,0BAA0B,CAAC,eAAe,CAAC,GAClD,cAAc,CAAC,eAAe,CAAC,CAqBjC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ActionProvider } from "./actionProvider";
|
|
2
|
+
/** Create an inline action provider without a class. Actions are prefixed with `{name}_`. */
|
|
3
|
+
export function customActionProvider(params) {
|
|
4
|
+
return new (class extends ActionProvider {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(params.name);
|
|
7
|
+
}
|
|
8
|
+
getActions(walletProvider) {
|
|
9
|
+
return params.actions.map((a) => ({
|
|
10
|
+
name: `${params.name}_${a.name}`,
|
|
11
|
+
description: a.description,
|
|
12
|
+
similes: a.similes || [],
|
|
13
|
+
schema: a.schema,
|
|
14
|
+
returnDirect: a.returnDirect,
|
|
15
|
+
invoke: async (args) => a.invoke(walletProvider, args),
|
|
16
|
+
}));
|
|
17
|
+
}
|
|
18
|
+
supportsNetwork(network) {
|
|
19
|
+
return params.supportsNetwork ? params.supportsNetwork(network) : true;
|
|
20
|
+
}
|
|
21
|
+
})();
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=customActionProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customActionProvider.js","sourceRoot":"","sources":["../../src/action-providers/customActionProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAkBlD,6FAA6F;AAC7F,MAAM,UAAU,oBAAoB,CAClC,MAAmD;IAEnD,OAAO,IAAI,CAAC,KAAM,SAAQ,cAA+B;QACvD;YACE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QAED,UAAU,CAAC,cAA+B;YACxC,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAChC,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE;gBAChC,WAAW,EAAE,CAAC,CAAC,WAAW;gBAC1B,OAAO,EAAE,CAAC,CAAC,OAAO,IAAI,EAAE;gBACxB,MAAM,EAAE,CAAC,CAAC,MAAM;gBAChB,YAAY,EAAE,CAAC,CAAC,YAAY;gBAC5B,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC;aACvD,CAAC,CAAC,CAAC;QACN,CAAC;QAED,eAAe,CAAC,OAAuB;YACrC,OAAO,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACzE,CAAC;KACF,CAAC,EAAE,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ActionProvider } from "./actionProvider";
|
|
2
|
+
export { Action, ACTION_DECORATOR_KEY } from "./actionDecorator";
|
|
3
|
+
export type { ActionDecoratorParams, ActionMetadata } from "./actionDecorator";
|
|
4
|
+
export { customActionProvider } from "./customActionProvider";
|
|
5
|
+
export type { CustomActionProviderParams } from "./customActionProvider";
|
|
6
|
+
export type { Action as ActionSchema } from "../types/action";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/action-providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACjE,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAGzE,YAAY,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/action-providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { WalletProvider } from "./wallet-providers/walletProvider";
|
|
2
|
+
import type { ActionProvider } from "./action-providers/actionProvider";
|
|
3
|
+
import type { Action } from "./types/action";
|
|
4
|
+
import type { StellarNetwork } from "./network/network";
|
|
5
|
+
export interface AgentKitStellarOptions {
|
|
6
|
+
walletProvider: WalletProvider;
|
|
7
|
+
actionProviders?: ActionProvider[];
|
|
8
|
+
}
|
|
9
|
+
export declare class AgentKitStellar {
|
|
10
|
+
private walletProvider;
|
|
11
|
+
private actionProviders;
|
|
12
|
+
private constructor();
|
|
13
|
+
/** Create a new AgentKitStellar instance. */
|
|
14
|
+
static create(config: AgentKitStellarOptions): AgentKitStellar;
|
|
15
|
+
/** Get all actions from wallet core and registered providers, filtered by current network. */
|
|
16
|
+
getActions(): Action[];
|
|
17
|
+
/** Register an additional action provider. Returns this for chaining. */
|
|
18
|
+
use(provider: ActionProvider): AgentKitStellar;
|
|
19
|
+
/** Get the current wallet provider. */
|
|
20
|
+
getWalletProvider(): WalletProvider;
|
|
21
|
+
/** Get the current network from the wallet provider. */
|
|
22
|
+
getNetwork(): StellarNetwork;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=agentkit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentkit.d.ts","sourceRoot":"","sources":["../src/agentkit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,cAAc,CAAC;IAC/B,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;CACpC;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,eAAe,CAAmB;IAE1C,OAAO;IAKP,6CAA6C;IAC7C,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,GAAG,eAAe;IAI9D,8FAA8F;IAC9F,UAAU,IAAI,MAAM,EAAE;IAetB,yEAAyE;IACzE,GAAG,CAAC,QAAQ,EAAE,cAAc,GAAG,eAAe;IAK9C,uCAAuC;IACvC,iBAAiB,IAAI,cAAc;IAInC,wDAAwD;IACxD,UAAU,IAAI,cAAc;CAG7B"}
|
package/dist/agentkit.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export class AgentKitStellar {
|
|
2
|
+
walletProvider;
|
|
3
|
+
actionProviders;
|
|
4
|
+
constructor(config) {
|
|
5
|
+
this.walletProvider = config.walletProvider;
|
|
6
|
+
this.actionProviders = config.actionProviders || [];
|
|
7
|
+
}
|
|
8
|
+
/** Create a new AgentKitStellar instance. */
|
|
9
|
+
static create(config) {
|
|
10
|
+
return new AgentKitStellar(config);
|
|
11
|
+
}
|
|
12
|
+
/** Get all actions from wallet core and registered providers, filtered by current network. */
|
|
13
|
+
getActions() {
|
|
14
|
+
const network = this.walletProvider.getNetwork();
|
|
15
|
+
const actions = [];
|
|
16
|
+
actions.push(...this.walletProvider.getCoreActions());
|
|
17
|
+
for (const provider of this.actionProviders) {
|
|
18
|
+
if (provider.supportsNetwork(network)) {
|
|
19
|
+
actions.push(...provider.getActions(this.walletProvider));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return actions;
|
|
23
|
+
}
|
|
24
|
+
/** Register an additional action provider. Returns this for chaining. */
|
|
25
|
+
use(provider) {
|
|
26
|
+
this.actionProviders.push(provider);
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
/** Get the current wallet provider. */
|
|
30
|
+
getWalletProvider() {
|
|
31
|
+
return this.walletProvider;
|
|
32
|
+
}
|
|
33
|
+
/** Get the current network from the wallet provider. */
|
|
34
|
+
getNetwork() {
|
|
35
|
+
return this.walletProvider.getNetwork();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=agentkit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agentkit.js","sourceRoot":"","sources":["../src/agentkit.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,eAAe;IAClB,cAAc,CAAiB;IAC/B,eAAe,CAAmB;IAE1C,YAAoB,MAA8B;QAChD,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;QAC5C,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC;IACtD,CAAC;IAED,6CAA6C;IAC7C,MAAM,CAAC,MAAM,CAAC,MAA8B;QAC1C,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAED,8FAA8F;IAC9F,UAAU;QACR,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;QACjD,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE,CAAC,CAAC;QAEtD,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YAC5C,IAAI,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;gBACtC,OAAO,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,yEAAyE;IACzE,GAAG,CAAC,QAAwB;QAC1B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,uCAAuC;IACvC,iBAAiB;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,wDAAwD;IACxD,UAAU;QACR,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;IAC1C,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { AgentKitStellar } from "./agentkit";
|
|
2
|
+
export type { AgentKitStellarOptions } from "./agentkit";
|
|
3
|
+
export { WalletProvider } from "./wallet-providers";
|
|
4
|
+
export { ActionProvider, Action, customActionProvider, ACTION_DECORATOR_KEY } from "./action-providers";
|
|
5
|
+
export type { ActionDecoratorParams, ActionMetadata, CustomActionProviderParams } from "./action-providers";
|
|
6
|
+
export { STELLAR_NETWORKS, getNetworkConfig, parseCaip2Network } from "./network";
|
|
7
|
+
export type { StellarNetwork, StellarNetworkId, StellarNetworkConfig } from "./network";
|
|
8
|
+
export type { TransactionResult, Plugin } from "./types";
|
|
9
|
+
export { MockWalletProvider } from "./mocks";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,YAAY,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACxG,YAAY,EAAE,qBAAqB,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAClF,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAExF,YAAY,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AgentKitStellar } from "./agentkit";
|
|
2
|
+
export { WalletProvider } from "./wallet-providers";
|
|
3
|
+
export { ActionProvider, Action, customActionProvider, ACTION_DECORATOR_KEY } from "./action-providers";
|
|
4
|
+
export { STELLAR_NETWORKS, getNetworkConfig, parseCaip2Network } from "./network";
|
|
5
|
+
export { MockWalletProvider } from "./mocks";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAGxG,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAKlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mocks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { WalletProvider } from "../wallet-providers/walletProvider";
|
|
2
|
+
import type { StellarNetwork } from "../network/network";
|
|
3
|
+
import type { TransactionResult } from "../types/wallet";
|
|
4
|
+
export declare class MockWalletProvider extends WalletProvider {
|
|
5
|
+
private address;
|
|
6
|
+
private network;
|
|
7
|
+
private balances;
|
|
8
|
+
private submittedTransactions;
|
|
9
|
+
constructor(address?: string, network?: StellarNetwork);
|
|
10
|
+
getName(): string;
|
|
11
|
+
getAddress(): string;
|
|
12
|
+
getNetwork(): StellarNetwork;
|
|
13
|
+
getBalance(): Promise<bigint>;
|
|
14
|
+
setBalance(token: string, amount: bigint): void;
|
|
15
|
+
signAuthEntry(authEntry: string): Promise<string>;
|
|
16
|
+
signAndSubmitTransaction(txXdr: string): Promise<TransactionResult>;
|
|
17
|
+
submitTransaction(txXdr: string): Promise<TransactionResult>;
|
|
18
|
+
getSubmittedTransactions(): Array<{
|
|
19
|
+
txXdr: string;
|
|
20
|
+
hash: string;
|
|
21
|
+
}>;
|
|
22
|
+
clearTransactions(): void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=mockWalletProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockWalletProvider.d.ts","sourceRoot":"","sources":["../../src/mocks/mockWalletProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,qBAAqB,CAA8C;gBAE/D,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc;IAOtD,OAAO,IAAI,MAAM;IAIjB,UAAU,IAAI,MAAM;IAIpB,UAAU,IAAI,cAAc;IAItB,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAIzC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIjD,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAMnE,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIlE,wBAAwB,IAAI,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAIlE,iBAAiB,IAAI,IAAI;CAG1B"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { WalletProvider } from "../wallet-providers/walletProvider";
|
|
2
|
+
import { STELLAR_NETWORKS } from "../network/network";
|
|
3
|
+
export class MockWalletProvider extends WalletProvider {
|
|
4
|
+
address;
|
|
5
|
+
network;
|
|
6
|
+
balances = new Map();
|
|
7
|
+
submittedTransactions = [];
|
|
8
|
+
constructor(address, network) {
|
|
9
|
+
super();
|
|
10
|
+
this.address = address || "GA4B7Y6XJ5Y6XJ5Y6XJ5Y6XJ5Y6XJ5Y6XJ5Y6XJ5Y6XJ5Y6XJ5Y6XJ5";
|
|
11
|
+
this.network = network || STELLAR_NETWORKS.testnet;
|
|
12
|
+
this.balances.set("native", 100000000000n);
|
|
13
|
+
}
|
|
14
|
+
getName() {
|
|
15
|
+
return "MockWallet";
|
|
16
|
+
}
|
|
17
|
+
getAddress() {
|
|
18
|
+
return this.address;
|
|
19
|
+
}
|
|
20
|
+
getNetwork() {
|
|
21
|
+
return this.network;
|
|
22
|
+
}
|
|
23
|
+
async getBalance() {
|
|
24
|
+
return this.balances.get("native") || 0n;
|
|
25
|
+
}
|
|
26
|
+
setBalance(token, amount) {
|
|
27
|
+
this.balances.set(token, amount);
|
|
28
|
+
}
|
|
29
|
+
async signAuthEntry(authEntry) {
|
|
30
|
+
return `signed:${authEntry}`;
|
|
31
|
+
}
|
|
32
|
+
async signAndSubmitTransaction(txXdr) {
|
|
33
|
+
const hash = `mock_tx_${this.submittedTransactions.length}`;
|
|
34
|
+
this.submittedTransactions.push({ txXdr, hash });
|
|
35
|
+
return { hash, result: "mock_success" };
|
|
36
|
+
}
|
|
37
|
+
async submitTransaction(txXdr) {
|
|
38
|
+
return this.signAndSubmitTransaction(txXdr);
|
|
39
|
+
}
|
|
40
|
+
getSubmittedTransactions() {
|
|
41
|
+
return this.submittedTransactions;
|
|
42
|
+
}
|
|
43
|
+
clearTransactions() {
|
|
44
|
+
this.submittedTransactions = [];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=mockWalletProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockWalletProvider.js","sourceRoot":"","sources":["../../src/mocks/mockWalletProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,MAAM,OAAO,kBAAmB,SAAQ,cAAc;IAC5C,OAAO,CAAS;IAChB,OAAO,CAAiB;IACxB,QAAQ,GAAwB,IAAI,GAAG,EAAE,CAAC;IAC1C,qBAAqB,GAA2C,EAAE,CAAC;IAE3E,YAAY,OAAgB,EAAE,OAAwB;QACpD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,yDAAyD,CAAC;QACpF,IAAI,CAAC,OAAO,GAAG,OAAO,IAAI,gBAAgB,CAAC,OAAO,CAAC;QACnD,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,aAAgB,CAAC,CAAC;IAChD,CAAC;IAED,OAAO;QACL,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC3C,CAAC;IAED,UAAU,CAAC,KAAa,EAAE,MAAc;QACtC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,SAAiB;QACnC,OAAO,UAAU,SAAS,EAAE,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,wBAAwB,CAAC,KAAa;QAC1C,MAAM,IAAI,GAAG,WAAW,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,CAAC;QAC5D,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACjD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,KAAa;QACnC,OAAO,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,wBAAwB;QACtB,OAAO,IAAI,CAAC,qBAAqB,CAAC;IACpC,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,qBAAqB,GAAG,EAAE,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/network/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/network/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export declare const STELLAR_NETWORKS: {
|
|
2
|
+
readonly testnet: {
|
|
3
|
+
readonly protocolFamily: "stellar";
|
|
4
|
+
readonly networkId: "testnet";
|
|
5
|
+
readonly networkPassphrase: "Test SDF Network ; September 2015";
|
|
6
|
+
readonly rpcUrl: "https://soroban-testnet.stellar.org";
|
|
7
|
+
readonly horizonUrl: "https://horizon-testnet.stellar.org";
|
|
8
|
+
readonly friendbotUrl: "https://friendbot.stellar.org";
|
|
9
|
+
readonly isTestnet: true;
|
|
10
|
+
};
|
|
11
|
+
readonly pubnet: {
|
|
12
|
+
readonly protocolFamily: "stellar";
|
|
13
|
+
readonly networkId: "pubnet";
|
|
14
|
+
readonly networkPassphrase: "Public Global Stellar Network ; September 2015";
|
|
15
|
+
readonly rpcUrl: string | undefined;
|
|
16
|
+
readonly horizonUrl: "https://horizon.stellar.org";
|
|
17
|
+
readonly friendbotUrl: string | undefined;
|
|
18
|
+
readonly isTestnet: false;
|
|
19
|
+
};
|
|
20
|
+
readonly local: {
|
|
21
|
+
readonly protocolFamily: "stellar";
|
|
22
|
+
readonly networkId: "local";
|
|
23
|
+
readonly networkPassphrase: "Standalone Network ; February 2017";
|
|
24
|
+
readonly rpcUrl: "http://localhost:8000/soroban/rpc";
|
|
25
|
+
readonly horizonUrl: "http://localhost:8000";
|
|
26
|
+
readonly friendbotUrl: "http://localhost:8000/friendbot";
|
|
27
|
+
readonly isTestnet: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export interface StellarNetwork {
|
|
31
|
+
protocolFamily: "stellar";
|
|
32
|
+
networkId: "testnet" | "pubnet" | "local" | "futurenet";
|
|
33
|
+
networkPassphrase: string;
|
|
34
|
+
rpcUrl?: string;
|
|
35
|
+
horizonUrl: string;
|
|
36
|
+
friendbotUrl?: string;
|
|
37
|
+
isTestnet: boolean;
|
|
38
|
+
}
|
|
39
|
+
export type StellarNetworkId = StellarNetwork["networkId"];
|
|
40
|
+
export type StellarNetworkConfig = (typeof STELLAR_NETWORKS)[keyof typeof STELLAR_NETWORKS];
|
|
41
|
+
/** Look up a network config by network ID. Throws if unknown. */
|
|
42
|
+
export declare function getNetworkConfig(networkId: StellarNetworkId): StellarNetworkConfig;
|
|
43
|
+
/** Parse a CAIP-2 network identifier (e.g. "stellar:testnet") into a network config. */
|
|
44
|
+
export declare function parseCaip2Network(caip2: string): StellarNetworkConfig;
|
|
45
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/network/network.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;yBAcJ,MAAM,GAAG,SAAS;;+BAEZ,MAAM,GAAG,SAAS;;;;;;;;;;;;CAYvC,CAAC;AAEX,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,SAAS,CAAC;IAC1B,SAAS,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAW,CAAC;IACxD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;AAC3D,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE5F,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,GAAG,oBAAoB,CAMlF;AAED,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB,CAMrE"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const STELLAR_NETWORKS = {
|
|
2
|
+
testnet: {
|
|
3
|
+
protocolFamily: "stellar",
|
|
4
|
+
networkId: "testnet",
|
|
5
|
+
networkPassphrase: "Test SDF Network ; September 2015",
|
|
6
|
+
rpcUrl: "https://soroban-testnet.stellar.org",
|
|
7
|
+
horizonUrl: "https://horizon-testnet.stellar.org",
|
|
8
|
+
friendbotUrl: "https://friendbot.stellar.org",
|
|
9
|
+
isTestnet: true,
|
|
10
|
+
},
|
|
11
|
+
pubnet: {
|
|
12
|
+
protocolFamily: "stellar",
|
|
13
|
+
networkId: "pubnet",
|
|
14
|
+
networkPassphrase: "Public Global Stellar Network ; September 2015",
|
|
15
|
+
rpcUrl: undefined,
|
|
16
|
+
horizonUrl: "https://horizon.stellar.org",
|
|
17
|
+
friendbotUrl: undefined,
|
|
18
|
+
isTestnet: false,
|
|
19
|
+
},
|
|
20
|
+
local: {
|
|
21
|
+
protocolFamily: "stellar",
|
|
22
|
+
networkId: "local",
|
|
23
|
+
networkPassphrase: "Standalone Network ; February 2017",
|
|
24
|
+
rpcUrl: "http://localhost:8000/soroban/rpc",
|
|
25
|
+
horizonUrl: "http://localhost:8000",
|
|
26
|
+
friendbotUrl: "http://localhost:8000/friendbot",
|
|
27
|
+
isTestnet: true,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
/** Look up a network config by network ID. Throws if unknown. */
|
|
31
|
+
export function getNetworkConfig(networkId) {
|
|
32
|
+
const config = STELLAR_NETWORKS[networkId];
|
|
33
|
+
if (!config) {
|
|
34
|
+
throw new Error(`Unknown network: ${networkId}`);
|
|
35
|
+
}
|
|
36
|
+
return config;
|
|
37
|
+
}
|
|
38
|
+
/** Parse a CAIP-2 network identifier (e.g. "stellar:testnet") into a network config. */
|
|
39
|
+
export function parseCaip2Network(caip2) {
|
|
40
|
+
const match = caip2.match(/^stellar:(\w+)$/);
|
|
41
|
+
if (!match) {
|
|
42
|
+
throw new Error(`Invalid CAIP-2 network ID: ${caip2}`);
|
|
43
|
+
}
|
|
44
|
+
return getNetworkConfig(match[1]);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/network/network.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE;QACP,cAAc,EAAE,SAAkB;QAClC,SAAS,EAAE,SAAkB;QAC7B,iBAAiB,EAAE,mCAAmC;QACtD,MAAM,EAAE,qCAAqC;QAC7C,UAAU,EAAE,qCAAqC;QACjD,YAAY,EAAE,+BAA+B;QAC7C,SAAS,EAAE,IAAI;KAChB;IACD,MAAM,EAAE;QACN,cAAc,EAAE,SAAkB;QAClC,SAAS,EAAE,QAAiB;QAC5B,iBAAiB,EAAE,gDAAgD;QACnE,MAAM,EAAE,SAA+B;QACvC,UAAU,EAAE,6BAA6B;QACzC,YAAY,EAAE,SAA+B;QAC7C,SAAS,EAAE,KAAK;KACjB;IACD,KAAK,EAAE;QACL,cAAc,EAAE,SAAkB;QAClC,SAAS,EAAE,OAAgB;QAC3B,iBAAiB,EAAE,oCAAoC;QACvD,MAAM,EAAE,mCAAmC;QAC3C,UAAU,EAAE,uBAAuB;QACnC,YAAY,EAAE,iCAAiC;QAC/C,SAAS,EAAE,IAAI;KAChB;CACO,CAAC;AAeX,iEAAiE;AACjE,MAAM,UAAU,gBAAgB,CAAC,SAA2B;IAC1D,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAA0C,CAAC,CAAC;IAC5E,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,oBAAoB,SAAS,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC7C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,8BAA8B,KAAK,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAqB,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export interface Action<TSchema extends z.ZodSchema = z.ZodSchema> {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
similes: string[];
|
|
6
|
+
schema: TSchema;
|
|
7
|
+
invoke: (args: z.infer<TSchema>) => Promise<string>;
|
|
8
|
+
returnDirect?: boolean;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/types/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,WAAW,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","sourceRoot":"","sources":["../../src/types/action.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,MAAM,EAAE,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../../src/types/wallet.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src/types/wallet.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/wallet-providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/wallet-providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { StellarNetwork } from "../network/network";
|
|
2
|
+
import type { Action } from "../types/action";
|
|
3
|
+
import type { TransactionResult } from "../types/wallet";
|
|
4
|
+
export declare abstract class WalletProvider {
|
|
5
|
+
/** Get the wallet provider name. */
|
|
6
|
+
abstract getName(): string;
|
|
7
|
+
/** Get the wallet's Stellar public address. */
|
|
8
|
+
abstract getAddress(): string;
|
|
9
|
+
/** Get the current network configuration. */
|
|
10
|
+
abstract getNetwork(): StellarNetwork;
|
|
11
|
+
/** Get the native XLM balance in stroops. */
|
|
12
|
+
abstract getBalance(): Promise<bigint>;
|
|
13
|
+
/** Sign a Soroban authorization entry. */
|
|
14
|
+
abstract signAuthEntry(authEntry: string): Promise<string>;
|
|
15
|
+
/** Build, sign, simulate, and submit a transaction. Returns the transaction hash and optional result. */
|
|
16
|
+
abstract signAndSubmitTransaction(txXdr: string): Promise<TransactionResult>;
|
|
17
|
+
/** Submit a pre-signed transaction. */
|
|
18
|
+
abstract submitTransaction(txXdr: string): Promise<TransactionResult>;
|
|
19
|
+
getCoreActions(): Action[];
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=walletProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walletProvider.d.ts","sourceRoot":"","sources":["../../src/wallet-providers/walletProvider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,8BAAsB,cAAc;IAClC,oCAAoC;IACpC,QAAQ,CAAC,OAAO,IAAI,MAAM;IAC1B,+CAA+C;IAC/C,QAAQ,CAAC,UAAU,IAAI,MAAM;IAC7B,6CAA6C;IAC7C,QAAQ,CAAC,UAAU,IAAI,cAAc;IACrC,6CAA6C;IAC7C,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IACtC,0CAA0C;IAC1C,QAAQ,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1D,yGAAyG;IACzG,QAAQ,CAAC,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAC5E,uCAAuC;IACvC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAErE,cAAc,IAAI,MAAM,EAAE;CA+B3B"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export class WalletProvider {
|
|
3
|
+
getCoreActions() {
|
|
4
|
+
return [
|
|
5
|
+
{
|
|
6
|
+
name: "wallet_get_address",
|
|
7
|
+
description: "Get the wallet's Stellar public address",
|
|
8
|
+
similes: ["address", "my address", "wallet address"],
|
|
9
|
+
schema: z.object({}),
|
|
10
|
+
invoke: async () => this.getAddress(),
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: "wallet_get_balance",
|
|
14
|
+
description: "Get the wallet's native XLM balance",
|
|
15
|
+
similes: ["balance", "my balance", "xlm balance"],
|
|
16
|
+
schema: z.object({}),
|
|
17
|
+
invoke: async () => {
|
|
18
|
+
const balance = await this.getBalance();
|
|
19
|
+
return `Balance: ${Number(balance) / 10_000_000} XLM (${balance} stroops)`;
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "wallet_get_network",
|
|
24
|
+
description: "Get the current Stellar network configuration",
|
|
25
|
+
similes: ["network", "current network"],
|
|
26
|
+
schema: z.object({}),
|
|
27
|
+
invoke: async () => {
|
|
28
|
+
const net = this.getNetwork();
|
|
29
|
+
return `Network: ${net.networkId} (${net.networkPassphrase})`;
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=walletProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walletProvider.js","sourceRoot":"","sources":["../../src/wallet-providers/walletProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,OAAgB,cAAc;IAgBlC,cAAc;QACZ,OAAO;YACL;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,yCAAyC;gBACtD,OAAO,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,gBAAgB,CAAC;gBACpD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;gBACpB,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE;aACtC;YACD;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,qCAAqC;gBAClD,OAAO,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,aAAa,CAAC;gBACjD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;gBACpB,MAAM,EAAE,KAAK,IAAI,EAAE;oBACjB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;oBACxC,OAAO,YAAY,MAAM,CAAC,OAAO,CAAC,GAAG,UAAU,SAAS,OAAO,WAAW,CAAC;gBAC7E,CAAC;aACF;YACD;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,+CAA+C;gBAC5D,OAAO,EAAE,CAAC,SAAS,EAAE,iBAAiB,CAAC;gBACvC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;gBACpB,MAAM,EAAE,KAAK,IAAI,EAAE;oBACjB,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;oBAC9B,OAAO,YAAY,GAAG,CAAC,SAAS,KAAK,GAAG,CAAC,iBAAiB,GAAG,CAAC;gBAChE,CAAC;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cann4n/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Core framework-agnostic SDK for building AI agents that interact with the Stellar blockchain",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"zod": "^3.24.0",
|
|
21
|
+
"zod-to-json-schema": "^3.24.0",
|
|
22
|
+
"reflect-metadata": "^0.2.0"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@stellar/stellar-sdk": "^12.3.0"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@stellar/stellar-sdk": "^12.3.0",
|
|
29
|
+
"typescript": "^5.7.0",
|
|
30
|
+
"vitest": "^3.0.0"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/anomalyco/agentkit-stellar.git",
|
|
39
|
+
"directory": "packages/core"
|
|
40
|
+
},
|
|
41
|
+
"scripts": {
|
|
42
|
+
"build": "tsc",
|
|
43
|
+
"test": "vitest run",
|
|
44
|
+
"lint": "eslint src/",
|
|
45
|
+
"typecheck": "tsc --noEmit",
|
|
46
|
+
"clean": "rm -rf dist"
|
|
47
|
+
}
|
|
48
|
+
}
|