🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@goat-sdk/core

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@goat-sdk/core - npm Package Compare versions

Comparing version
0.4.9
to
0.5.0
dist/chunk-4WO5YJXN.mjs
+1
"use strict";
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2BFBJULLjs = require('./chunk-2BFBJULL.js');var _chunkEI7MMDWYjs = require('./chunk-EI7MMDWY.js');var _zod = require('zod');var a=class{static{_chunkEI7MMDWYjs.a.call(void 0, this,"WalletClientBase")}getTokenInfoByTicker(t){throw new Error("getTokenInfoByTicker is not implemented for this wallet client")}getCoreTools(){return[_chunk2BFBJULLjs.b.call(void 0, {name:"get_address",description:"Get the address of the wallet",parameters:_zod.z.object({})},()=>this.getAddress()),_chunk2BFBJULLjs.b.call(void 0, {name:"get_chain",description:"Get the chain of the wallet",parameters:_zod.z.object({})},()=>this.getChain()),_chunk2BFBJULLjs.b.call(void 0, {name:"get_balance",description:"Get the balance of the wallet for the native token or a specific token by passing its address.",parameters:_zod.z.object({address:_zod.z.string(),tokenAddress:_zod.z.string().optional()})},t=>this.balanceOf(t.address,t.tokenAddress)),_chunk2BFBJULLjs.b.call(void 0, {name:"sign_message",description:"Sign a message with the wallet",parameters:_zod.z.object({message:_zod.z.string()})},t=>this.signMessage(t.message))]}};exports.a = a;
import{a as u}from"./chunk-QBUWP7NA.mjs";import{a as m}from"./chunk-ODBCEJF7.mjs";import{b as f}from"./chunk-ETCR2PPB.mjs";import{a as i}from"./chunk-YSXGDEY5.mjs";var p=class{static{i(this,"PluginBase")}name;toolProviders;constructor(o,r){this.name=o,this.toolProviders=r}getTools(o){let r=[];for(let n of this.toolProviders){let a=Reflect.getMetadata(c,n.constructor);if(!a){let e=n.constructor.name;console.warn(e==="Function"?"Detected a non-instance tool provider. Please ensure you're passing instances of your tool providers, by using `new MyToolProvider(..)`":`No tools found for ${e}. Please ensure you're using the '@Tool' decorator to expose your tools.`);continue}for(let e of a.values())r.push(f({name:e.name,description:e.description,parameters:e.parameters.schema},s=>{let l=[];return e.walletClient&&(l[e.walletClient.index]=o),l[e.parameters.index]=s,e.target.apply(n,l)}))}return r}};import"reflect-metadata";var c=Symbol("goat:tool");function W(t){return(o,r,n)=>{let{parameters:a,walletClient:e}=w(o,r),s=Reflect.getMetadata(c,o.constructor)||new Map;return s.set(r,{target:n.value,name:t.name??u(r),description:t.description,parameters:a,...e?{walletClient:e}:{}}),Reflect.defineMetadata(c,s,o.constructor),o}}i(W,"Tool");function w(t,o){let r=t instanceof Object?t.constructor.name:void 0,n=`Method '${o}'${r?` on class '${r}'`:""}`,a="Tool methods must have at least one parameter that is a Zod schema class created with the createToolParameters function.",e=Reflect.getMetadata("design:paramtypes",t,o);if(e==null)throw new Error(`Failed to get parameters for ${n}.`);if(e.length===0)throw new Error(`${n} has no parameters. ${a}`);if(e.length>2)throw new Error(`${n} has ${e.length} parameters. ${a}`);let s=e.find(P);if(s==null)throw new Error(`${n} has no parameters parameter.
1.) ${a}
2.) Ensure that you are not using 'import type' for the parameters.`);let l=e.find(x);return{parameters:{index:e.indexOf(s),schema:s.prototype.constructor.schema},...l?{walletClient:{index:e.indexOf(l)}}:{}}}i(w,"validateMethodParameters");function x(t){return!t||!t.prototype?!1:t===m?!0:t.prototype instanceof m}i(x,"isWalletClientParameter");function P(t){return t.prototype?.constructor?.schema!=null}i(P,"isParametersParameter");export{c as a,W as b,p as c};
import{b as s}from"./chunk-ETCR2PPB.mjs";import{a as r}from"./chunk-YSXGDEY5.mjs";import{z as e}from"zod";var a=class{static{r(this,"WalletClientBase")}getTokenInfoByTicker(t){throw new Error("getTokenInfoByTicker is not implemented for this wallet client")}getCoreTools(){return[s({name:"get_address",description:"Get the address of the wallet",parameters:e.object({})},()=>this.getAddress()),s({name:"get_chain",description:"Get the chain of the wallet",parameters:e.object({})},()=>this.getChain()),s({name:"get_balance",description:"Get the balance of the wallet for the native token or a specific token by passing its address.",parameters:e.object({address:e.string(),tokenAddress:e.string().optional()})},t=>this.balanceOf(t.address,t.tokenAddress)),s({name:"sign_message",description:"Sign a message with the wallet",parameters:e.object({message:e.string()})},t=>this.signMessage(t.message))]}};export{a};
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkATIUG4XDjs = require('./chunk-ATIUG4XD.js');var _chunkNEB5NRY6js = require('./chunk-NEB5NRY6.js');var _chunk2BFBJULLjs = require('./chunk-2BFBJULL.js');var _chunkEI7MMDWYjs = require('./chunk-EI7MMDWY.js');var p=class{static{_chunkEI7MMDWYjs.a.call(void 0, this,"PluginBase")}constructor(o,r){this.name=o,this.toolProviders=r}getTools(o){let r=[];for(let n of this.toolProviders){let a=Reflect.getMetadata(c,n.constructor);if(!a){let e=n.constructor.name;console.warn(e==="Function"?"Detected a non-instance tool provider. Please ensure you're passing instances of your tool providers, by using `new MyToolProvider(..)`":`No tools found for ${e}. Please ensure you're using the '@Tool' decorator to expose your tools.`);continue}for(let e of a.values())r.push(_chunk2BFBJULLjs.b.call(void 0, {name:e.name,description:e.description,parameters:e.parameters.schema},s=>{let l=[];return e.walletClient&&(l[e.walletClient.index]=o),l[e.parameters.index]=s,e.target.apply(n,l)}))}return r}};require('reflect-metadata');var c=Symbol("goat:tool");function F(t){return(o,r,n)=>{let{parameters:a,walletClient:e}=h(o,r),s=Reflect.getMetadata(c,o.constructor)||new Map;return s.set(r,{target:n.value,name:_nullishCoalesce(t.name, () => (_chunkATIUG4XDjs.a.call(void 0, r))),description:t.description,parameters:a,...e?{walletClient:e}:{}}),Reflect.defineMetadata(c,s,o.constructor),o}}_chunkEI7MMDWYjs.a.call(void 0, F,"Tool");function h(t,o){let r=t instanceof Object?t.constructor.name:void 0,n=`Method '${o}'${r?` on class '${r}'`:""}`,a="Tool methods must have at least one parameter that is a Zod schema class created with the createToolParameters function.",e=Reflect.getMetadata("design:paramtypes",t,o);if(e==null)throw new Error(`Failed to get parameters for ${n}.`);if(e.length===0)throw new Error(`${n} has no parameters. ${a}`);if(e.length>2)throw new Error(`${n} has ${e.length} parameters. ${a}`);let s=e.find(x);if(s==null)throw new Error(`${n} has no parameters parameter.
1.) ${a}
2.) Ensure that you are not using 'import type' for the parameters.`);let l=e.find(w);return{parameters:{index:e.indexOf(s),schema:s.prototype.constructor.schema},...l?{walletClient:{index:e.indexOf(l)}}:{}}}_chunkEI7MMDWYjs.a.call(void 0, h,"validateMethodParameters");function w(t){return!t||!t.prototype?!1:t===_chunkNEB5NRY6js.a?!0:t.prototype instanceof _chunkNEB5NRY6js.a}_chunkEI7MMDWYjs.a.call(void 0, w,"isWalletClientParameter");function x(t){return _optionalChain([t, 'access', _ => _.prototype, 'optionalAccess', _2 => _2.constructor, 'optionalAccess', _3 => _3.schema])!=null}_chunkEI7MMDWYjs.a.call(void 0, x,"isParametersParameter");exports.a = c; exports.b = F; exports.c = p;
"use strict";
type Token = {
symbol: string;
name: string;
decimals: number;
};
export type { Token };
type Token = {
symbol: string;
name: string;
decimals: number;
};
export type { Token };
"use strict";require('../chunk-M3UOF2F4.js');
import"../chunk-4WO5YJXN.mjs";
+1
-0

