flow-evm-agentkit 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/.cache/replit/env/latest +59 -0
- package/.cache/replit/env/latest.json +1 -0
- package/.cache/replit/modules/nodejs-20.res +1 -0
- package/.cache/replit/modules/replit-rtld-loader.res +1 -0
- package/.cache/replit/modules/replit.res +1 -0
- package/.cache/replit/modules.stamp +0 -0
- package/.cache/replit/nix/dotreplitenv.json +1 -0
- package/.cache/replit/toolchain.json +1 -0
- package/.env.example +25 -0
- package/LICENSE +22 -0
- package/README.md +421 -0
- package/dist/cli/scaffold.d.ts +8 -0
- package/dist/cli/scaffold.d.ts.map +1 -0
- package/dist/cli/scaffold.js +369 -0
- package/dist/cli/scaffold.js.map +1 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +42 -0
- package/dist/config/index.js.map +1 -0
- package/dist/core/agent.d.ts +38 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +255 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/examples/agent-server.d.ts +2 -0
- package/dist/examples/agent-server.d.ts.map +1 -0
- package/dist/examples/agent-server.js +212 -0
- package/dist/examples/agent-server.js.map +1 -0
- package/dist/examples/trading-agent.d.ts +2 -0
- package/dist/examples/trading-agent.d.ts.map +1 -0
- package/dist/examples/trading-agent.js +95 -0
- package/dist/examples/trading-agent.js.map +1 -0
- package/dist/examples/tx-echo-agent.d.ts +2 -0
- package/dist/examples/tx-echo-agent.d.ts.map +1 -0
- package/dist/examples/tx-echo-agent.js +67 -0
- package/dist/examples/tx-echo-agent.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/index.d.ts +8 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/index.js +49 -0
- package/dist/logger/index.js.map +1 -0
- package/dist/modules/executor.d.ts +21 -0
- package/dist/modules/executor.d.ts.map +1 -0
- package/dist/modules/executor.js +205 -0
- package/dist/modules/executor.js.map +1 -0
- package/dist/modules/knowledge.d.ts +19 -0
- package/dist/modules/knowledge.d.ts.map +1 -0
- package/dist/modules/knowledge.js +208 -0
- package/dist/modules/knowledge.js.map +1 -0
- package/dist/modules/observer.d.ts +26 -0
- package/dist/modules/observer.d.ts.map +1 -0
- package/dist/modules/observer.js +184 -0
- package/dist/modules/observer.js.map +1 -0
- package/dist/modules/planner.d.ts +15 -0
- package/dist/modules/planner.d.ts.map +1 -0
- package/dist/modules/planner.js +179 -0
- package/dist/modules/planner.js.map +1 -0
- package/dist/types/index.d.ts +67 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +67 -0
@@ -0,0 +1,59 @@
|
|
1
|
+
declare -gx GLIBC_TUNABLES=glibc.rtld.optional_static_tls=2500
|
2
|
+
declare -gx GI_TYPELIB_PATH=''
|
3
|
+
declare -gx NIXPKGS_ALLOW_UNFREE=1
|
4
|
+
declare -gx REPLIT_LD_AUDIT=/nix/store/1blcr36jzjnqs8xcnckviaqh1gky3mhw-replit_rtld_loader-1/rtld_loader.so
|
5
|
+
declare -gx XDG_CONFIG_HOME=/home/runner/workspace/.config
|
6
|
+
declare -gx NIX_PS1='\[\033[01;34m\]\w\[\033[00m\]\$ '
|
7
|
+
declare -gx PKG_CONFIG_PATH=/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib/pkgconfig:/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib/pkgconfig
|
8
|
+
declare -gx REPLIT_LD_LIBRARY_PATH=/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib:/nix/store/yqm2wli4khr99fiy24xf8j0yfgjxd6zl-bash-5.2p26-debug/lib:/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/lib:/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib
|
9
|
+
declare -gx __EGL_VENDOR_LIBRARY_FILENAMES=/nix/store/1z62rda9iqnxi4ryvgmyvfaj979hgk7s-mesa-24.2.8-drivers/share/glvnd/egl_vendor.d/50_mesa.json
|
10
|
+
declare -gx REPLIT_PID1_FLAG_PREEVALED_SYSPKGS=1
|
11
|
+
declare -gx NIX_CFLAGS_COMPILE='-isystem /nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/include -isystem /nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/include'
|
12
|
+
declare -gx REPLIT_RTLD_LOADER=1
|
13
|
+
declare -gx npm_config_prefix=/home/runner/workspace/.config/npm/node_global
|
14
|
+
declare -gx LDFLAGS='-L/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib -L/nix/store/yqm2wli4khr99fiy24xf8j0yfgjxd6zl-bash-5.2p26-debug/lib -L/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/lib -L/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib'
|
15
|
+
declare -gx REPLIT_CLUSTER=pike
|
16
|
+
declare -gx COLORTERM=truecolor
|
17
|
+
declare -gx GIT_ASKPASS=replit-git-askpass
|
18
|
+
declare -gx LANG=en_US.UTF-8
|
19
|
+
declare -gx DOCKER_CONFIG=/home/runner/workspace/.config/docker
|
20
|
+
declare -gx XDG_DATA_DIRS=/nix/store/h9c1r442x21sb1c32qg3zxzgqq05ppk5-bash-5.2p26-man/share:/nix/store/885s5jfq60a9rv7k8dlkwwkg65iidik2-bash-5.2p26-info/share:/nix/store/iq9zqffnplidkc9nl5c5nbqll53yz3g6-libxcrypt-4.4.36-man/share:/nix/store/484bvadwmcrnp5acmjzz7v7sc5pij37i-bash-5.2p26-doc/share:/nix/store/a04r09wqgcp9kmgfgmpbqmm20b7ffx7w-replit-runtime-path/share
|
21
|
+
declare -gx REPLIT_PID1_VERSION=0.0.0-de7d797
|
22
|
+
declare -gx LIBGL_DRIVERS_PATH=/nix/store/1z62rda9iqnxi4ryvgmyvfaj979hgk7s-mesa-24.2.8-drivers/lib/dri
|
23
|
+
declare -gx REPLIT_ENVIRONMENT=production
|
24
|
+
declare -gx REPLIT_DOMAINS=389abf51-87a5-4c13-9297-caf37a8c537d-00-hu6amg11ifwl.pike.replit.dev
|
25
|
+
read -r _new_path <<< "/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin:/nix/store/s62s2lf3bdqd0iiprrf3xcks35vkyhpb-npx/bin:/home/runner/workspace/.config/npm/node_global/bin:/home/runner/workspace/node_modules/.bin:/nix/store/lyx73qs96hfazl77arnwllwckq9dy012-nodejs-20.18.1-wrapped/bin:/nix/store/917mlm9pvmkd4c62rvvhp2xyd2c9hyl5-bun-1.2.16/bin:/nix/store/z8s3r4vwf4r26g2d7shnw5lva6ihim8f-pnpm-9.15.0/bin:/nix/store/jcgdksj946l5l42c2y9ks2l4g6n74h3f-yarn-1.22.22/bin:/nix/store/2s17mrby0ph00z22rkabfs9vzpzx1r70-prettier-3.3.3/bin:/nix/store/5m92sb69w0w73pqa1na2x972yzdjahb6-pid1/bin:/nix/store/a04r09wqgcp9kmgfgmpbqmm20b7ffx7w-replit-runtime-path/bin:/home/runner/.nix-profile/bin:/home/runner/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
26
|
+
#PATH=/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin:/nix/store/s62s2lf3bdqd0iiprrf3xcks35vkyhpb-npx/bin:/home/runner/workspace/.config/npm/node_global/bin:/home/runner/workspace/node_modules/.bin:/nix/store/lyx73qs96hfazl77arnwllwckq9dy012-nodejs-20.18.1-wrapped/bin:/nix/store/917mlm9pvmkd4c62rvvhp2xyd2c9hyl5-bun-1.2.16/bin:/nix/store/z8s3r4vwf4r26g2d7shnw5lva6ihim8f-pnpm-9.15.0/bin:/nix/store/jcgdksj946l5l42c2y9ks2l4g6n74h3f-yarn-1.22.22/bin:/nix/store/2s17mrby0ph00z22rkabfs9vzpzx1r70-prettier-3.3.3/bin:/nix/store/5m92sb69w0w73pqa1na2x972yzdjahb6-pid1/bin:/nix/store/a04r09wqgcp9kmgfgmpbqmm20b7ffx7w-replit-runtime-path/bin:/home/runner/.nix-profile/bin:/home/runner/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
27
|
+
if [ -e "/run/replit/env/last" ]; then read -r _last_path < <(\grep '^#PATH=' /run/replit/env/last | cut -f 2 -d =); fi
|
28
|
+
_user_components="$(\tr : $'\n' <<< "${PATH:-}" |\grep -xv -f <(\tr : $'\n' <<< "${_last_path}") |\tr $'\n' :)"
|
29
|
+
declare -gx PATH="${_user_components}${_new_path}"
|
30
|
+
declare -gx REPLIT_CLI=/nix/store/qpzxppndmbvaj402j2im09kajky38k03-pid1-0.0.1/bin/replit
|
31
|
+
declare -gx REPL_HOME=/home/runner/workspace
|
32
|
+
declare -gx LOCALE_ARCHIVE=/usr/lib/locale/locale-archive
|
33
|
+
declare -gx REPL_IMAGE=gcr.io/marine-cycle-160323/nix:bf8590a3e2f0a8b70b7ca175eeed9074dffbfca9
|
34
|
+
declare -gx REPLIT_DEV_DOMAIN=389abf51-87a5-4c13-9297-caf37a8c537d-00-hu6amg11ifwl.pike.replit.dev
|
35
|
+
declare -gx PKG_CONFIG_PATH_FOR_TARGET=/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib/pkgconfig:/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib/pkgconfig
|
36
|
+
declare -gx NIX_LDFLAGS='-L/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib -L/nix/store/yqm2wli4khr99fiy24xf8j0yfgjxd6zl-bash-5.2p26-debug/lib -L/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/lib -L/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib'
|
37
|
+
declare -gx REPLIT_SUBCLUSTER=interactive
|
38
|
+
declare -gx NIX_PROFILES='/nix/var/nix/profiles/default /home/runner/.nix-profile'
|
39
|
+
declare -gx LD_AUDIT=/nix/store/1blcr36jzjnqs8xcnckviaqh1gky3mhw-replit_rtld_loader-1/rtld_loader.so
|
40
|
+
declare -gx XDG_DATA_HOME=/home/runner/workspace/.local/share
|
41
|
+
declare -gx CFLAGS='-isystem /nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/include -isystem /nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/include'
|
42
|
+
declare -gx USER=runner
|
43
|
+
declare -gx DISPLAY=:0
|
44
|
+
declare -gx REPLIT_NIX_CHANNEL=stable-24_05
|
45
|
+
declare -gx REPL_ID=389abf51-87a5-4c13-9297-caf37a8c537d
|
46
|
+
declare -gx REPL_OWNER_ID=44681152
|
47
|
+
declare -gx HOSTNAME=5da59c58709e
|
48
|
+
declare -gx NIX_PATH=nixpkgs=/home/runner/.nix-defexpr/channels/nixpkgs-stable-24_05:/home/runner/.nix-defexpr/channels
|
49
|
+
declare -gx REPL_LANGUAGE=nix
|
50
|
+
declare -gx REPL_SLUG=workspace
|
51
|
+
declare -gx REPL_PUBKEYS='{"crosis-ci":"7YlpcYh82oR9NSTtSYtR5jDL4onNzCGJGq6b+9CuZII=","crosis-ci:1":"7YlpcYh82oR9NSTtSYtR5jDL4onNzCGJGq6b+9CuZII=","crosis-ci:latest":"7YlpcYh82oR9NSTtSYtR5jDL4onNzCGJGq6b+9CuZII=","prod":"tGsjlu/BJvWTgvMaX7acuUb7AO1dXOrRiuk7y083RFE=","prod:1":"tGsjlu/BJvWTgvMaX7acuUb7AO1dXOrRiuk7y083RFE=","prod:2":"8uGN+vfszlnV93/HCSHlVLG0xddMlPkir1Ni4JKT4+w=","prod:3":"9+MCOSHQSQlcodXoot8dC8NLhc862nLkx1/VMsbY2h8=","prod:4":"8uGN+vfszlnV93/HCSHlVLG0xddMlPkir1Ni4JKT4+w=","prod:5":"9+MCOSHQSQlcodXoot8dC8NLhc862nLkx1/VMsbY2h8=","prod:latest":"tGsjlu/BJvWTgvMaX7acuUb7AO1dXOrRiuk7y083RFE=","vault-goval-token":"D5jJoMx1Ml54HM92NLgXl+MzptwDqbSsfyFG6f52g9E=","vault-goval-token:1":"D5jJoMx1Ml54HM92NLgXl+MzptwDqbSsfyFG6f52g9E=","vault-goval-token:latest":"D5jJoMx1Ml54HM92NLgXl+MzptwDqbSsfyFG6f52g9E="}'
|
52
|
+
declare -gx REPL_OWNER=ximefa3424
|
53
|
+
declare -gx PROMPT_DIRTRIM=2
|
54
|
+
declare -gx HOME=/home/runner
|
55
|
+
declare -gx REPLIT_RIPPKGS_INDICES=/nix/store/l5gcmdp908sji4wchfp8csflhjcgnmm3-rippkgs-indices
|
56
|
+
declare -gx REPLIT_BASHRC=/nix/store/5m19p9rqshi95sxcjiq121b6saz8ra31-replit-bashrc/bashrc
|
57
|
+
declare -gx XDG_CACHE_HOME=/home/runner/workspace/.cache
|
58
|
+
declare -gx GIT_EDITOR=replit-git-editor
|
59
|
+
declare -gx REPLIT_CONTAINER=gcr.io/marine-cycle-160323/repl-base:97433c06ca04972a1619dedd971cb3a93f4a5087
|
@@ -0,0 +1 @@
|
|
1
|
+
{"environment":{"CFLAGS":"-isystem /nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/include -isystem /nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/include","COLORTERM":"truecolor","DISPLAY":":0","DOCKER_CONFIG":"/home/runner/workspace/.config/docker","GIT_ASKPASS":"replit-git-askpass","GIT_EDITOR":"replit-git-editor","GI_TYPELIB_PATH":"","GLIBC_TUNABLES":"glibc.rtld.optional_static_tls=2500","HOME":"/home/runner","HOSTNAME":"5da59c58709e","LANG":"en_US.UTF-8","LDFLAGS":"-L/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib -L/nix/store/yqm2wli4khr99fiy24xf8j0yfgjxd6zl-bash-5.2p26-debug/lib -L/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/lib -L/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib","LD_AUDIT":"/nix/store/1blcr36jzjnqs8xcnckviaqh1gky3mhw-replit_rtld_loader-1/rtld_loader.so","LIBGL_DRIVERS_PATH":"/nix/store/1z62rda9iqnxi4ryvgmyvfaj979hgk7s-mesa-24.2.8-drivers/lib/dri","LOCALE_ARCHIVE":"/usr/lib/locale/locale-archive","NIXPKGS_ALLOW_UNFREE":"1","NIX_CFLAGS_COMPILE":"-isystem /nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/include -isystem /nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/include","NIX_LDFLAGS":"-L/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib -L/nix/store/yqm2wli4khr99fiy24xf8j0yfgjxd6zl-bash-5.2p26-debug/lib -L/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/lib -L/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib","NIX_PATH":"nixpkgs=/home/runner/.nix-defexpr/channels/nixpkgs-stable-24_05:/home/runner/.nix-defexpr/channels","NIX_PROFILES":"/nix/var/nix/profiles/default /home/runner/.nix-profile","NIX_PS1":"\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ","PATH":"/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin:/nix/store/s62s2lf3bdqd0iiprrf3xcks35vkyhpb-npx/bin:/home/runner/workspace/.config/npm/node_global/bin:/home/runner/workspace/node_modules/.bin:/nix/store/lyx73qs96hfazl77arnwllwckq9dy012-nodejs-20.18.1-wrapped/bin:/nix/store/917mlm9pvmkd4c62rvvhp2xyd2c9hyl5-bun-1.2.16/bin:/nix/store/z8s3r4vwf4r26g2d7shnw5lva6ihim8f-pnpm-9.15.0/bin:/nix/store/jcgdksj946l5l42c2y9ks2l4g6n74h3f-yarn-1.22.22/bin:/nix/store/2s17mrby0ph00z22rkabfs9vzpzx1r70-prettier-3.3.3/bin:/nix/store/5m92sb69w0w73pqa1na2x972yzdjahb6-pid1/bin:/nix/store/a04r09wqgcp9kmgfgmpbqmm20b7ffx7w-replit-runtime-path/bin:/home/runner/.nix-profile/bin:/home/runner/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","PKG_CONFIG_PATH":"/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib/pkgconfig:/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib/pkgconfig","PKG_CONFIG_PATH_FOR_TARGET":"/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib/pkgconfig:/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib/pkgconfig","PROMPT_DIRTRIM":"2","REPLIT_BASHRC":"/nix/store/5m19p9rqshi95sxcjiq121b6saz8ra31-replit-bashrc/bashrc","REPLIT_CLI":"/nix/store/qpzxppndmbvaj402j2im09kajky38k03-pid1-0.0.1/bin/replit","REPLIT_CLUSTER":"pike","REPLIT_CONTAINER":"gcr.io/marine-cycle-160323/repl-base:97433c06ca04972a1619dedd971cb3a93f4a5087","REPLIT_DEV_DOMAIN":"389abf51-87a5-4c13-9297-caf37a8c537d-00-hu6amg11ifwl.pike.replit.dev","REPLIT_DOMAINS":"389abf51-87a5-4c13-9297-caf37a8c537d-00-hu6amg11ifwl.pike.replit.dev","REPLIT_ENVIRONMENT":"production","REPLIT_LD_AUDIT":"/nix/store/1blcr36jzjnqs8xcnckviaqh1gky3mhw-replit_rtld_loader-1/rtld_loader.so","REPLIT_LD_LIBRARY_PATH":"/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib:/nix/store/yqm2wli4khr99fiy24xf8j0yfgjxd6zl-bash-5.2p26-debug/lib:/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/lib:/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib","REPLIT_NIX_CHANNEL":"stable-24_05","REPLIT_PID1_FLAG_PREEVALED_SYSPKGS":"1","REPLIT_PID1_VERSION":"0.0.0-de7d797","REPLIT_RIPPKGS_INDICES":"/nix/store/l5gcmdp908sji4wchfp8csflhjcgnmm3-rippkgs-indices","REPLIT_RTLD_LOADER":"1","REPLIT_SUBCLUSTER":"interactive","REPL_HOME":"/home/runner/workspace","REPL_ID":"389abf51-87a5-4c13-9297-caf37a8c537d","REPL_IMAGE":"gcr.io/marine-cycle-160323/nix:bf8590a3e2f0a8b70b7ca175eeed9074dffbfca9","REPL_LANGUAGE":"nix","REPL_OWNER":"ximefa3424","REPL_OWNER_ID":"44681152","REPL_PUBKEYS":"{\"crosis-ci\":\"7YlpcYh82oR9NSTtSYtR5jDL4onNzCGJGq6b+9CuZII=\",\"crosis-ci:1\":\"7YlpcYh82oR9NSTtSYtR5jDL4onNzCGJGq6b+9CuZII=\",\"crosis-ci:latest\":\"7YlpcYh82oR9NSTtSYtR5jDL4onNzCGJGq6b+9CuZII=\",\"prod\":\"tGsjlu/BJvWTgvMaX7acuUb7AO1dXOrRiuk7y083RFE=\",\"prod:1\":\"tGsjlu/BJvWTgvMaX7acuUb7AO1dXOrRiuk7y083RFE=\",\"prod:2\":\"8uGN+vfszlnV93/HCSHlVLG0xddMlPkir1Ni4JKT4+w=\",\"prod:3\":\"9+MCOSHQSQlcodXoot8dC8NLhc862nLkx1/VMsbY2h8=\",\"prod:4\":\"8uGN+vfszlnV93/HCSHlVLG0xddMlPkir1Ni4JKT4+w=\",\"prod:5\":\"9+MCOSHQSQlcodXoot8dC8NLhc862nLkx1/VMsbY2h8=\",\"prod:latest\":\"tGsjlu/BJvWTgvMaX7acuUb7AO1dXOrRiuk7y083RFE=\",\"vault-goval-token\":\"D5jJoMx1Ml54HM92NLgXl+MzptwDqbSsfyFG6f52g9E=\",\"vault-goval-token:1\":\"D5jJoMx1Ml54HM92NLgXl+MzptwDqbSsfyFG6f52g9E=\",\"vault-goval-token:latest\":\"D5jJoMx1Ml54HM92NLgXl+MzptwDqbSsfyFG6f52g9E=\"}","REPL_SLUG":"workspace","USER":"runner","XDG_CACHE_HOME":"/home/runner/workspace/.cache","XDG_CONFIG_HOME":"/home/runner/workspace/.config","XDG_DATA_DIRS":"/nix/store/h9c1r442x21sb1c32qg3zxzgqq05ppk5-bash-5.2p26-man/share:/nix/store/885s5jfq60a9rv7k8dlkwwkg65iidik2-bash-5.2p26-info/share:/nix/store/iq9zqffnplidkc9nl5c5nbqll53yz3g6-libxcrypt-4.4.36-man/share:/nix/store/484bvadwmcrnp5acmjzz7v7sc5pij37i-bash-5.2p26-doc/share:/nix/store/a04r09wqgcp9kmgfgmpbqmm20b7ffx7w-replit-runtime-path/share","XDG_DATA_HOME":"/home/runner/workspace/.local/share","__EGL_VENDOR_LIBRARY_FILENAMES":"/nix/store/1z62rda9iqnxi4ryvgmyvfaj979hgk7s-mesa-24.2.8-drivers/share/glvnd/egl_vendor.d/50_mesa.json","npm_config_prefix":"/home/runner/workspace/.config/npm/node_global"}}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"type":"resolve","resolvedModuleId":"nodejs-20","inputHash":"","resolutionPath":["nodejs-20"],"error":"","Changed":true}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"type":"resolve","resolvedModuleId":"replit-rtld-loader","inputHash":"","resolutionPath":["replit-rtld-loader"],"error":"","Changed":true}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"type":"resolve","resolvedModuleId":"replit","inputHash":"","resolutionPath":["replit"],"error":"","Changed":true}
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
{"channel":"stable-24_05","channel_nix_path":"/nix/store/r9dxa39mzcwfm6qp398j3wkms3vwiqcd-nixpkgs-stable-24_05-24.05.tar.gz/nixpkgs-stable-24_05","env":{"CFLAGS":"-isystem /nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/include -isystem /nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/include","GI_TYPELIB_PATH":"","LDFLAGS":"-L/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib -L/nix/store/yqm2wli4khr99fiy24xf8j0yfgjxd6zl-bash-5.2p26-debug/lib -L/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/lib -L/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib","NIX_CFLAGS_COMPILE":"-isystem /nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/include -isystem /nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/include","NIX_LDFLAGS":"-L/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib -L/nix/store/yqm2wli4khr99fiy24xf8j0yfgjxd6zl-bash-5.2p26-debug/lib -L/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/lib -L/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib","PATH":"/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin","PKG_CONFIG_PATH":"/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib/pkgconfig:/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib/pkgconfig","PKG_CONFIG_PATH_FOR_TARGET":"/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib/pkgconfig:/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib/pkgconfig","REPLIT_LD_LIBRARY_PATH":"/nix/store/bkdbqkrf1ha6w4lg6cz5cl4hj9rplybq-bash-5.2p26-dev/lib:/nix/store/yqm2wli4khr99fiy24xf8j0yfgjxd6zl-bash-5.2p26-debug/lib:/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/lib:/nix/store/5xynf9c9ml7d97q70kpq9rpqqmx13xl8-libxcrypt-4.4.36/lib","XDG_DATA_DIRS":"/nix/store/h9c1r442x21sb1c32qg3zxzgqq05ppk5-bash-5.2p26-man/share:/nix/store/885s5jfq60a9rv7k8dlkwwkg65iidik2-bash-5.2p26-info/share:/nix/store/iq9zqffnplidkc9nl5c5nbqll53yz3g6-libxcrypt-4.4.36-man/share:/nix/store/484bvadwmcrnp5acmjzz7v7sc5pij37i-bash-5.2p26-doc/share"},"packages":["bash","libxcrypt"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"runs":[{"id":".replit/run","name":"sh -c 'npm run dev'","fileTypeAttrs":{},"run":{"command":{"args":["sh","-c","npm run dev"]}}},{"id":"module:nodejs-20/runner:nodeJS","name":"Node.js","fileParam":true,"language":"javascript","fileTypeAttrs":{},"displayVersion":"20.18.1","run":{"command":{"args":["sh","-c","/nix/store/lyx73qs96hfazl77arnwllwckq9dy012-nodejs-20.18.1-wrapped/bin/node $file"]}},"defaultEntrypoints":["index.js","main.js"]}],"debuggers":[{"id":"module:nodejs-20/debugger:nodeDAP","name":"Node DAP","fileParam":true,"language":"javascript","fileTypeAttrs":{}}],"languageServers":[{"id":"module:replit/languageServer:dotreplit-lsp","name":".replit LSP","language":"dotreplit","fileTypeAttrs":{},"config":{"startCommand":{"args":["sh","-c","/nix/store/bz8k1njgmm249fr5krhaq1jsi7jrhx5k-taplo-0.patched/bin/taplo lsp -c /nix/store/2zhz6va20gizdlqmvryab9b7pn6dp0v1-taplo-config.toml stdio"]}}},{"id":"module:nodejs-20/languageServer:typescript-language-server","name":"TypeScript Language Server","language":"javascript","fileTypeAttrs":{"extensions":[".js",".jsx",".ts",".tsx",".mjs",".mts",".cjs",".cts",".es6",".json"]},"config":{"startCommand":{"args":["sh","-c","/nix/store/9cd76kqpml5gkw8jjnjx0flwdf0a1gv1-typescript-language-server-4.3.3/bin/typescript-language-server --stdio"]},"initializationOptionsJson":"{\"tsserver\":{\"fallbackPath\":\"/nix/store/g6ns6m42fvybfzb2xjppcsfmb6k0jv5x-typescript-5.6.3/lib/node_modules/typescript/lib\"}}"},"displayVersion":"4.3.3"}],"packagers":[{"id":"module:nodejs-20/packager:upmNodejs","name":"Node.js packager (npm, yarn, pnpm, bun)","language":"nodejs","packageSearch":true,"guessImports":true}],"formatters":[{"id":"module:nodejs-20/formatter:prettier","name":"Prettier","startCommand":{"args":["/nix/store/070ycjyhpfv8n895zq7yz6z0pp57g0q9-run-prettier/bin/run-prettier"],"lifecycle":"STDIN","splitStderr":true},"fileTypeAttrs":{"extensions":[".js",".jsx",".ts",".tsx",".json",".html"]},"displayVersion":"3.3.3","supportsRangeFormatting":true},{"id":"module:nodejs-20/languageServer:typescript-language-server","name":"TypeScript Language Server","fileTypeAttrs":{"extensions":[".js",".jsx",".ts",".tsx",".mjs",".mts",".cjs",".cts",".es6",".json"]},"displayVersion":"4.3.3"},{"id":"module:replit/languageServer:dotreplit-lsp","name":".replit LSP","fileTypeAttrs":{}}]}
|
package/.env.example
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Flow EVM Configuration
|
2
|
+
FLOW_RPC_URL=https://mainnet.evm.nodes.onflow.org
|
3
|
+
FLOW_TESTNET_RPC_URL=https://testnet.evm.nodes.onflow.org
|
4
|
+
|
5
|
+
# Wallet Configuration
|
6
|
+
PRIVATE_KEY=your_private_key_here
|
7
|
+
|
8
|
+
# OpenAI Configuration (Optional)
|
9
|
+
OPENAI_API_KEY=your_openai_api_key_here
|
10
|
+
|
11
|
+
# Vector Database Configuration (Optional)
|
12
|
+
CHROMA_URL=http://localhost:8000
|
13
|
+
CHROMA_API_KEY=your_chroma_api_key_here
|
14
|
+
|
15
|
+
# Agent Configuration
|
16
|
+
AGENT_NAME=FlowEVMAgent
|
17
|
+
LOG_LEVEL=info
|
18
|
+
|
19
|
+
# Optional: Explorer API
|
20
|
+
FLOWSCAN_API_KEY=your_flowscan_api_key_here
|
21
|
+
|
22
|
+
# Optional: Advanced Features
|
23
|
+
ENABLE_MEMORY=true
|
24
|
+
ENABLE_LLM_PLANNING=true
|
25
|
+
MAX_TASK_HISTORY=100
|
package/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
MIT License
|
3
|
+
|
4
|
+
Copyright (c) 2025 Flow EVM AgentKit Contributors
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
14
|
+
copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
@@ -0,0 +1,421 @@
|
|
1
|
+
|
2
|
+
# Flow EVM AgentKit
|
3
|
+
|
4
|
+
[](https://badge.fury.io/js/flow-evm-agentkit)
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
6
|
+
[](https://www.typescriptlang.org/)
|
7
|
+
|
8
|
+
🚀 **Quick Start (2 minutes)**
|
9
|
+
|
10
|
+
Want to get started immediately? Here's the fastest way:
|
11
|
+
|
12
|
+
```bash
|
13
|
+
# 1. Install the package
|
14
|
+
npm install flow-evm-agentkit viem
|
15
|
+
|
16
|
+
# 2. Create a .env file
|
17
|
+
echo "FLOW_RPC_URL=https://testnet.evm.nodes.onflow.org
|
18
|
+
PRIVATE_KEY=your-private-key-here" > .env
|
19
|
+
|
20
|
+
# 3. Create a test file
|
21
|
+
// test.js
|
22
|
+
import { Agent, Config } from 'flow-evm-agentkit';
|
23
|
+
import { config } from 'dotenv';
|
24
|
+
|
25
|
+
config(); // Load .env file
|
26
|
+
|
27
|
+
async function test() {
|
28
|
+
const agentConfig = Config.load();
|
29
|
+
const agent = new Agent(agentConfig);
|
30
|
+
|
31
|
+
await agent.start();
|
32
|
+
const balance = await agent.query('Check my current FLOW balance');
|
33
|
+
console.log('Agent response:', balance);
|
34
|
+
}
|
35
|
+
|
36
|
+
test();
|
37
|
+
```
|
38
|
+
|
39
|
+
That's it! You now have a working Flow EVM blockchain agent. Read on for more details.
|
40
|
+
|
41
|
+
## 📖 What is Flow EVM AgentKit?
|
42
|
+
|
43
|
+
The Flow EVM AgentKit is a comprehensive TypeScript SDK designed for building intelligent, autonomous agents on the Flow EVM blockchain. Think of it as your AI-powered Swiss Army knife for Flow blockchain development.
|
44
|
+
|
45
|
+
### What is Flow EVM?
|
46
|
+
|
47
|
+
- **Flow EVM** is Ethereum Virtual Machine compatibility on the Flow blockchain
|
48
|
+
- **High Performance**: Sub-second finality with high throughput
|
49
|
+
- **Developer Friendly**: Full Ethereum tooling compatibility
|
50
|
+
- **Cost Effective**: Lower gas fees compared to Ethereum mainnet
|
51
|
+
- **Secure**: Built on Flow's proven blockchain infrastructure
|
52
|
+
|
53
|
+
### What does this SDK do?
|
54
|
+
|
55
|
+
✅ **Transaction Management**: Send FLOW tokens and ERC-20 tokens
|
56
|
+
✅ **Smart Contract Interaction**: Deploy and interact with contracts
|
57
|
+
✅ **Real-time Monitoring**: Listen to blockchain events and transactions
|
58
|
+
✅ **AI Integration**: LLM-powered decision making with OpenAI/LangChain
|
59
|
+
✅ **Autonomous Operation**: Self-directed agents that observe, plan, and execute
|
60
|
+
✅ **Memory & Learning**: Persistent knowledge storage and retrieval
|
61
|
+
✅ **Gas Optimization**: Intelligent gas estimation and nonce management
|
62
|
+
|
63
|
+
## ✨ Key Features
|
64
|
+
|
65
|
+
🤖 **AI-Powered**: Built-in LLM integration for intelligent decision making
|
66
|
+
🔒 **Secure**: Enterprise-grade security with best practices built-in
|
67
|
+
🚀 **High Performance**: Optimized for Flow EVM with robust RPC handling
|
68
|
+
🛠️ **Developer Friendly**: Simple API design for beginners and experts
|
69
|
+
🌐 **Universal**: Works in Node.js environments
|
70
|
+
📊 **Comprehensive**: Complete toolkit for blockchain applications
|
71
|
+
🎯 **Real-time**: Live blockchain event monitoring and response
|
72
|
+
📝 **Type-safe**: Full TypeScript support with smart contract interactions
|
73
|
+
🔍 **Observable**: Comprehensive logging and error tracking
|
74
|
+
🧠 **Memory**: Vector-based knowledge storage with ChromaDB integration
|
75
|
+
|
76
|
+
## 🛠️ Installation
|
77
|
+
|
78
|
+
### Basic Installation
|
79
|
+
```bash
|
80
|
+
npm install flow-evm-agentkit
|
81
|
+
```
|
82
|
+
|
83
|
+
### For AI Integration (LangChain)
|
84
|
+
```bash
|
85
|
+
npm install flow-evm-agentkit @langchain/openai @langchain/core
|
86
|
+
```
|
87
|
+
|
88
|
+
### For TypeScript projects:
|
89
|
+
```bash
|
90
|
+
npm install --save-dev @types/node typescript
|
91
|
+
```
|
92
|
+
|
93
|
+
## 🏗️ Basic Usage
|
94
|
+
|
95
|
+
### 1. Environment Setup
|
96
|
+
|
97
|
+
Create a `.env` file in your project root:
|
98
|
+
|
99
|
+
```bash
|
100
|
+
# Flow EVM Network Configuration
|
101
|
+
FLOW_RPC_URL=https://testnet.evm.nodes.onflow.org
|
102
|
+
PRIVATE_KEY=your-private-key-here
|
103
|
+
|
104
|
+
# For AI Integration (Optional)
|
105
|
+
OPENAI_API_KEY=your-openai-api-key-here
|
106
|
+
|
107
|
+
# Agent Configuration
|
108
|
+
AGENT_NAME=MyFlowAgent
|
109
|
+
LOG_LEVEL=info
|
110
|
+
POLLING_INTERVAL=5000
|
111
|
+
```
|
112
|
+
|
113
|
+
⚠️ **Security Warning**: Never commit your `.env` file to version control! Add it to `.gitignore`.
|
114
|
+
|
115
|
+
### 2. Initialize the Agent
|
116
|
+
|
117
|
+
```typescript
|
118
|
+
import { Agent, Config } from 'flow-evm-agentkit';
|
119
|
+
import { config } from 'dotenv';
|
120
|
+
|
121
|
+
config(); // Load environment variables
|
122
|
+
|
123
|
+
const agentConfig = Config.load();
|
124
|
+
const agent = new Agent(agentConfig);
|
125
|
+
|
126
|
+
console.log('Agent initialized for address:', agent.getStatus().address);
|
127
|
+
```
|
128
|
+
|
129
|
+
### 3. Basic Agent Operations
|
130
|
+
|
131
|
+
```typescript
|
132
|
+
// Start the agent
|
133
|
+
await agent.start();
|
134
|
+
|
135
|
+
// Add goals for the agent
|
136
|
+
agent.addGoal('Monitor Flow EVM for trading opportunities');
|
137
|
+
agent.addGoal('Maintain a minimum balance of 10 FLOW');
|
138
|
+
|
139
|
+
// Handle events
|
140
|
+
agent.on('event', (event) => {
|
141
|
+
if (event.type === 'transaction') {
|
142
|
+
console.log('New transaction observed:', event.data.transaction.hash);
|
143
|
+
}
|
144
|
+
});
|
145
|
+
```
|
146
|
+
|
147
|
+
### 4. Send Transactions
|
148
|
+
|
149
|
+
```typescript
|
150
|
+
// The agent can execute transactions through goals
|
151
|
+
agent.addGoal('Transfer 1 FLOW to 0x742d35Cc8C15C80085E31c65E8bB38C98b2a3B86');
|
152
|
+
|
153
|
+
// Or query for current state
|
154
|
+
const balance = await agent.query('What is my current FLOW balance?');
|
155
|
+
console.log('Balance response:', balance);
|
156
|
+
```
|
157
|
+
|
158
|
+
### 5. Smart Contract Interactions
|
159
|
+
|
160
|
+
```typescript
|
161
|
+
// Deploy a contract
|
162
|
+
agent.addGoal('Deploy an ERC-20 token contract with symbol "MYTOKEN"');
|
163
|
+
|
164
|
+
// Interact with existing contracts
|
165
|
+
agent.addGoal('Call the transfer function on contract 0x... to send 100 tokens');
|
166
|
+
```
|
167
|
+
|
168
|
+
### 6. Monitor Blockchain Events
|
169
|
+
|
170
|
+
```typescript
|
171
|
+
// The agent automatically monitors events, but you can listen to them
|
172
|
+
agent.on('event', (event) => {
|
173
|
+
switch (event.type) {
|
174
|
+
case 'transaction':
|
175
|
+
console.log('Transaction detected:', {
|
176
|
+
hash: event.data.transaction.hash,
|
177
|
+
value: event.data.transaction.value
|
178
|
+
});
|
179
|
+
break;
|
180
|
+
case 'log':
|
181
|
+
console.log('Contract event:', {
|
182
|
+
address: event.data.log.address,
|
183
|
+
topics: event.data.log.topics
|
184
|
+
});
|
185
|
+
break;
|
186
|
+
}
|
187
|
+
});
|
188
|
+
```
|
189
|
+
|
190
|
+
### 7. Query Agent Intelligence
|
191
|
+
|
192
|
+
```typescript
|
193
|
+
// Ask the agent questions about the blockchain
|
194
|
+
const response = await agent.query('What was the last transaction I sent?');
|
195
|
+
console.log('Agent response:', response);
|
196
|
+
|
197
|
+
// Get agent status
|
198
|
+
const status = agent.getStatus();
|
199
|
+
console.log('Agent status:', {
|
200
|
+
running: status.running,
|
201
|
+
goals: status.goals.length,
|
202
|
+
recentTasks: status.recentTasks.length
|
203
|
+
});
|
204
|
+
```
|
205
|
+
|
206
|
+
## 🌐 Server Deployment
|
207
|
+
|
208
|
+
For public deployment on Replit or other platforms:
|
209
|
+
|
210
|
+
```typescript
|
211
|
+
import express from 'express';
|
212
|
+
import { Agent, Config } from 'flow-evm-agentkit';
|
213
|
+
|
214
|
+
const app = express();
|
215
|
+
const PORT = process.env.PORT || 5000;
|
216
|
+
|
217
|
+
async function main() {
|
218
|
+
const config = Config.load();
|
219
|
+
const agent = new Agent(config);
|
220
|
+
|
221
|
+
await agent.start();
|
222
|
+
|
223
|
+
app.get('/', (req, res) => {
|
224
|
+
res.json({
|
225
|
+
message: 'Flow EVM Agent is running!',
|
226
|
+
status: agent.getStatus()
|
227
|
+
});
|
228
|
+
});
|
229
|
+
|
230
|
+
app.get('/query/:question', async (req, res) => {
|
231
|
+
try {
|
232
|
+
const response = await agent.query(req.params.question);
|
233
|
+
res.json({ response });
|
234
|
+
} catch (error) {
|
235
|
+
res.status(500).json({ error: error.message });
|
236
|
+
}
|
237
|
+
});
|
238
|
+
|
239
|
+
app.listen(PORT, '0.0.0.0', () => {
|
240
|
+
console.log(`Flow EVM Agent server running on port ${PORT}`);
|
241
|
+
});
|
242
|
+
}
|
243
|
+
|
244
|
+
main().catch(console.error);
|
245
|
+
```
|
246
|
+
|
247
|
+
## 🤖 AI Integration with LangChain
|
248
|
+
|
249
|
+
Create intelligent blockchain agents with AI decision-making:
|
250
|
+
|
251
|
+
```typescript
|
252
|
+
import { Agent, Config } from 'flow-evm-agentkit';
|
253
|
+
|
254
|
+
const config = Config.load();
|
255
|
+
const agent = new Agent(config);
|
256
|
+
|
257
|
+
// The agent will use AI for planning if OpenAI key is provided
|
258
|
+
agent.addGoal('Analyze market conditions and execute optimal trades');
|
259
|
+
agent.addGoal('Monitor for arbitrage opportunities');
|
260
|
+
|
261
|
+
await agent.start();
|
262
|
+
|
263
|
+
// The agent will automatically use LLM for intelligent planning
|
264
|
+
const response = await agent.query('Should I buy or sell based on current market conditions?');
|
265
|
+
console.log('AI recommendation:', response);
|
266
|
+
```
|
267
|
+
|
268
|
+
## 🏗️ Architecture
|
269
|
+
|
270
|
+
The SDK is organized into intelligent, modular services:
|
271
|
+
|
272
|
+
```
|
273
|
+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
274
|
+
│ Observer │ │ Planner │ │ Executor │
|
275
|
+
│ │ │ │ │ │
|
276
|
+
│ • Event Filters │───▶│ • LLM Decision │───▶│ • Tx Execution │
|
277
|
+
│ • Block Monitor │ │ • Task Planning │ │ • Gas Estimation│
|
278
|
+
│ • Log Parsing │ │ • Goal Setting │ │ • Nonce Mgmt │
|
279
|
+
└─────────────────┘ └─────────────────┘ └─────────────────┘
|
280
|
+
│ │ │
|
281
|
+
└───────────────────────┼───────────────────────┘
|
282
|
+
▼
|
283
|
+
┌─────────────────┐
|
284
|
+
│ Knowledge │
|
285
|
+
│ │
|
286
|
+
│ • Vector Store │
|
287
|
+
│ • Memory Logs │
|
288
|
+
│ • Embeddings │
|
289
|
+
└─────────────────┘
|
290
|
+
```
|
291
|
+
|
292
|
+
**Core Modules:**
|
293
|
+
- **Agent**: Main orchestrator with autonomous decision-making
|
294
|
+
- **Observer**: Real-time blockchain monitoring and event detection
|
295
|
+
- **Executor**: Transaction execution with gas optimization
|
296
|
+
- **Planner**: AI-powered decision making and task planning
|
297
|
+
- **Knowledge**: Vector-based memory storage and retrieval
|
298
|
+
|
299
|
+
## ⚠️ Error Handling
|
300
|
+
|
301
|
+
Built-in error handling with detailed error types:
|
302
|
+
|
303
|
+
```typescript
|
304
|
+
try {
|
305
|
+
await agent.start();
|
306
|
+
} catch (error) {
|
307
|
+
console.error('Agent failed to start:', error.message);
|
308
|
+
}
|
309
|
+
|
310
|
+
// Listen to agent events for error monitoring
|
311
|
+
agent.on('error', (error) => {
|
312
|
+
console.error('Agent error:', error);
|
313
|
+
});
|
314
|
+
```
|
315
|
+
|
316
|
+
## 🔧 Troubleshooting
|
317
|
+
|
318
|
+
**Common Issues:**
|
319
|
+
|
320
|
+
- **"Missing environment variables"** → Check your `.env` file and `config()` call
|
321
|
+
- **"Failed to connect to Flow EVM"** → Verify `FLOW_RPC_URL` is correct
|
322
|
+
- **"Transaction failed"** → Check balance and gas fees
|
323
|
+
- **"Agent not responding"** → Check OpenAI API key for AI features
|
324
|
+
|
325
|
+
**Performance Tips:**
|
326
|
+
- Reuse agent instances instead of creating new ones
|
327
|
+
- Monitor gas prices before executing transactions
|
328
|
+
- Use appropriate polling intervals for your use case
|
329
|
+
- Implement proper error handling and retries
|
330
|
+
|
331
|
+
## 🛠️ Development
|
332
|
+
|
333
|
+
```bash
|
334
|
+
# Install dependencies
|
335
|
+
npm install
|
336
|
+
|
337
|
+
# Build the project
|
338
|
+
npm run build
|
339
|
+
|
340
|
+
# Run tests
|
341
|
+
npm test
|
342
|
+
|
343
|
+
# Start development mode
|
344
|
+
npm run dev
|
345
|
+
|
346
|
+
# Run linter
|
347
|
+
npm run lint
|
348
|
+
```
|
349
|
+
|
350
|
+
## 📋 Environment Variables
|
351
|
+
|
352
|
+
| Variable | Description | Required |
|
353
|
+
|----------|-------------|----------|
|
354
|
+
| `FLOW_RPC_URL` | Flow EVM RPC endpoint | ✅ Yes |
|
355
|
+
| `PRIVATE_KEY` | Your private key | ✅ Yes |
|
356
|
+
| `OPENAI_API_KEY` | OpenAI API key (for AI features) | ❌ Optional |
|
357
|
+
| `AGENT_NAME` | Agent identifier | ❌ Optional |
|
358
|
+
| `LOG_LEVEL` | Logging level ('info', 'debug', 'error') | ❌ Optional |
|
359
|
+
| `POLLING_INTERVAL` | Event polling interval in ms | ❌ Optional |
|
360
|
+
|
361
|
+
## 📚 Examples
|
362
|
+
|
363
|
+
### Transaction Monitor Agent
|
364
|
+
```typescript
|
365
|
+
import { Agent, Config } from 'flow-evm-agentkit';
|
366
|
+
|
367
|
+
const agent = new Agent(Config.load());
|
368
|
+
agent.addGoal('Monitor and log all transactions on Flow EVM');
|
369
|
+
|
370
|
+
agent.on('event', (event) => {
|
371
|
+
if (event.type === 'transaction') {
|
372
|
+
console.log('New transaction:', event.data.transaction.hash);
|
373
|
+
}
|
374
|
+
});
|
375
|
+
|
376
|
+
await agent.start();
|
377
|
+
```
|
378
|
+
|
379
|
+
### Trading Bot Agent
|
380
|
+
```typescript
|
381
|
+
const agent = new Agent(Config.load());
|
382
|
+
agent.addGoal('Execute trades when price conditions are favorable');
|
383
|
+
agent.addGoal('Maintain portfolio balance above 100 FLOW');
|
384
|
+
|
385
|
+
await agent.start();
|
386
|
+
```
|
387
|
+
|
388
|
+
## 📚 Documentation & Resources
|
389
|
+
|
390
|
+
- 🌐 **Flow Developer Portal**: [developers.flow.com](https://developers.flow.com)
|
391
|
+
- 🔍 **Flow EVM Testnet Explorer**: [evm-testnet.flowscan.org](https://evm-testnet.flowscan.org)
|
392
|
+
- 📖 **Flow EVM Documentation**: [developers.flow.com/evm](https://developers.flow.com/evm)
|
393
|
+
- 🌉 **Flow EVM Bridge**: [bridge.flow.com](https://bridge.flow.com)
|
394
|
+
|
395
|
+
## 🤝 Contributing
|
396
|
+
|
397
|
+
We welcome contributions from the community!
|
398
|
+
|
399
|
+
1. Fork the repository
|
400
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
401
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
402
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
403
|
+
5. Create a new Pull Request
|
404
|
+
|
405
|
+
Please open issues for bugs, questions, or feature requests.
|
406
|
+
|
407
|
+
## 📄 License
|
408
|
+
|
409
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
410
|
+
|
411
|
+
## 🔒 Legal and Privacy
|
412
|
+
|
413
|
+
This SDK is provided as-is for educational and development purposes. Users are responsible for:
|
414
|
+
- Securing their private keys and API credentials
|
415
|
+
- Complying with local regulations regarding blockchain interactions
|
416
|
+
- Understanding the risks of autonomous agent operations
|
417
|
+
- Monitoring agent behavior in production environments
|
418
|
+
|
419
|
+
---
|
420
|
+
|
421
|
+
**Ready to build intelligent agents on Flow EVM?** Start with the Quick Start above and explore the power of AI-driven blockchain automation!
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/cli/scaffold.ts"],"names":[],"mappings":"AAQA,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAiBD,iBAAe,aAAa,CAAC,OAAO,EAAE,eAAe,iBA+GpD;AAuQD,OAAO,EAAE,aAAa,EAAE,CAAC"}
|