@goat-sdk/wallet-evm
Advanced tools
| import{a as o}from"./chunk-YSXGDEY5.mjs";import{PluginBase as c,createTool as d}from"@goat-sdk/core";import{parseEther as m}from"viem";import*as h from"viem/chains";import{z as r}from"zod";var a=class extends c{static{o(this,"SendETHPlugin")}constructor(){super("sendETH",[])}supportsChain=o(e=>e.type==="evm","supportsChain");getTools(e){return[d({name:`send_${i(e.getChain().id).symbol}`,description:`Send ${i(e.getChain().id).symbol} to an address.`,parameters:u},t=>T(e,t))]}},f=o(()=>new a,"sendETH"),u=r.object({to:r.string().describe("The address to send ETH to"),amount:r.string().describe("The amount of ETH to send")});async function T(s,e){try{let n=m(e.amount);return(await s.sendTransaction({to:e.to,value:n})).hash}catch(n){throw new Error(`Failed to send ${i(s.getChain().id)}: ${n}`)}}o(T,"sendETHMethod");function i(s){let n=Object.values(h).find(t=>t.id===s);return n?{symbol:n.nativeCurrency.symbol,name:n.nativeCurrency.name,decimals:n.nativeCurrency.decimals}:{symbol:"ETH",name:"ETH",decimals:18}}o(i,"getChainToken");export{a,f as b}; |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } var _class;var _chunkEI7MMDWYjs = require('./chunk-EI7MMDWY.js');var _core = require('@goat-sdk/core');var _viem = require('viem');var _chains = require('viem/chains'); var h = _interopRequireWildcard(_chains);var _zod = require('zod');var a= (_class =class extends _core.PluginBase{static{_chunkEI7MMDWYjs.a.call(void 0, this,"SendETHPlugin")}constructor(){super("sendETH",[]);_class.prototype.__init.call(this);}__init() {this.supportsChain=_chunkEI7MMDWYjs.a.call(void 0, e=>e.type==="evm","supportsChain")}getTools(e){return[_core.createTool.call(void 0, {name:`send_${i(e.getChain().id).symbol}`,description:`Send ${i(e.getChain().id).symbol} to an address.`,parameters:u},t=>T(e,t))]}}, _class),b= exports.b =_chunkEI7MMDWYjs.a.call(void 0, ()=>new a,"sendETH"),u=_zod.z.object({to:_zod.z.string().describe("The address to send ETH to"),amount:_zod.z.string().describe("The amount of ETH to send")});async function T(s,e){try{let n=_viem.parseEther.call(void 0, e.amount);return(await s.sendTransaction({to:e.to,value:n})).hash}catch(n){throw new Error(`Failed to send ${i(s.getChain().id)}: ${n}`)}}_chunkEI7MMDWYjs.a.call(void 0, T,"sendETHMethod");function i(s){let n=Object.values(h).find(t=>t.id===s);return n?{symbol:n.nativeCurrency.symbol,name:n.nativeCurrency.name,decimals:n.nativeCurrency.decimals}:{symbol:"ETH",name:"ETH",decimals:18}}_chunkEI7MMDWYjs.a.call(void 0, i,"getChainToken");exports.a = a; exports.b = b; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-VQHFGGR7.js');var _chunkP4XF23GXjs = require('./chunk-P4XF23GX.js');var _chunk7LYFZ5ZNjs = require('./chunk-7LYFZ5ZN.js');var _chunkHO3OIYC5js = require('./chunk-HO3OIYC5.js');require('./chunk-EI7MMDWY.js');require('./chunk-G2UI43AF.js');require('./chunk-Q27JQKTX.js');require('./chunk-D4GZ5WLQ.js');require('./chunk-7YBI42YF.js');exports.EVMSmartWalletClient = _chunkP4XF23GXjs.a; exports.EVMWalletClient = _chunk7LYFZ5ZNjs.a; exports.SendETHPlugin = _chunkHO3OIYC5js.a; exports.sendETH = _chunkHO3OIYC5js.b; | ||
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-VQHFGGR7.js');var _chunkP4XF23GXjs = require('./chunk-P4XF23GX.js');var _chunk7LYFZ5ZNjs = require('./chunk-7LYFZ5ZN.js');var _chunkH6KQMB7Xjs = require('./chunk-H6KQMB7X.js');require('./chunk-EI7MMDWY.js');require('./chunk-G2UI43AF.js');require('./chunk-Q27JQKTX.js');require('./chunk-D4GZ5WLQ.js');require('./chunk-7YBI42YF.js');exports.EVMSmartWalletClient = _chunkP4XF23GXjs.a; exports.EVMWalletClient = _chunk7LYFZ5ZNjs.a; exports.SendETHPlugin = _chunkH6KQMB7Xjs.a; exports.sendETH = _chunkH6KQMB7Xjs.b; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| import"./chunk-5FBYVXPD.mjs";import{a as r}from"./chunk-QQE6GY6U.mjs";import{a as o}from"./chunk-LH6LE2QP.mjs";import{a as e,b as f}from"./chunk-RATN5R3A.mjs";import"./chunk-YSXGDEY5.mjs";import"./chunk-JKZZRC57.mjs";import"./chunk-TILO4CTR.mjs";import"./chunk-RSMO7DOJ.mjs";import"./chunk-TB5UT6ZN.mjs";export{r as EVMSmartWalletClient,o as EVMWalletClient,e as SendETHPlugin,f as sendETH}; | ||
| import"./chunk-5FBYVXPD.mjs";import{a as r}from"./chunk-QQE6GY6U.mjs";import{a as o}from"./chunk-LH6LE2QP.mjs";import{a as e,b as f}from"./chunk-25XBPQGK.mjs";import"./chunk-YSXGDEY5.mjs";import"./chunk-JKZZRC57.mjs";import"./chunk-TILO4CTR.mjs";import"./chunk-RSMO7DOJ.mjs";import"./chunk-TB5UT6ZN.mjs";export{r as EVMSmartWalletClient,o as EVMWalletClient,e as SendETHPlugin,f as sendETH}; |
@@ -1,1 +0,1 @@ | ||
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHO3OIYC5js = require('./chunk-HO3OIYC5.js');require('./chunk-EI7MMDWY.js');exports.SendETHPlugin = _chunkHO3OIYC5js.a; exports.sendETH = _chunkHO3OIYC5js.b; | ||
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkH6KQMB7Xjs = require('./chunk-H6KQMB7X.js');require('./chunk-EI7MMDWY.js');exports.SendETHPlugin = _chunkH6KQMB7Xjs.a; exports.sendETH = _chunkH6KQMB7Xjs.b; |
@@ -1,1 +0,1 @@ | ||
| import{a,b}from"./chunk-RATN5R3A.mjs";import"./chunk-YSXGDEY5.mjs";export{a as SendETHPlugin,b as sendETH}; | ||
| import{a,b}from"./chunk-25XBPQGK.mjs";import"./chunk-YSXGDEY5.mjs";export{a as SendETHPlugin,b as sendETH}; |
+1
-1
| { | ||
| "name": "@goat-sdk/wallet-evm", | ||
| "version": "0.2.6", | ||
| "version": "0.2.7", | ||
| "sideEffects": false, | ||
@@ -5,0 +5,0 @@ "files": [ |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } var _class;var _chunkEI7MMDWYjs = require('./chunk-EI7MMDWY.js');var _core = require('@goat-sdk/core');var _viem = require('viem');var _chains = require('viem/chains'); var h = _interopRequireWildcard(_chains);var _zod = require('zod');var a= (_class =class extends _core.PluginBase{static{_chunkEI7MMDWYjs.a.call(void 0, this,"SendETHPlugin")}constructor(){super("sendETH",[]);_class.prototype.__init.call(this);}__init() {this.supportsChain=_chunkEI7MMDWYjs.a.call(void 0, e=>e.type==="evm","supportsChain")}getTools(e){return[_core.createTool.call(void 0, {name:`send_${i(e.getChain().id).symbol}`,description:`Send ${i(e.getChain().id).symbol} to an address.`,parameters:u},s=>p(e,s))]}}, _class),f= exports.b =_chunkEI7MMDWYjs.a.call(void 0, ()=>new a,"sendETH"),u=_zod.z.object({to:_zod.z.string().describe("The address to send ETH to"),amount:_zod.z.string().describe("The amount of ETH to send")});async function p(o,e){try{let n=_viem.parseEther.call(void 0, e.amount);return(await o.sendTransaction({to:e.to,value:n})).hash}catch(n){throw new Error(`Failed to send ${i(o.getChain().id)}: ${n}`)}}_chunkEI7MMDWYjs.a.call(void 0, p,"sendETHMethod");function i(o){let n=Object.values(h).find(s=>s.id===o);if(!n)throw new Error(`Unsupported EVM chain ID: ${o}`);return{symbol:n.nativeCurrency.symbol,name:n.nativeCurrency.name,decimals:n.nativeCurrency.decimals}}_chunkEI7MMDWYjs.a.call(void 0, i,"getChainToken");exports.a = a; exports.b = f; |
| import{a as t}from"./chunk-YSXGDEY5.mjs";import{PluginBase as c,createTool as d}from"@goat-sdk/core";import{parseEther as m}from"viem";import*as h from"viem/chains";import{z as r}from"zod";var a=class extends c{static{t(this,"SendETHPlugin")}constructor(){super("sendETH",[])}supportsChain=t(e=>e.type==="evm","supportsChain");getTools(e){return[d({name:`send_${i(e.getChain().id).symbol}`,description:`Send ${i(e.getChain().id).symbol} to an address.`,parameters:u},s=>p(e,s))]}},C=t(()=>new a,"sendETH"),u=r.object({to:r.string().describe("The address to send ETH to"),amount:r.string().describe("The amount of ETH to send")});async function p(o,e){try{let n=m(e.amount);return(await o.sendTransaction({to:e.to,value:n})).hash}catch(n){throw new Error(`Failed to send ${i(o.getChain().id)}: ${n}`)}}t(p,"sendETHMethod");function i(o){let n=Object.values(h).find(s=>s.id===o);if(!n)throw new Error(`Unsupported EVM chain ID: ${o}`);return{symbol:n.nativeCurrency.symbol,name:n.nativeCurrency.name,decimals:n.nativeCurrency.decimals}}t(i,"getChainToken");export{a,C as b}; |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances
16249
-0.18%