@@ -6,1 +6,2 @@ export { PluginBase } from './PluginBase.mjs';

import 'zod';
import '../types/Token.mjs';

@@ -6,1 +6,2 @@ export { PluginBase } from './PluginBase.js';

import 'zod';
import '../types/Token.js';
+1
-1

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2FIGR6PKjs = require('../chunk-2FIGR6PK.js');require('../chunk-ATIUG4XD.js');var _chunk6KPO4VDXjs = require('../chunk-6KPO4VDX.js');var _chunk2BFBJULLjs = require('../chunk-2BFBJULL.js');require('../chunk-EI7MMDWY.js');exports.PluginBase = _chunk2FIGR6PKjs.c; exports.ToolBase = _chunk2BFBJULLjs.a; exports.WalletClientBase = _chunk6KPO4VDXjs.a; exports.createTool = _chunk2BFBJULLjs.b;
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPRWXN5RNjs = require('../chunk-PRWXN5RN.js');require('../chunk-ATIUG4XD.js');var _chunkNEB5NRY6js = require('../chunk-NEB5NRY6.js');var _chunk2BFBJULLjs = require('../chunk-2BFBJULL.js');require('../chunk-EI7MMDWY.js');exports.PluginBase = _chunkPRWXN5RNjs.c; exports.ToolBase = _chunk2BFBJULLjs.a; exports.WalletClientBase = _chunkNEB5NRY6js.a; exports.createTool = _chunk2BFBJULLjs.b;

@@ -1,1 +0,1 @@

import{c}from"../chunk-XYIQNSA3.mjs";import"../chunk-QBUWP7NA.mjs";import{a as d}from"../chunk-N6ZU3WNV.mjs";import{a,b}from"../chunk-ETCR2PPB.mjs";import"../chunk-YSXGDEY5.mjs";export{c as PluginBase,a as ToolBase,d as WalletClientBase,b as createTool};
import{c}from"../chunk-NXUMK44L.mjs";import"../chunk-QBUWP7NA.mjs";import{a as d}from"../chunk-ODBCEJF7.mjs";import{a,b}from"../chunk-ETCR2PPB.mjs";import"../chunk-YSXGDEY5.mjs";export{c as PluginBase,a as ToolBase,d as WalletClientBase,b as createTool};

@@ -5,2 +5,3 @@ import { Chain } from '../types/Chain.mjs';

import 'zod';
import '../types/Token.mjs';

@@ -7,0 +8,0 @@ /**

@@ -5,2 +5,3 @@ import { Chain } from '../types/Chain.js';

import 'zod';
import '../types/Token.js';

@@ -7,0 +8,0 @@ /**

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2FIGR6PKjs = require('../chunk-2FIGR6PK.js');require('../chunk-ATIUG4XD.js');require('../chunk-6KPO4VDX.js');require('../chunk-2BFBJULL.js');require('../chunk-EI7MMDWY.js');exports.PluginBase = _chunk2FIGR6PKjs.c;
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPRWXN5RNjs = require('../chunk-PRWXN5RN.js');require('../chunk-ATIUG4XD.js');require('../chunk-NEB5NRY6.js');require('../chunk-2BFBJULL.js');require('../chunk-EI7MMDWY.js');exports.PluginBase = _chunkPRWXN5RNjs.c;

@@ -1,1 +0,1 @@

import{c as a}from"../chunk-XYIQNSA3.mjs";import"../chunk-QBUWP7NA.mjs";import"../chunk-N6ZU3WNV.mjs";import"../chunk-ETCR2PPB.mjs";import"../chunk-YSXGDEY5.mjs";export{a as PluginBase};
import{c as a}from"../chunk-NXUMK44L.mjs";import"../chunk-QBUWP7NA.mjs";import"../chunk-ODBCEJF7.mjs";import"../chunk-ETCR2PPB.mjs";import"../chunk-YSXGDEY5.mjs";export{a as PluginBase};
import { Chain } from '../types/Chain.mjs';
import { Token } from '../types/Token.mjs';
import { ToolBase } from './ToolBase.mjs';

@@ -19,3 +20,4 @@ import 'zod';

abstract signMessage(message: string): Promise<Signature>;
abstract balanceOf(address: string): Promise<Balance>;
abstract balanceOf(address: string, tokenAddress?: string): Promise<Balance>;
getTokenInfoByTicker(ticker: string): Promise<Token>;
getCoreTools(): ToolBase[];

@@ -22,0 +24,0 @@ }

import { Chain } from '../types/Chain.js';
import { Token } from '../types/Token.js';
import { ToolBase } from './ToolBase.js';

@@ -19,3 +20,4 @@ import 'zod';

abstract signMessage(message: string): Promise<Signature>;
abstract balanceOf(address: string): Promise<Balance>;
abstract balanceOf(address: string, tokenAddress?: string): Promise<Balance>;
getTokenInfoByTicker(ticker: string): Promise<Token>;
getCoreTools(): ToolBase[];

@@ -22,0 +24,0 @@ }

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6KPO4VDXjs = require('../chunk-6KPO4VDX.js');require('../chunk-2BFBJULL.js');require('../chunk-EI7MMDWY.js');exports.WalletClientBase = _chunk6KPO4VDXjs.a;
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNEB5NRY6js = require('../chunk-NEB5NRY6.js');require('../chunk-2BFBJULL.js');require('../chunk-EI7MMDWY.js');exports.WalletClientBase = _chunkNEB5NRY6js.a;

@@ -1,1 +0,1 @@

import{a}from"../chunk-N6ZU3WNV.mjs";import"../chunk-ETCR2PPB.mjs";import"../chunk-YSXGDEY5.mjs";export{a as WalletClientBase};
import{a}from"../chunk-ODBCEJF7.mjs";import"../chunk-ETCR2PPB.mjs";import"../chunk-YSXGDEY5.mjs";export{a as WalletClientBase};

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-JSCNTAIC.js');var _chunk2FIGR6PKjs = require('../chunk-2FIGR6PK.js');require('../chunk-ATIUG4XD.js');require('../chunk-6KPO4VDX.js');require('../chunk-2BFBJULL.js');require('../chunk-EI7MMDWY.js');exports.Tool = _chunk2FIGR6PKjs.b;
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-JSCNTAIC.js');var _chunkPRWXN5RNjs = require('../chunk-PRWXN5RN.js');require('../chunk-ATIUG4XD.js');require('../chunk-NEB5NRY6.js');require('../chunk-2BFBJULL.js');require('../chunk-EI7MMDWY.js');exports.Tool = _chunkPRWXN5RNjs.b;

@@ -1,1 +0,1 @@

import"../chunk-BWIGWQOY.mjs";import{b as a}from"../chunk-XYIQNSA3.mjs";import"../chunk-QBUWP7NA.mjs";import"../chunk-N6ZU3WNV.mjs";import"../chunk-ETCR2PPB.mjs";import"../chunk-YSXGDEY5.mjs";export{a as Tool};
import"../chunk-BWIGWQOY.mjs";import{b as a}from"../chunk-NXUMK44L.mjs";import"../chunk-QBUWP7NA.mjs";import"../chunk-ODBCEJF7.mjs";import"../chunk-ETCR2PPB.mjs";import"../chunk-YSXGDEY5.mjs";export{a as Tool};

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2FIGR6PKjs = require('../chunk-2FIGR6PK.js');require('../chunk-ATIUG4XD.js');require('../chunk-6KPO4VDX.js');require('../chunk-2BFBJULL.js');require('../chunk-EI7MMDWY.js');exports.Tool = _chunk2FIGR6PKjs.b; exports.toolMetadataKey = _chunk2FIGR6PKjs.a;
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPRWXN5RNjs = require('../chunk-PRWXN5RN.js');require('../chunk-ATIUG4XD.js');require('../chunk-NEB5NRY6.js');require('../chunk-2BFBJULL.js');require('../chunk-EI7MMDWY.js');exports.Tool = _chunkPRWXN5RNjs.b; exports.toolMetadataKey = _chunkPRWXN5RNjs.a;

@@ -1,1 +0,1 @@

import{a,b}from"../chunk-XYIQNSA3.mjs";import"../chunk-QBUWP7NA.mjs";import"../chunk-N6ZU3WNV.mjs";import"../chunk-ETCR2PPB.mjs";import"../chunk-YSXGDEY5.mjs";export{b as Tool,a as toolMetadataKey};
import{a,b}from"../chunk-NXUMK44L.mjs";import"../chunk-QBUWP7NA.mjs";import"../chunk-ODBCEJF7.mjs";import"../chunk-ETCR2PPB.mjs";import"../chunk-YSXGDEY5.mjs";export{b as Tool,a as toolMetadataKey};

@@ -5,3 +5,4 @@ export { PluginBase } from './classes/PluginBase.mjs';

export { Tool, ToolDecoratorParams } from './decorators/Tool.mjs';
export { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain } from './types/Chain.mjs';
export { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, NativeCurrency, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain } from './types/Chain.mjs';
export { Token } from './types/Token.mjs';
export { addParametersToDescription } from './utils/addParametersToDescription.mjs';

@@ -8,0 +9,0 @@ export { ToolParametersStatic, createToolParameters } from './utils/createToolParameters.mjs';

@@ -5,3 +5,4 @@ export { PluginBase } from './classes/PluginBase.js';

export { Tool, ToolDecoratorParams } from './decorators/Tool.js';
export { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain } from './types/Chain.js';
export { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, NativeCurrency, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain } from './types/Chain.js';
export { Token } from './types/Token.js';
export { addParametersToDescription } from './utils/addParametersToDescription.js';

@@ -8,0 +9,0 @@ export { ToolParametersStatic, createToolParameters } from './utils/createToolParameters.js';

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-B35TULQO.js');require('./chunk-U76ID4TS.js');var _chunkYNASICHOjs = require('./chunk-YNASICHO.js');var _chunkCPCEGD5Wjs = require('./chunk-CPCEGD5W.js');var _chunkXO6KYZAXjs = require('./chunk-XO6KYZAX.js');require('./chunk-JSCNTAIC.js');var _chunk2FIGR6PKjs = require('./chunk-2FIGR6PK.js');require('./chunk-ATIUG4XD.js');var _chunk6KPO4VDXjs = require('./chunk-6KPO4VDX.js');var _chunk2BFBJULLjs = require('./chunk-2BFBJULL.js');require('./chunk-EI7MMDWY.js');require('./chunk-4E4OVKBT.js');exports.PluginBase = _chunk2FIGR6PKjs.c; exports.Tool = _chunk2FIGR6PKjs.b; exports.ToolBase = _chunk2BFBJULLjs.a; exports.WalletClientBase = _chunk6KPO4VDXjs.a; exports.addParametersToDescription = _chunkYNASICHOjs.a; exports.createTool = _chunk2BFBJULLjs.b; exports.createToolParameters = _chunkCPCEGD5Wjs.a; exports.getTools = _chunkXO6KYZAXjs.a;
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-TXL5YKCK.js');require('./chunk-M3UOF2F4.js');require('./chunk-U76ID4TS.js');var _chunkYNASICHOjs = require('./chunk-YNASICHO.js');var _chunkCPCEGD5Wjs = require('./chunk-CPCEGD5W.js');var _chunkXO6KYZAXjs = require('./chunk-XO6KYZAX.js');require('./chunk-JSCNTAIC.js');var _chunkPRWXN5RNjs = require('./chunk-PRWXN5RN.js');require('./chunk-ATIUG4XD.js');var _chunkNEB5NRY6js = require('./chunk-NEB5NRY6.js');var _chunk2BFBJULLjs = require('./chunk-2BFBJULL.js');require('./chunk-EI7MMDWY.js');require('./chunk-4E4OVKBT.js');exports.PluginBase = _chunkPRWXN5RNjs.c; exports.Tool = _chunkPRWXN5RNjs.b; exports.ToolBase = _chunk2BFBJULLjs.a; exports.WalletClientBase = _chunkNEB5NRY6js.a; exports.addParametersToDescription = _chunkYNASICHOjs.a; exports.createTool = _chunk2BFBJULLjs.b; exports.createToolParameters = _chunkCPCEGD5Wjs.a; exports.getTools = _chunkXO6KYZAXjs.a;

@@ -1,1 +0,1 @@

import"./chunk-6OLNVKT6.mjs";import"./chunk-WWU25UQ4.mjs";import{a as p}from"./chunk-LXZJARMM.mjs";import{a as t}from"./chunk-YJFN5KUX.mjs";import{a as x}from"./chunk-MQPJMYH2.mjs";import"./chunk-BWIGWQOY.mjs";import{b as o,c as f}from"./chunk-XYIQNSA3.mjs";import"./chunk-QBUWP7NA.mjs";import{a as m}from"./chunk-N6ZU3WNV.mjs";import{a as r,b as e}from"./chunk-ETCR2PPB.mjs";import"./chunk-YSXGDEY5.mjs";import"./chunk-XNUWQIHY.mjs";export{f as PluginBase,o as Tool,r as ToolBase,m as WalletClientBase,p as addParametersToDescription,e as createTool,t as createToolParameters,x as getTools};
import"./chunk-WCOLSAEM.mjs";import"./chunk-4WO5YJXN.mjs";import"./chunk-WWU25UQ4.mjs";import{a as p}from"./chunk-LXZJARMM.mjs";import{a as t}from"./chunk-YJFN5KUX.mjs";import{a as x}from"./chunk-MQPJMYH2.mjs";import"./chunk-BWIGWQOY.mjs";import{b as o,c as f}from"./chunk-NXUMK44L.mjs";import"./chunk-QBUWP7NA.mjs";import{a as m}from"./chunk-ODBCEJF7.mjs";import{a as r,b as e}from"./chunk-ETCR2PPB.mjs";import"./chunk-YSXGDEY5.mjs";import"./chunk-XNUWQIHY.mjs";export{f as PluginBase,o as Tool,r as ToolBase,m as WalletClientBase,p as addParametersToDescription,e as createTool,t as createToolParameters,x as getTools};

@@ -5,2 +5,7 @@ /**

*/
type NativeCurrency = {
name: string;
symbol: string;
decimals: number;
};
type Chain = EvmChain | SolanaChain | AptosChain | ChromiaChain | FuelChain | SuiChain | ZilliqaChain | CosmosChain | StarknetChain | RadixChain | ZetrixChain;

@@ -13,5 +18,7 @@ type SuiChain = {

id: number;
nativeCurrency: NativeCurrency;
};
type SolanaChain = {
type: "solana";
nativeCurrency: NativeCurrency;
};

@@ -46,2 +53,2 @@ type AptosChain = {

export type { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain };
export type { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, NativeCurrency, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain };

@@ -5,2 +5,7 @@ /**

*/
type NativeCurrency = {
name: string;
symbol: string;
decimals: number;
};
type Chain = EvmChain | SolanaChain | AptosChain | ChromiaChain | FuelChain | SuiChain | ZilliqaChain | CosmosChain | StarknetChain | RadixChain | ZetrixChain;

@@ -13,5 +18,7 @@ type SuiChain = {

id: number;
nativeCurrency: NativeCurrency;
};
type SolanaChain = {
type: "solana";
nativeCurrency: NativeCurrency;
};

@@ -46,2 +53,2 @@ type AptosChain = {

export type { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain };
export type { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, NativeCurrency, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain };

@@ -1,1 +0,2 @@

export { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain } from './Chain.mjs';
export { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, NativeCurrency, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain } from './Chain.mjs';
export { Token } from './Token.mjs';

@@ -1,1 +0,2 @@

export { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain } from './Chain.js';
export { AptosChain, Chain, ChromiaChain, CosmosChain, EvmChain, FuelChain, NativeCurrency, RadixChain, SolanaChain, StarknetChain, SuiChain, ZetrixChain, ZilliqaChain } from './Chain.js';
export { Token } from './Token.js';

@@ -1,1 +0,1 @@

"use strict";require('../chunk-B35TULQO.js');require('../chunk-4E4OVKBT.js');
"use strict";require('../chunk-TXL5YKCK.js');require('../chunk-M3UOF2F4.js');require('../chunk-4E4OVKBT.js');

@@ -1,1 +0,1 @@

import"../chunk-6OLNVKT6.mjs";import"../chunk-XNUWQIHY.mjs";
import"../chunk-WCOLSAEM.mjs";import"../chunk-4WO5YJXN.mjs";import"../chunk-XNUWQIHY.mjs";

@@ -6,2 +6,3 @@ import * as zod from 'zod';

import '../types/Chain.mjs';
import '../types/Token.mjs';

@@ -8,0 +9,0 @@ type GetToolsParams<TWalletClient extends WalletClientBase> = {

@@ -6,2 +6,3 @@ import * as zod from 'zod';

import '../types/Chain.js';
import '../types/Token.js';

@@ -8,0 +9,0 @@ type GetToolsParams<TWalletClient extends WalletClientBase> = {

@@ -9,1 +9,2 @@ export { addParametersToDescription } from './addParametersToDescription.mjs';

import '../classes/WalletClientBase.mjs';
import '../types/Token.mjs';

@@ -9,1 +9,2 @@ export { addParametersToDescription } from './addParametersToDescription.js';

import '../classes/WalletClientBase.js';
import '../types/Token.js';
{
"name": "@goat-sdk/core",
"version": "0.4.9",
"version": "0.5.0",
"sideEffects": false,

@@ -5,0 +5,0 @@ "files": [

+36
-24
<div>
<img src="https://github.com/user-attachments/assets/4821833e-52e5-4126-a2a1-59e9fa9bebd7" alt="GOAT" width="100%" height="auto" style="object-fit: contain; max-width: 800px;">
<img src="https://github.com/user-attachments/assets/59fa5ddc-9d47-4d41-a51a-64f6798f94bd" alt="GOAT" width="100%" height="auto" style="object-fit: contain; max-width: 800px;">

@@ -33,22 +33,27 @@ <div>

# 🐐 Overview
GOAT (Great Onchain Agent Toolkit) is the **largest library of onchain tools** for your AI agent:
GOAT is the **largest agentic finance toolkit** for AI agents.
**Create agents that can:**
- Send and receive payments
- Purchase physical and digital goods and services
- Engage in various investment strategies:
- Earn yield
- Bet on prediction markets
- Purchase crypto assets
- Tokenize any asset
- Get financial insights
**How it works**
GOAT leverages blockchains, cryptocurrencies (such as stablecoins), and wallets as the infrastructure to enable agents to become economic actors:
1. Give your agent a **[wallet](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets)**
2. Allow it to transact on **[any chain](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets)**
3. Use more than **[+200 onchain tools](https://github.com/goat-sdk/goat/tree/main#tools)**
2. Allow it to transact **[anywhere](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets)**
3. Use more than **[+200 tools](https://github.com/goat-sdk/goat/tree/main#tools)**
4. Use it with **[any agent framework](https://github.com/goat-sdk/goat/tree/main#agent-frameworks)** of your choice
See everything GOAT supports [here](https://github.com/goat-sdk/goat/tree/main#️-supported-tools-and-frameworks).
See everything GOAT supports [here](#️-supported-tools-and-frameworks).
**Create agents that can**
- Transfer funds between wallets
- Swap tokens
- Create and manage DeFi positions
- Create, buy and sell NFTs
- Purchase physical assets onchain with crypto
- Get onchain insights
**Lightweight and extendable**
Different from other agent kits, GOAT is designed to be lightweight and extendable by keeping its core minimal and allowing you to **install only the tools you need**.
Different from other toolkits, GOAT is designed to be lightweight and extendable by keeping its core minimal and allowing you to **install only the tools you need**.

@@ -72,16 +77,23 @@ If you don't find what you need on our more than 200 integrations you can easily:

- **By use case**
- Send and receive tokens [[EVM](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/evm-send-receive-tokens), [Solana](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/solana-send-receive-tokens), [Chromia](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/chromia-send-receive-tokens), [Cosmos](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/cosmos-send-receive-tokens), [Fuel](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/fuel-send-receive-tokens), [Radix](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/radix-send-receive-tokens)]
- Swap tokens [[EVM](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/evm-swap-tokens), [Solana](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/solana-swap-tokens)]
- Create and manage DeFi positions [[EVM](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/evm-defi-agent), [Solana](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/solana-defi-agent)]
- Mint NFTs [[EVM](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/evm-mint-nft), [Solana](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/solana-mint-nft)]
- Make bets on Polymarket [[EVM](https://github.com/goat-sdk/goat/tree/main/typescript/examples/vercel-ai/polymarket)]
- Launch a token on Pump.fun [[Solana](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/solana-launch-token)]
- Purchase physical assets [coming soon]
- **Money transmission**
- Send and receive payments [[EVM](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/evm-send-and-receive-tokens), [Solana](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/solana-send-and-receive-tokens), [Chromia](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/chromia-send-and-receive-tokens), [Cosmos](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/cosmos-send-and-receive-tokens), [Fuel](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/fuel-send-and-receive-tokens), [Radix](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/radix-send-and-receive-tokens), [Zetrix](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/zetrix-send-and-receive-tokens)]
- **Commerce**
- Purchase any item on Amazon [[EVM](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/evm-purchase-on-amazon), [Solana](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/solana-purchase-on-amazon)]
- **Investing**
- Earn yield [[EVM](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/evm-defi-agent), [Solana](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/solana-defi-agent)]
- Prediction markets [[EVM](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/evm-bet-on-polymarket)]
- Purchase crypto assets [[EVM](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/evm-swap-tokens), [Solana](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/solana-swap-tokens)]
- **Tokenization**
- Tokenize non-fungible assets [[EVM](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/evm-mint-nft), [Solana](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/solana-mint-nft)]
- Tokenize fungible assets [[Solana](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-use-case/solana-launch-token)]
- **By framework**
- [Vercel AI](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-framework/vercel-ai)
- [Langchain](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-framework/langchain)
- [LlamaIndex](https://github.com/goat-sdk/goat/tree/main/typescript/packages/adapters/llamaindex)
- [MCP (Model Context Protocol)](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-framework/model-context-protocol)
- [Voice agent with ElevenLabs](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-framework/eleven-labs)
- [Mastra](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-framework/mastra)
- [OpenAI GPT via REST API](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-framework/chatgpt)
- [Eliza Agent](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-framework/eliza)
- [GAME Agent](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-framework/virtuals-game)
- [MCP (Model Context Protocol)](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-framework/model-context-protocol)
- [Voice agent with ElevenLabs](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-framework/eleven-labs)
- **By wallet**

@@ -94,3 +106,3 @@ - [Crossmint Smart Wallets](https://github.com/goat-sdk/goat/tree/main/typescript/examples/by-wallet/crossmint-smart-wallets)

- **See all typescript quickstarts [here](https://github.com/goat-sdk/goat/tree/main/typescript/examples).**
# 🛠️ Supported tools and frameworks

@@ -97,0 +109,0 @@ - See [here the full list of supported tools and frameworks](https://github.com/goat-sdk/goat/tree/main#️-supported-tools-and-frameworks)

"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkATIUG4XDjs = require('./chunk-ATIUG4XD.js');var _chunk6KPO4VDXjs = require('./chunk-6KPO4VDX.js');var _chunk2BFBJULLjs = require('./chunk-2BFBJULL.js');var _chunkEI7MMDWYjs = require('./chunk-EI7MMDWY.js');var p=class{static{_chunkEI7MMDWYjs.a.call(void 0, this,"PluginBase")}constructor(o,r){this.name=o,this.toolProviders=r}getTools(o){let r=[];for(let n of this.toolProviders){let a=Reflect.getMetadata(c,n.constructor);if(!a){let e=n.constructor.name;console.warn(e==="Function"?"Detected a non-instance tool provider. Please ensure you're passing instances of your tool providers, by using `new MyToolProvider(..)`":`No tools found for ${e}. Please ensure you're using the '@Tool' decorator to expose your tools.`);continue}for(let e of a.values())r.push(_chunk2BFBJULLjs.b.call(void 0, {name:e.name,description:e.description,parameters:e.parameters.schema},s=>{let l=[];return e.walletClient&&(l[e.walletClient.index]=o),l[e.parameters.index]=s,e.target.apply(n,l)}))}return r}};require('reflect-metadata');var c=Symbol("goat:tool");function F(t){return(o,r,n)=>{let{parameters:a,walletClient:e}=h(o,r),s=Reflect.getMetadata(c,o.constructor)||new Map;return s.set(r,{target:n.value,name:_nullishCoalesce(t.name, () => (_chunkATIUG4XDjs.a.call(void 0, r))),description:t.description,parameters:a,...e?{walletClient:e}:{}}),Reflect.defineMetadata(c,s,o.constructor),o}}_chunkEI7MMDWYjs.a.call(void 0, F,"Tool");function h(t,o){let r=t instanceof Object?t.constructor.name:void 0,n=`Method '${o}'${r?` on class '${r}'`:""}`,a="Tool methods must have at least one parameter that is a Zod schema class created with the createToolParameters function.",e=Reflect.getMetadata("design:paramtypes",t,o);if(e==null)throw new Error(`Failed to get parameters for ${n}.`);if(e.length===0)throw new Error(`${n} has no parameters. ${a}`);if(e.length>2)throw new Error(`${n} has ${e.length} parameters. ${a}`);let s=e.find(x);if(s==null)throw new Error(`${n} has no parameters parameter.
1.) ${a}
2.) Ensure that you are not using 'import type' for the parameters.`);let l=e.find(w);return{parameters:{index:e.indexOf(s),schema:s.prototype.constructor.schema},...l?{walletClient:{index:e.indexOf(l)}}:{}}}_chunkEI7MMDWYjs.a.call(void 0, h,"validateMethodParameters");function w(t){return!t||!t.prototype?!1:t===_chunk6KPO4VDXjs.a?!0:t.prototype instanceof _chunk6KPO4VDXjs.a}_chunkEI7MMDWYjs.a.call(void 0, w,"isWalletClientParameter");function x(t){return _optionalChain([t, 'access', _ => _.prototype, 'optionalAccess', _2 => _2.constructor, 'optionalAccess', _3 => _3.schema])!=null}_chunkEI7MMDWYjs.a.call(void 0, x,"isParametersParameter");exports.a = c; exports.b = F; exports.c = p;
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk2BFBJULLjs = require('./chunk-2BFBJULL.js');var _chunkEI7MMDWYjs = require('./chunk-EI7MMDWY.js');var _zod = require('zod');var r=class{static{_chunkEI7MMDWYjs.a.call(void 0, this,"WalletClientBase")}getCoreTools(){return[_chunk2BFBJULLjs.b.call(void 0, {name:"get_address",description:"Get the address of the wallet",parameters:_zod.z.object({})},()=>this.getAddress()),_chunk2BFBJULLjs.b.call(void 0, {name:"get_chain",description:"Get the chain of the wallet",parameters:_zod.z.object({})},()=>this.getChain()),_chunk2BFBJULLjs.b.call(void 0, {name:"get_balance",description:"Get the balance of the wallet",parameters:_zod.z.object({address:_zod.z.string()})},s=>this.balanceOf(s.address)),_chunk2BFBJULLjs.b.call(void 0, {name:"sign_message",description:"Sign a message with the wallet",parameters:_zod.z.object({message:_zod.z.string()})},s=>this.signMessage(s.message))]}};exports.a = r;
"use strict";
import{b as t}from"./chunk-ETCR2PPB.mjs";import{a}from"./chunk-YSXGDEY5.mjs";import{z as e}from"zod";var r=class{static{a(this,"WalletClientBase")}getCoreTools(){return[t({name:"get_address",description:"Get the address of the wallet",parameters:e.object({})},()=>this.getAddress()),t({name:"get_chain",description:"Get the chain of the wallet",parameters:e.object({})},()=>this.getChain()),t({name:"get_balance",description:"Get the balance of the wallet",parameters:e.object({address:e.string()})},s=>this.balanceOf(s.address)),t({name:"sign_message",description:"Sign a message with the wallet",parameters:e.object({message:e.string()})},s=>this.signMessage(s.message))]}};export{r as a};
import{a as u}from"./chunk-QBUWP7NA.mjs";import{a as m}from"./chunk-N6ZU3WNV.mjs";import{b as f}from"./chunk-ETCR2PPB.mjs";import{a as i}from"./chunk-YSXGDEY5.mjs";var p=class{static{i(this,"PluginBase")}name;toolProviders;constructor(o,r){this.name=o,this.toolProviders=r}getTools(o){let r=[];for(let n of this.toolProviders){let a=Reflect.getMetadata(c,n.constructor);if(!a){let e=n.constructor.name;console.warn(e==="Function"?"Detected a non-instance tool provider. Please ensure you're passing instances of your tool providers, by using `new MyToolProvider(..)`":`No tools found for ${e}. Please ensure you're using the '@Tool' decorator to expose your tools.`);continue}for(let e of a.values())r.push(f({name:e.name,description:e.description,parameters:e.parameters.schema},s=>{let l=[];return e.walletClient&&(l[e.walletClient.index]=o),l[e.parameters.index]=s,e.target.apply(n,l)}))}return r}};import"reflect-metadata";var c=Symbol("goat:tool");function W(t){return(o,r,n)=>{let{parameters:a,walletClient:e}=w(o,r),s=Reflect.getMetadata(c,o.constructor)||new Map;return s.set(r,{target:n.value,name:t.name??u(r),description:t.description,parameters:a,...e?{walletClient:e}:{}}),Reflect.defineMetadata(c,s,o.constructor),o}}i(W,"Tool");function w(t,o){let r=t instanceof Object?t.constructor.name:void 0,n=`Method '${o}'${r?` on class '${r}'`:""}`,a="Tool methods must have at least one parameter that is a Zod schema class created with the createToolParameters function.",e=Reflect.getMetadata("design:paramtypes",t,o);if(e==null)throw new Error(`Failed to get parameters for ${n}.`);if(e.length===0)throw new Error(`${n} has no parameters. ${a}`);if(e.length>2)throw new Error(`${n} has ${e.length} parameters. ${a}`);let s=e.find(P);if(s==null)throw new Error(`${n} has no parameters parameter.
1.) ${a}
2.) Ensure that you are not using 'import type' for the parameters.`);let l=e.find(x);return{parameters:{index:e.indexOf(s),schema:s.prototype.constructor.schema},...l?{walletClient:{index:e.indexOf(l)}}:{}}}i(w,"validateMethodParameters");function x(t){return!t||!t.prototype?!1:t===m?!0:t.prototype instanceof m}i(x,"isWalletClientParameter");function P(t){return t.prototype?.constructor?.schema!=null}i(P,"isParametersParameter");export{c as a,W as b,p as c};