@goat-sdk/wallet-evm
Advanced tools
+123
| declare const ERC20_ABI: readonly [{ | ||
| readonly constant: true; | ||
| readonly inputs: readonly []; | ||
| readonly name: "name"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "string"; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: true; | ||
| readonly inputs: readonly []; | ||
| readonly name: "symbol"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "string"; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: true; | ||
| readonly inputs: readonly []; | ||
| readonly name: "decimals"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "uint8"; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: true; | ||
| readonly inputs: readonly [{ | ||
| readonly name: "owner"; | ||
| readonly type: "address"; | ||
| }]; | ||
| readonly name: "balanceOf"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "uint256"; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: false; | ||
| readonly inputs: readonly [{ | ||
| readonly name: "to"; | ||
| readonly type: "address"; | ||
| }, { | ||
| readonly name: "value"; | ||
| readonly type: "uint256"; | ||
| }]; | ||
| readonly name: "transfer"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "bool"; | ||
| }]; | ||
| readonly stateMutability: "nonpayable"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: true; | ||
| readonly inputs: readonly [{ | ||
| readonly name: "owner"; | ||
| readonly type: "address"; | ||
| }, { | ||
| readonly name: "spender"; | ||
| readonly type: "address"; | ||
| }]; | ||
| readonly name: "allowance"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "uint256"; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: false; | ||
| readonly inputs: readonly [{ | ||
| readonly name: "spender"; | ||
| readonly type: "address"; | ||
| }, { | ||
| readonly name: "value"; | ||
| readonly type: "uint256"; | ||
| }]; | ||
| readonly name: "approve"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "bool"; | ||
| }]; | ||
| readonly stateMutability: "nonpayable"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: false; | ||
| readonly inputs: readonly [{ | ||
| readonly name: "from"; | ||
| readonly type: "address"; | ||
| }, { | ||
| readonly name: "to"; | ||
| readonly type: "address"; | ||
| }, { | ||
| readonly name: "value"; | ||
| readonly type: "uint256"; | ||
| }]; | ||
| readonly name: "transferFrom"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "bool"; | ||
| }]; | ||
| readonly stateMutability: "nonpayable"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: true; | ||
| readonly inputs: readonly []; | ||
| readonly name: "totalSupply"; | ||
| readonly outputs: readonly [{ | ||
| readonly type: "uint256"; | ||
| readonly name: ""; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }]; | ||
| export { ERC20_ABI }; |
+123
| declare const ERC20_ABI: readonly [{ | ||
| readonly constant: true; | ||
| readonly inputs: readonly []; | ||
| readonly name: "name"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "string"; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: true; | ||
| readonly inputs: readonly []; | ||
| readonly name: "symbol"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "string"; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: true; | ||
| readonly inputs: readonly []; | ||
| readonly name: "decimals"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "uint8"; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: true; | ||
| readonly inputs: readonly [{ | ||
| readonly name: "owner"; | ||
| readonly type: "address"; | ||
| }]; | ||
| readonly name: "balanceOf"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "uint256"; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: false; | ||
| readonly inputs: readonly [{ | ||
| readonly name: "to"; | ||
| readonly type: "address"; | ||
| }, { | ||
| readonly name: "value"; | ||
| readonly type: "uint256"; | ||
| }]; | ||
| readonly name: "transfer"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "bool"; | ||
| }]; | ||
| readonly stateMutability: "nonpayable"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: true; | ||
| readonly inputs: readonly [{ | ||
| readonly name: "owner"; | ||
| readonly type: "address"; | ||
| }, { | ||
| readonly name: "spender"; | ||
| readonly type: "address"; | ||
| }]; | ||
| readonly name: "allowance"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "uint256"; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: false; | ||
| readonly inputs: readonly [{ | ||
| readonly name: "spender"; | ||
| readonly type: "address"; | ||
| }, { | ||
| readonly name: "value"; | ||
| readonly type: "uint256"; | ||
| }]; | ||
| readonly name: "approve"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "bool"; | ||
| }]; | ||
| readonly stateMutability: "nonpayable"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: false; | ||
| readonly inputs: readonly [{ | ||
| readonly name: "from"; | ||
| readonly type: "address"; | ||
| }, { | ||
| readonly name: "to"; | ||
| readonly type: "address"; | ||
| }, { | ||
| readonly name: "value"; | ||
| readonly type: "uint256"; | ||
| }]; | ||
| readonly name: "transferFrom"; | ||
| readonly outputs: readonly [{ | ||
| readonly name: ""; | ||
| readonly type: "bool"; | ||
| }]; | ||
| readonly stateMutability: "nonpayable"; | ||
| readonly type: "function"; | ||
| }, { | ||
| readonly constant: true; | ||
| readonly inputs: readonly []; | ||
| readonly name: "totalSupply"; | ||
| readonly outputs: readonly [{ | ||
| readonly type: "uint256"; | ||
| readonly name: ""; | ||
| }]; | ||
| readonly stateMutability: "view"; | ||
| readonly type: "function"; | ||
| }]; | ||
| export { ERC20_ABI }; |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNPSGHTUWjs = require('./chunk-NPSGHTUW.js');require('./chunk-EI7MMDWY.js');exports.ERC20_ABI = _chunkNPSGHTUWjs.a; |
| import{a}from"./chunk-5LTZEZUT.mjs";import"./chunk-YSXGDEY5.mjs";export{a as ERC20_ABI}; |
| var n=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"owner",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{type:"uint256",name:""}],stateMutability:"view",type:"function"}];export{n as a}; |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkNPSGHTUWjs = require('./chunk-NPSGHTUW.js');var _chunkD6CXV7AOjs = require('./chunk-D6CXV7AO.js');var _chunkNLS5UWPFjs = require('./chunk-NLS5UWPF.js');var _chunkEI7MMDWYjs = require('./chunk-EI7MMDWY.js');var _core = require('@goat-sdk/core');var _viem = require('viem');var S=class extends _core.WalletClientBase{static{_chunkEI7MMDWYjs.a.call(void 0, this,"EVMWalletClient")}constructor({tokens:t=_chunkNLS5UWPFjs.e,enableSend:r=!0}={}){super(),this.tokens=t,this.enableSend=r}async balanceOf(t,r){let a=this.getChain();if(r)try{let[e,n,i,l]=await Promise.all([this.read({address:r,abi:_chunkNPSGHTUWjs.a,functionName:"balanceOf",args:[t]}),this.read({address:r,abi:_chunkNPSGHTUWjs.a,functionName:"decimals"}),this.read({address:r,abi:_chunkNPSGHTUWjs.a,functionName:"name"}),this.read({address:r,abi:_chunkNPSGHTUWjs.a,functionName:"symbol"})]);if(e.value===void 0||n.value===void 0||i.value===void 0||l.value===void 0)throw new Error("Incomplete token information received.");let m=String(e.value),d=Number(n.value),T=_viem.formatUnits.call(void 0, BigInt(m),d);return{decimals:d,symbol:String(l.value),name:String(i.value),value:T,inBaseUnits:m}}catch(e){throw console.error(`Failed to fetch ERC20 balance for ${r}: ${e}`),new Error(`Failed to fetch balance for token ${r}: ${e instanceof Error?e.message:String(e)}`)}try{let e=await this.getNativeBalance(),n=18,i=_viem.formatUnits.call(void 0, e,n);return{decimals:n,symbol:a.nativeCurrency.symbol,name:a.nativeCurrency.name,value:i,inBaseUnits:String(e)}}catch(e){throw console.error(`Failed to fetch native balance: ${e}`),new Error(`Failed to fetch native balance: ${e instanceof Error?e.message:String(e)}`)}}async getTokenInfoByTicker(t){let r=this.getChain(),a=t.toUpperCase(),e=this.tokens.find(n=>n.symbol.toUpperCase()===a);if(e){let n=_optionalChain([e, 'access', _2 => _2.chains, 'access', _3 => _3[r.id], 'optionalAccess', _4 => _4.contractAddress]);if(!n)throw new Error(`Token ${t} configured but not found on chain ${r.id}`);return{symbol:e.symbol,contractAddress:n,decimals:e.decimals,name:e.name}}if(a===r.nativeCurrency.symbol.toUpperCase()||a==="ETH")return{symbol:r.nativeCurrency.symbol,contractAddress:"",decimals:18,name:r.nativeCurrency.name};throw new Error(`Token with ticker ${t} not found or not configured for chain ${r.id}`)}async _getTokenDecimals(t){if(t)try{let r=await this.read({address:t,abi:_chunkNPSGHTUWjs.a,functionName:"decimals"});if(r.value===void 0)throw new Error("Could not retrieve decimals.");return Number(r.value)}catch(r){throw console.error(`Failed to fetch decimals for token ${t}: ${r}`),new Error(`Failed to fetch decimals for token ${t}: ${r instanceof Error?r.message:String(r)}`)}return 18}async convertToBaseUnits(t){let{amount:r,tokenAddress:a}=t,e=await this._getTokenDecimals(a);try{let n=Number.parseFloat(r);if(Number.isNaN(n)||!Number.isFinite(n))throw new Error(`Invalid amount format: ${r}`);let i=_viem.parseUnits.call(void 0, r,e);return String(i)}catch(n){throw console.error(`Failed to convert amount ${r} to base units with ${e} decimals: ${n}`),new Error(`Failed to convert amount to base units: ${n instanceof Error?n.message:String(n)}`)}}async convertFromBaseUnits(t){let{amount:r,tokenAddress:a}=t;if(!/^\d+$/.test(r))throw new Error(`Invalid base unit amount format: ${r}`);let e=await this._getTokenDecimals(a);try{return _viem.formatUnits.call(void 0, BigInt(r),e)}catch(n){throw console.error(`Failed to convert base amount ${r} from base units with ${e} decimals: ${n}`),new Error(`Failed to convert amount from base units: ${n instanceof Error?n.message:String(n)}`)}}async sendToken(t){if(!this.enableSend)throw new Error("Sending tokens is disabled for this wallet instance.");let{recipient:r,amountInBaseUnits:a,tokenAddress:e}=t;try{return e?this.sendTransaction({to:e,abi:_chunkNPSGHTUWjs.a,functionName:"transfer",args:[r,BigInt(a)]}):this.sendTransaction({to:r,value:BigInt(a)})}catch(n){throw console.error(`Failed to send token: ${n}`),new Error(`Failed to send token: ${n instanceof Error?n.message:String(n)}`)}}async getTokenAllowance(t){try{let{tokenAddress:r,owner:a,spender:e}=t,n=await this.read({address:r,abi:_chunkNPSGHTUWjs.a,functionName:"allowance",args:[a,e]});if(n.value===void 0)throw new Error("Could not retrieve allowance.");return String(n.value)}catch(r){throw console.error(`Failed to fetch allowance: ${r}`),Error(`Failed to fetch allowance: ${r instanceof Error?r.message:String(r)}`)}}async approve(t){if(!this.enableSend)throw new Error("Approval operations are disabled for this wallet instance.");try{let{tokenAddress:r,spender:a,amount:e}=t;if(!/^\d+$/.test(e))throw new Error(`Invalid base unit amount format for approval: ${e}`);return this.sendTransaction({to:r,abi:_chunkNPSGHTUWjs.a,functionName:"approve",args:[a,BigInt(e)]})}catch(r){throw console.error(`Failed to approve: ${r}`),Error(`Failed to approve: ${r instanceof Error?r.message:String(r)}`)}}async revokeApproval(t){if(!this.enableSend)throw new Error("Approval operations are disabled for this wallet instance.");return this.approve({...t,amount:"0"})}getCoreTools(){let t=super.getCoreTools().filter(e=>e.name!=="get_balance"),r=[_core.createTool.call(void 0, {name:"get_balance",description:"Get the balance of the wallet for native currency or a specific ERC20 token.",parameters:_chunkD6CXV7AOjs.a},e=>this.balanceOf(e.address,e.tokenAddress)),_core.createTool.call(void 0, {name:"get_token_info_by_ticker",description:"Get information about a configured token (like contract address and decimals) by its ticker symbol.",parameters:_chunkD6CXV7AOjs.c},e=>this.getTokenInfoByTicker(e.ticker)),_core.createTool.call(void 0, {name:"convert_to_base_units",description:"Convert a token amount from human-readable units to its smallest unit (e.g., wei).",parameters:_chunkD6CXV7AOjs.d},e=>this.convertToBaseUnits(e)),_core.createTool.call(void 0, {name:"convert_from_base_units",description:"Convert a token amount from its smallest unit (e.g., wei) to human-readable units.",parameters:_chunkD6CXV7AOjs.e},e=>this.convertFromBaseUnits(e)),_core.createTool.call(void 0, {name:"sign_typed_data_evm",description:"Sign an EIP-712 typed data structure (EVM)",parameters:_chunkD6CXV7AOjs.f},e=>this.signTypedData(e)),_core.createTool.call(void 0, {name:"get_token_allowance_evm",description:"Get the allowance of an ERC20 token for a spender (returns amount in base units)",parameters:_chunkD6CXV7AOjs.g},e=>this.getTokenAllowance(e))],a=[];return this.enableSend&&a.push(_core.createTool.call(void 0, {name:"send_token",description:"Send native currency or an ERC20 token to a recipient, in base units.",parameters:_chunkD6CXV7AOjs.b},e=>{if(!this.enableSend)throw new Error("Sending transactions is disabled for this wallet.");return this.sendToken(e)}),_core.createTool.call(void 0, {name:"approve_token_evm",description:"Approve an amount (specified in base units) of an ERC20 token for a spender",parameters:_chunkD6CXV7AOjs.h},e=>{if(!this.enableSend)throw new Error("Approval operations are disabled for this wallet instance.");return this.approve(e)}),_core.createTool.call(void 0, {name:"revoke_token_approval_evm",description:"Revoke approval for an ERC20 token from a spender (sets allowance to 0)",parameters:_chunkD6CXV7AOjs.i},e=>{if(!this.enableSend)throw new Error("Approval operations are disabled for this wallet instance.");return this.revokeApproval(e)})),[...t,...r,...a]}};exports.a = S; |
| import{a as o}from"./chunk-7QP2WIGH.mjs";import{a as e}from"./chunk-YSXGDEY5.mjs";var s=class extends o{static{e(this,"EVMSmartWalletClient")}};export{s as a}; |
| import{a as o}from"./chunk-5LTZEZUT.mjs";import{a as h,b as f,c as p,d as v,e as b,f as w,g,h as k,i as y}from"./chunk-UNOJYU6C.mjs";import{e as E}from"./chunk-7YKIZPCS.mjs";import{a as u}from"./chunk-YSXGDEY5.mjs";import{WalletClientBase as $,createTool as s}from"@goat-sdk/core";import{formatUnits as c,parseUnits as _}from"viem";var S=class extends ${static{u(this,"EVMWalletClient")}tokens;enableSend;constructor({tokens:t=E,enableSend:r=!0}={}){super(),this.tokens=t,this.enableSend=r}async balanceOf(t,r){let a=this.getChain();if(r)try{let[e,n,i,l]=await Promise.all([this.read({address:r,abi:o,functionName:"balanceOf",args:[t]}),this.read({address:r,abi:o,functionName:"decimals"}),this.read({address:r,abi:o,functionName:"name"}),this.read({address:r,abi:o,functionName:"symbol"})]);if(e.value===void 0||n.value===void 0||i.value===void 0||l.value===void 0)throw new Error("Incomplete token information received.");let m=String(e.value),d=Number(n.value),T=c(BigInt(m),d);return{decimals:d,symbol:String(l.value),name:String(i.value),value:T,inBaseUnits:m}}catch(e){throw console.error(`Failed to fetch ERC20 balance for ${r}: ${e}`),new Error(`Failed to fetch balance for token ${r}: ${e instanceof Error?e.message:String(e)}`)}try{let e=await this.getNativeBalance(),n=18,i=c(e,n);return{decimals:n,symbol:a.nativeCurrency.symbol,name:a.nativeCurrency.name,value:i,inBaseUnits:String(e)}}catch(e){throw console.error(`Failed to fetch native balance: ${e}`),new Error(`Failed to fetch native balance: ${e instanceof Error?e.message:String(e)}`)}}async getTokenInfoByTicker(t){let r=this.getChain(),a=t.toUpperCase(),e=this.tokens.find(n=>n.symbol.toUpperCase()===a);if(e){let n=e.chains[r.id]?.contractAddress;if(!n)throw new Error(`Token ${t} configured but not found on chain ${r.id}`);return{symbol:e.symbol,contractAddress:n,decimals:e.decimals,name:e.name}}if(a===r.nativeCurrency.symbol.toUpperCase()||a==="ETH")return{symbol:r.nativeCurrency.symbol,contractAddress:"",decimals:18,name:r.nativeCurrency.name};throw new Error(`Token with ticker ${t} not found or not configured for chain ${r.id}`)}async _getTokenDecimals(t){if(t)try{let r=await this.read({address:t,abi:o,functionName:"decimals"});if(r.value===void 0)throw new Error("Could not retrieve decimals.");return Number(r.value)}catch(r){throw console.error(`Failed to fetch decimals for token ${t}: ${r}`),new Error(`Failed to fetch decimals for token ${t}: ${r instanceof Error?r.message:String(r)}`)}return 18}async convertToBaseUnits(t){let{amount:r,tokenAddress:a}=t,e=await this._getTokenDecimals(a);try{let n=Number.parseFloat(r);if(Number.isNaN(n)||!Number.isFinite(n))throw new Error(`Invalid amount format: ${r}`);let i=_(r,e);return String(i)}catch(n){throw console.error(`Failed to convert amount ${r} to base units with ${e} decimals: ${n}`),new Error(`Failed to convert amount to base units: ${n instanceof Error?n.message:String(n)}`)}}async convertFromBaseUnits(t){let{amount:r,tokenAddress:a}=t;if(!/^\d+$/.test(r))throw new Error(`Invalid base unit amount format: ${r}`);let e=await this._getTokenDecimals(a);try{return c(BigInt(r),e)}catch(n){throw console.error(`Failed to convert base amount ${r} from base units with ${e} decimals: ${n}`),new Error(`Failed to convert amount from base units: ${n instanceof Error?n.message:String(n)}`)}}async sendToken(t){if(!this.enableSend)throw new Error("Sending tokens is disabled for this wallet instance.");let{recipient:r,amountInBaseUnits:a,tokenAddress:e}=t;try{return e?this.sendTransaction({to:e,abi:o,functionName:"transfer",args:[r,BigInt(a)]}):this.sendTransaction({to:r,value:BigInt(a)})}catch(n){throw console.error(`Failed to send token: ${n}`),new Error(`Failed to send token: ${n instanceof Error?n.message:String(n)}`)}}async getTokenAllowance(t){try{let{tokenAddress:r,owner:a,spender:e}=t,n=await this.read({address:r,abi:o,functionName:"allowance",args:[a,e]});if(n.value===void 0)throw new Error("Could not retrieve allowance.");return String(n.value)}catch(r){throw console.error(`Failed to fetch allowance: ${r}`),Error(`Failed to fetch allowance: ${r instanceof Error?r.message:String(r)}`)}}async approve(t){if(!this.enableSend)throw new Error("Approval operations are disabled for this wallet instance.");try{let{tokenAddress:r,spender:a,amount:e}=t;if(!/^\d+$/.test(e))throw new Error(`Invalid base unit amount format for approval: ${e}`);return this.sendTransaction({to:r,abi:o,functionName:"approve",args:[a,BigInt(e)]})}catch(r){throw console.error(`Failed to approve: ${r}`),Error(`Failed to approve: ${r instanceof Error?r.message:String(r)}`)}}async revokeApproval(t){if(!this.enableSend)throw new Error("Approval operations are disabled for this wallet instance.");return this.approve({...t,amount:"0"})}getCoreTools(){let t=super.getCoreTools().filter(e=>e.name!=="get_balance"),r=[s({name:"get_balance",description:"Get the balance of the wallet for native currency or a specific ERC20 token.",parameters:h},e=>this.balanceOf(e.address,e.tokenAddress)),s({name:"get_token_info_by_ticker",description:"Get information about a configured token (like contract address and decimals) by its ticker symbol.",parameters:p},e=>this.getTokenInfoByTicker(e.ticker)),s({name:"convert_to_base_units",description:"Convert a token amount from human-readable units to its smallest unit (e.g., wei).",parameters:v},e=>this.convertToBaseUnits(e)),s({name:"convert_from_base_units",description:"Convert a token amount from its smallest unit (e.g., wei) to human-readable units.",parameters:b},e=>this.convertFromBaseUnits(e)),s({name:"sign_typed_data_evm",description:"Sign an EIP-712 typed data structure (EVM)",parameters:w},e=>this.signTypedData(e)),s({name:"get_token_allowance_evm",description:"Get the allowance of an ERC20 token for a spender (returns amount in base units)",parameters:g},e=>this.getTokenAllowance(e))],a=[];return this.enableSend&&a.push(s({name:"send_token",description:"Send native currency or an ERC20 token to a recipient, in base units.",parameters:f},e=>{if(!this.enableSend)throw new Error("Sending transactions is disabled for this wallet.");return this.sendToken(e)}),s({name:"approve_token_evm",description:"Approve an amount (specified in base units) of an ERC20 token for a spender",parameters:k},e=>{if(!this.enableSend)throw new Error("Approval operations are disabled for this wallet instance.");return this.approve(e)}),s({name:"revoke_token_approval_evm",description:"Revoke approval for an ERC20 token from a spender (sets allowance to 0)",parameters:y},e=>{if(!this.enableSend)throw new Error("Approval operations are disabled for this wallet instance.");return this.revokeApproval(e)})),[...t,...r,...a]}};export{S as a}; |
| import{arbitrum as t,base as c,mainnet as d,mode as e,optimism as s,polygon as a,sepolia as r}from"viem/chains";var o={decimals:18,symbol:"PEPE",name:"Pepe",chains:{[d.id]:{contractAddress:"0x6982508145454Ce325dDbE47a25d4ec3d2311933"},[s.id]:{contractAddress:"0xc1c167cc44f7923cd0062c4370df962f9ddb16f5"},[c.id]:{contractAddress:"0xb4fde59a779991bfb6a52253b51947828b982be3"}}},n={decimals:6,symbol:"USDC",name:"USD Coin",chains:{[d.id]:{contractAddress:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"},[s.id]:{contractAddress:"0x0b2c639c533813f4aa9d7837caf62653d097ff85"},[a.id]:{contractAddress:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"},[c.id]:{contractAddress:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},84532:{contractAddress:"0x036CbD53842c5426634e7929541eC2318f3dCF7e"},[r.id]:{contractAddress:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"},[e.id]:{contractAddress:"0xd988097fb8612cc24eeC14542bC03424c656005f"}}},b={decimals:18,symbol:"MODE",name:"Mode",chains:{[e.id]:{contractAddress:"0xDfc7C877a950e49D2610114102175A06C2e3167a"}}},i={decimals:18,symbol:"WETH",name:"Wrapped Ether",chains:{[d.id]:{contractAddress:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"},[c.id]:{contractAddress:"0x4200000000000000000000000000000000000006"},[e.id]:{contractAddress:"0x4200000000000000000000000000000000000006"},[t.id]:{contractAddress:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"},[s.id]:{contractAddress:"0x4200000000000000000000000000000000000006"},[a.id]:{contractAddress:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619"}}},C=[o,n,b,i];export{o as a,n as b,b as c,i as d,C as e}; |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _zod = require('zod');var a=_zod.z.object({address:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The wallet address to check the balance for."),tokenAddress:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").optional().describe("Optional: The contract address of the ERC20 token. If omitted, the native currency balance is returned.").transform(t=>t)}),n= exports.b =_zod.z.object({recipient:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The recipient's EVM address.").transform(t=>t),amountInBaseUnits:_zod.z.string().describe("The amount of the token/native currency to send (in base units, e.g., '1000000000000000000')."),tokenAddress:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").optional().describe("Optional: The contract address of the ERC20 token to send. If omitted, the native currency is sent.").transform(t=>t)}),o= exports.c =_zod.z.object({ticker:_zod.z.string().describe("The ticker symbol of the token (e.g., 'ETH', 'USDC').")}),d= exports.d =_zod.z.object({amount:_zod.z.string().describe("The amount to convert (in human-readable units)."),tokenAddress:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").optional().describe("Optional: The contract address of the token. If omitted, native currency decimals are used.").transform(t=>t)}),i= exports.e =_zod.z.object({amount:_zod.z.string().regex(/^\d+$/,"Amount must be a non-negative integer string (base units).").describe("The amount to convert (in base units, e.g., wei)."),tokenAddress:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").optional().describe("Optional: The contract address of the token. If omitted, native currency decimals are used.").transform(t=>t)}),c= exports.f =_zod.z.object({domain:_zod.z.object({}).passthrough(),types:_zod.z.object({}).passthrough(),primaryType:_zod.z.string(),message:_zod.z.object({}).passthrough()}).passthrough().describe("The EIP-712 typed data structure to sign."),m= exports.g =_zod.z.object({tokenAddress:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The contract address of the ERC20 token.").transform(t=>t),owner:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The address of the token owner.").transform(t=>t),spender:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The address of the potential spender.").transform(t=>t)}),f= exports.h =_zod.z.object({tokenAddress:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The contract address of the ERC20 token.").transform(t=>t),spender:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The address to grant approval to.").transform(t=>t),amount:_zod.z.string().regex(/^\d+$/,"Amount must be a non-negative integer string (base units).").describe("The amount of tokens to approve (in base units).")}),g= exports.i =_zod.z.object({tokenAddress:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The contract address of the ERC20 token.").transform(t=>t),spender:_zod.z.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The address whose approval should be revoked.").transform(t=>t)});exports.a = a; exports.b = n; exports.c = o; exports.d = d; exports.e = i; exports.f = c; exports.g = m; exports.h = f; exports.i = g; |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5ZQCRQCRjs = require('./chunk-5ZQCRQCR.js');var _chunkEI7MMDWYjs = require('./chunk-EI7MMDWY.js');var s=class extends _chunk5ZQCRQCRjs.a{static{_chunkEI7MMDWYjs.a.call(void 0, this,"EVMSmartWalletClient")}};exports.a = s; |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chains = require('viem/chains');var o={decimals:18,symbol:"PEPE",name:"Pepe",chains:{[_chains.mainnet.id]:{contractAddress:"0x6982508145454Ce325dDbE47a25d4ec3d2311933"},[_chains.optimism.id]:{contractAddress:"0xc1c167cc44f7923cd0062c4370df962f9ddb16f5"},[_chains.base.id]:{contractAddress:"0xb4fde59a779991bfb6a52253b51947828b982be3"}}},n= exports.b ={decimals:6,symbol:"USDC",name:"USD Coin",chains:{[_chains.mainnet.id]:{contractAddress:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"},[_chains.optimism.id]:{contractAddress:"0x0b2c639c533813f4aa9d7837caf62653d097ff85"},[_chains.polygon.id]:{contractAddress:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359"},[_chains.base.id]:{contractAddress:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},84532:{contractAddress:"0x036CbD53842c5426634e7929541eC2318f3dCF7e"},[_chains.sepolia.id]:{contractAddress:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"},[_chains.mode.id]:{contractAddress:"0xd988097fb8612cc24eeC14542bC03424c656005f"}}},b= exports.c ={decimals:18,symbol:"MODE",name:"Mode",chains:{[_chains.mode.id]:{contractAddress:"0xDfc7C877a950e49D2610114102175A06C2e3167a"}}},i= exports.d ={decimals:18,symbol:"WETH",name:"Wrapped Ether",chains:{[_chains.mainnet.id]:{contractAddress:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"},[_chains.base.id]:{contractAddress:"0x4200000000000000000000000000000000000006"},[_chains.mode.id]:{contractAddress:"0x4200000000000000000000000000000000000006"},[_chains.arbitrum.id]:{contractAddress:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"},[_chains.optimism.id]:{contractAddress:"0x4200000000000000000000000000000000000006"},[_chains.polygon.id]:{contractAddress:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619"}}},A= exports.e =[o,n,b,i];exports.a = o; exports.b = n; exports.c = b; exports.d = i; exports.e = A; |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var e=[{constant:!0,inputs:[],name:"name",outputs:[{name:"",type:"string"}],stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"symbol",outputs:[{name:"",type:"string"}],stateMutability:"view",type:"function"},{constant:!0,inputs:[],name:"decimals",outputs:[{name:"",type:"uint8"}],stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"owner",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],name:"allowance",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"value",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{constant:!0,inputs:[],name:"totalSupply",outputs:[{type:"uint256",name:""}],stateMutability:"view",type:"function"}];exports.a = e; |
| import{z as e}from"zod";var n=e.object({address:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The wallet address to check the balance for."),tokenAddress:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").optional().describe("Optional: The contract address of the ERC20 token. If omitted, the native currency balance is returned.").transform(t=>t)}),o=e.object({recipient:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The recipient's EVM address.").transform(t=>t),amountInBaseUnits:e.string().describe("The amount of the token/native currency to send (in base units, e.g., '1000000000000000000')."),tokenAddress:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").optional().describe("Optional: The contract address of the ERC20 token to send. If omitted, the native currency is sent.").transform(t=>t)}),d=e.object({ticker:e.string().describe("The ticker symbol of the token (e.g., 'ETH', 'USDC').")}),i=e.object({amount:e.string().describe("The amount to convert (in human-readable units)."),tokenAddress:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").optional().describe("Optional: The contract address of the token. If omitted, native currency decimals are used.").transform(t=>t)}),c=e.object({amount:e.string().regex(/^\d+$/,"Amount must be a non-negative integer string (base units).").describe("The amount to convert (in base units, e.g., wei)."),tokenAddress:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").optional().describe("Optional: The contract address of the token. If omitted, native currency decimals are used.").transform(t=>t)}),m=e.object({domain:e.object({}).passthrough(),types:e.object({}).passthrough(),primaryType:e.string(),message:e.object({}).passthrough()}).passthrough().describe("The EIP-712 typed data structure to sign."),f=e.object({tokenAddress:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The contract address of the ERC20 token.").transform(t=>t),owner:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The address of the token owner.").transform(t=>t),spender:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The address of the potential spender.").transform(t=>t)}),g=e.object({tokenAddress:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The contract address of the ERC20 token.").transform(t=>t),spender:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The address to grant approval to.").transform(t=>t),amount:e.string().regex(/^\d+$/,"Amount must be a non-negative integer string (base units).").describe("The amount of tokens to approve (in base units).")}),h=e.object({tokenAddress:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The contract address of the ERC20 token.").transform(t=>t),spender:e.string().regex(/^0x[a-fA-F0-9]{40}$/,"Invalid EVM address format").describe("The address whose approval should be revoked.").transform(t=>t)});export{n as a,o as b,d as c,i as d,c as e,m as f,f as g,g as h,h as i}; |
| import { z } from 'zod'; | ||
| declare const getBalanceParametersSchema: z.ZodObject<{ | ||
| address: z.ZodString; | ||
| tokenAddress: z.ZodEffects<z.ZodOptional<z.ZodString>, `0x${string}` | undefined, string | undefined>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| address: string; | ||
| tokenAddress?: `0x${string}` | undefined; | ||
| }, { | ||
| address: string; | ||
| tokenAddress?: string | undefined; | ||
| }>; | ||
| declare const sendTokenParametersSchema: z.ZodObject<{ | ||
| recipient: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| amountInBaseUnits: z.ZodString; | ||
| tokenAddress: z.ZodEffects<z.ZodOptional<z.ZodString>, `0x${string}` | undefined, string | undefined>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| recipient: `0x${string}`; | ||
| amountInBaseUnits: string; | ||
| tokenAddress?: `0x${string}` | undefined; | ||
| }, { | ||
| recipient: string; | ||
| amountInBaseUnits: string; | ||
| tokenAddress?: string | undefined; | ||
| }>; | ||
| declare const getTokenInfoByTickerParametersSchema: z.ZodObject<{ | ||
| ticker: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| ticker: string; | ||
| }, { | ||
| ticker: string; | ||
| }>; | ||
| declare const convertToBaseUnitsParametersSchema: z.ZodObject<{ | ||
| amount: z.ZodString; | ||
| tokenAddress: z.ZodEffects<z.ZodOptional<z.ZodString>, `0x${string}` | undefined, string | undefined>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| amount: string; | ||
| tokenAddress?: `0x${string}` | undefined; | ||
| }, { | ||
| amount: string; | ||
| tokenAddress?: string | undefined; | ||
| }>; | ||
| declare const convertFromBaseUnitsParametersSchema: z.ZodObject<{ | ||
| amount: z.ZodString; | ||
| tokenAddress: z.ZodEffects<z.ZodOptional<z.ZodString>, `0x${string}` | undefined, string | undefined>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| amount: string; | ||
| tokenAddress?: `0x${string}` | undefined; | ||
| }, { | ||
| amount: string; | ||
| tokenAddress?: string | undefined; | ||
| }>; | ||
| declare const signTypedDataParametersSchema: z.ZodObject<{ | ||
| domain: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| types: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| primaryType: z.ZodString; | ||
| message: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
| domain: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| types: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| primaryType: z.ZodString; | ||
| message: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
| domain: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| types: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| primaryType: z.ZodString; | ||
| message: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| }, z.ZodTypeAny, "passthrough">>; | ||
| declare const getTokenAllowanceParametersSchema: z.ZodObject<{ | ||
| tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| owner: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| spender: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| owner: `0x${string}`; | ||
| spender: `0x${string}`; | ||
| tokenAddress: `0x${string}`; | ||
| }, { | ||
| owner: string; | ||
| spender: string; | ||
| tokenAddress: string; | ||
| }>; | ||
| declare const approveParametersSchema: z.ZodObject<{ | ||
| tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| spender: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| amount: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| spender: `0x${string}`; | ||
| tokenAddress: `0x${string}`; | ||
| amount: string; | ||
| }, { | ||
| spender: string; | ||
| tokenAddress: string; | ||
| amount: string; | ||
| }>; | ||
| declare const revokeApprovalParametersSchema: z.ZodObject<{ | ||
| tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| spender: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| spender: `0x${string}`; | ||
| tokenAddress: `0x${string}`; | ||
| }, { | ||
| spender: string; | ||
| tokenAddress: string; | ||
| }>; | ||
| export { approveParametersSchema, convertFromBaseUnitsParametersSchema, convertToBaseUnitsParametersSchema, getBalanceParametersSchema, getTokenAllowanceParametersSchema, getTokenInfoByTickerParametersSchema, revokeApprovalParametersSchema, sendTokenParametersSchema, signTypedDataParametersSchema }; |
+106
| import { z } from 'zod'; | ||
| declare const getBalanceParametersSchema: z.ZodObject<{ | ||
| address: z.ZodString; | ||
| tokenAddress: z.ZodEffects<z.ZodOptional<z.ZodString>, `0x${string}` | undefined, string | undefined>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| address: string; | ||
| tokenAddress?: `0x${string}` | undefined; | ||
| }, { | ||
| address: string; | ||
| tokenAddress?: string | undefined; | ||
| }>; | ||
| declare const sendTokenParametersSchema: z.ZodObject<{ | ||
| recipient: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| amountInBaseUnits: z.ZodString; | ||
| tokenAddress: z.ZodEffects<z.ZodOptional<z.ZodString>, `0x${string}` | undefined, string | undefined>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| recipient: `0x${string}`; | ||
| amountInBaseUnits: string; | ||
| tokenAddress?: `0x${string}` | undefined; | ||
| }, { | ||
| recipient: string; | ||
| amountInBaseUnits: string; | ||
| tokenAddress?: string | undefined; | ||
| }>; | ||
| declare const getTokenInfoByTickerParametersSchema: z.ZodObject<{ | ||
| ticker: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| ticker: string; | ||
| }, { | ||
| ticker: string; | ||
| }>; | ||
| declare const convertToBaseUnitsParametersSchema: z.ZodObject<{ | ||
| amount: z.ZodString; | ||
| tokenAddress: z.ZodEffects<z.ZodOptional<z.ZodString>, `0x${string}` | undefined, string | undefined>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| amount: string; | ||
| tokenAddress?: `0x${string}` | undefined; | ||
| }, { | ||
| amount: string; | ||
| tokenAddress?: string | undefined; | ||
| }>; | ||
| declare const convertFromBaseUnitsParametersSchema: z.ZodObject<{ | ||
| amount: z.ZodString; | ||
| tokenAddress: z.ZodEffects<z.ZodOptional<z.ZodString>, `0x${string}` | undefined, string | undefined>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| amount: string; | ||
| tokenAddress?: `0x${string}` | undefined; | ||
| }, { | ||
| amount: string; | ||
| tokenAddress?: string | undefined; | ||
| }>; | ||
| declare const signTypedDataParametersSchema: z.ZodObject<{ | ||
| domain: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| types: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| primaryType: z.ZodString; | ||
| message: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ | ||
| domain: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| types: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| primaryType: z.ZodString; | ||
| message: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ | ||
| domain: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| types: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| primaryType: z.ZodString; | ||
| message: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>; | ||
| }, z.ZodTypeAny, "passthrough">>; | ||
| declare const getTokenAllowanceParametersSchema: z.ZodObject<{ | ||
| tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| owner: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| spender: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| owner: `0x${string}`; | ||
| spender: `0x${string}`; | ||
| tokenAddress: `0x${string}`; | ||
| }, { | ||
| owner: string; | ||
| spender: string; | ||
| tokenAddress: string; | ||
| }>; | ||
| declare const approveParametersSchema: z.ZodObject<{ | ||
| tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| spender: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| amount: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| spender: `0x${string}`; | ||
| tokenAddress: `0x${string}`; | ||
| amount: string; | ||
| }, { | ||
| spender: string; | ||
| tokenAddress: string; | ||
| amount: string; | ||
| }>; | ||
| declare const revokeApprovalParametersSchema: z.ZodObject<{ | ||
| tokenAddress: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| spender: z.ZodEffects<z.ZodString, `0x${string}`, string>; | ||
| }, "strip", z.ZodTypeAny, { | ||
| spender: `0x${string}`; | ||
| tokenAddress: `0x${string}`; | ||
| }, { | ||
| spender: string; | ||
| tokenAddress: string; | ||
| }>; | ||
| export { approveParametersSchema, convertFromBaseUnitsParametersSchema, convertToBaseUnitsParametersSchema, getBalanceParametersSchema, getTokenAllowanceParametersSchema, getTokenInfoByTickerParametersSchema, revokeApprovalParametersSchema, sendTokenParametersSchema, signTypedDataParametersSchema }; |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD6CXV7AOjs = require('./chunk-D6CXV7AO.js');require('./chunk-EI7MMDWY.js');exports.approveParametersSchema = _chunkD6CXV7AOjs.h; exports.convertFromBaseUnitsParametersSchema = _chunkD6CXV7AOjs.e; exports.convertToBaseUnitsParametersSchema = _chunkD6CXV7AOjs.d; exports.getBalanceParametersSchema = _chunkD6CXV7AOjs.a; exports.getTokenAllowanceParametersSchema = _chunkD6CXV7AOjs.g; exports.getTokenInfoByTickerParametersSchema = _chunkD6CXV7AOjs.c; exports.revokeApprovalParametersSchema = _chunkD6CXV7AOjs.i; exports.sendTokenParametersSchema = _chunkD6CXV7AOjs.b; exports.signTypedDataParametersSchema = _chunkD6CXV7AOjs.f; |
| import{a,b,c,d,e,f,g,h,i}from"./chunk-UNOJYU6C.mjs";import"./chunk-YSXGDEY5.mjs";export{h as approveParametersSchema,e as convertFromBaseUnitsParametersSchema,d as convertToBaseUnitsParametersSchema,a as getBalanceParametersSchema,g as getTokenAllowanceParametersSchema,c as getTokenInfoByTickerParametersSchema,i as revokeApprovalParametersSchema,b as sendTokenParametersSchema,f as signTypedDataParametersSchema}; |
| import { Token as Token$1 } from '@goat-sdk/core'; | ||
| type Token = Token$1 & { | ||
| chains: { | ||
| [chainId: number]: { | ||
| contractAddress: `0x${string}`; | ||
| }; | ||
| }; | ||
| }; | ||
| declare const PEPE: Token; | ||
| declare const USDC: Token; | ||
| declare const MODE: Token; | ||
| declare const WETH: Token; | ||
| declare const PREDEFINED_TOKENS: Token[]; | ||
| export { MODE, PEPE, PREDEFINED_TOKENS, type Token, USDC, WETH }; |
| import { Token as Token$1 } from '@goat-sdk/core'; | ||
| type Token = Token$1 & { | ||
| chains: { | ||
| [chainId: number]: { | ||
| contractAddress: `0x${string}`; | ||
| }; | ||
| }; | ||
| }; | ||
| declare const PEPE: Token; | ||
| declare const USDC: Token; | ||
| declare const MODE: Token; | ||
| declare const WETH: Token; | ||
| declare const PREDEFINED_TOKENS: Token[]; | ||
| export { MODE, PEPE, PREDEFINED_TOKENS, type Token, USDC, WETH }; |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkNLS5UWPFjs = require('./chunk-NLS5UWPF.js');require('./chunk-EI7MMDWY.js');exports.MODE = _chunkNLS5UWPFjs.c; exports.PEPE = _chunkNLS5UWPFjs.a; exports.PREDEFINED_TOKENS = _chunkNLS5UWPFjs.e; exports.USDC = _chunkNLS5UWPFjs.b; exports.WETH = _chunkNLS5UWPFjs.d; |
| import{a,b,c,d,e}from"./chunk-7YKIZPCS.mjs";import"./chunk-YSXGDEY5.mjs";export{c as MODE,a as PEPE,e as PREDEFINED_TOKENS,b as USDC,d as WETH}; |
| import { EVMWalletClient } from './EVMWalletClient.mjs'; | ||
| import { EVMTransaction } from './types/EVMTransaction.mjs'; | ||
| import '@goat-sdk/core'; | ||
| import './types/EVMReadRequest.mjs'; | ||
| import 'abitype'; | ||
| import './types/EVMReadResult.mjs'; | ||
| import './types/EVMTypedData.mjs'; | ||
| import './tokens.mjs'; | ||
| import '@goat-sdk/core'; | ||
| import 'abitype'; | ||
@@ -9,0 +10,0 @@ declare abstract class EVMSmartWalletClient extends EVMWalletClient { |
| import { EVMWalletClient } from './EVMWalletClient.js'; | ||
| import { EVMTransaction } from './types/EVMTransaction.js'; | ||
| import '@goat-sdk/core'; | ||
| import './types/EVMReadRequest.js'; | ||
| import 'abitype'; | ||
| import './types/EVMReadResult.js'; | ||
| import './types/EVMTypedData.js'; | ||
| import './tokens.js'; | ||
| import '@goat-sdk/core'; | ||
| import 'abitype'; | ||
@@ -9,0 +10,0 @@ declare abstract class EVMSmartWalletClient extends EVMWalletClient { |
@@ -1,1 +0,1 @@ | ||
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkP4XF23GXjs = require('./chunk-P4XF23GX.js');require('./chunk-7LYFZ5ZN.js');require('./chunk-EI7MMDWY.js');exports.EVMSmartWalletClient = _chunkP4XF23GXjs.a; | ||
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFL65SZ2Mjs = require('./chunk-FL65SZ2M.js');require('./chunk-5ZQCRQCR.js');require('./chunk-NPSGHTUW.js');require('./chunk-D6CXV7AO.js');require('./chunk-NLS5UWPF.js');require('./chunk-EI7MMDWY.js');exports.EVMSmartWalletClient = _chunkFL65SZ2Mjs.a; |
@@ -1,1 +0,1 @@ | ||
| import{a}from"./chunk-QQE6GY6U.mjs";import"./chunk-LH6LE2QP.mjs";import"./chunk-YSXGDEY5.mjs";export{a as EVMSmartWalletClient}; | ||
| import{a}from"./chunk-73ORIQXW.mjs";import"./chunk-7QP2WIGH.mjs";import"./chunk-5LTZEZUT.mjs";import"./chunk-UNOJYU6C.mjs";import"./chunk-7YKIZPCS.mjs";import"./chunk-YSXGDEY5.mjs";export{a as EVMSmartWalletClient}; |
@@ -1,2 +0,3 @@ | ||
| import { WalletClientBase, EvmChain, Signature } from '@goat-sdk/core'; | ||
| import { WalletClientBase, Signature, EvmChain, Balance, ToolBase } from '@goat-sdk/core'; | ||
| import { Token } from './tokens.mjs'; | ||
| import { EVMTransaction } from './types/EVMTransaction.mjs'; | ||
@@ -8,4 +9,26 @@ import { EVMReadRequest } from './types/EVMReadRequest.mjs'; | ||
| type ApproveParameters = { | ||
| tokenAddress: `0x${string}`; | ||
| spender: `0x${string}`; | ||
| amount: string; | ||
| }; | ||
| type GetTokenAllowanceParameters = { | ||
| tokenAddress: `0x${string}`; | ||
| owner: `0x${string}`; | ||
| spender: `0x${string}`; | ||
| }; | ||
| type TransferFromParameters = { | ||
| tokenAddress: `0x${string}`; | ||
| from: `0x${string}`; | ||
| to: `0x${string}`; | ||
| amount: string; | ||
| }; | ||
| type EVMWalletClientCtorParams = { | ||
| tokens?: Token[]; | ||
| enableSend?: boolean; | ||
| }; | ||
| declare abstract class EVMWalletClient extends WalletClientBase { | ||
| abstract getChain(): EvmChain; | ||
| protected tokens: Token[]; | ||
| protected enableSend: boolean; | ||
| constructor({ tokens, enableSend }?: EVMWalletClientCtorParams); | ||
| abstract sendTransaction(transaction: EVMTransaction): Promise<{ | ||
@@ -15,5 +38,41 @@ hash: string; | ||
| abstract read(request: EVMReadRequest): Promise<EVMReadResult>; | ||
| abstract getNativeBalance(): Promise<bigint>; | ||
| abstract signTypedData(data: EVMTypedData): Promise<Signature>; | ||
| abstract getChain(): EvmChain; | ||
| balanceOf(address: string, tokenAddress?: `0x${string}`): Promise<Balance>; | ||
| getTokenInfoByTicker(ticker: string): Promise<{ | ||
| symbol: string; | ||
| contractAddress: string; | ||
| decimals: number; | ||
| name: string; | ||
| }>; | ||
| _getTokenDecimals(tokenAddress?: `0x${string}`): Promise<number>; | ||
| convertToBaseUnits(params: { | ||
| amount: string; | ||
| tokenAddress?: `0x${string}`; | ||
| }): Promise<string>; | ||
| convertFromBaseUnits(params: { | ||
| amount: string; | ||
| tokenAddress?: `0x${string}`; | ||
| }): Promise<string>; | ||
| sendToken(params: { | ||
| recipient: `0x${string}`; | ||
| amountInBaseUnits: string; | ||
| tokenAddress?: `0x${string}`; | ||
| }): Promise<{ | ||
| hash: string; | ||
| }>; | ||
| getTokenAllowance(params: GetTokenAllowanceParameters): Promise<string>; | ||
| approve(params: ApproveParameters): Promise<{ | ||
| hash: string; | ||
| }>; | ||
| revokeApproval(params: { | ||
| tokenAddress: `0x${string}`; | ||
| spender: `0x${string}`; | ||
| }): Promise<{ | ||
| hash: string; | ||
| }>; | ||
| getCoreTools(): ToolBase[]; | ||
| } | ||
| export { EVMWalletClient }; | ||
| export { type ApproveParameters, EVMWalletClient, type EVMWalletClientCtorParams, type GetTokenAllowanceParameters, type TransferFromParameters }; |
@@ -1,2 +0,3 @@ | ||
| import { WalletClientBase, EvmChain, Signature } from '@goat-sdk/core'; | ||
| import { WalletClientBase, Signature, EvmChain, Balance, ToolBase } from '@goat-sdk/core'; | ||
| import { Token } from './tokens.js'; | ||
| import { EVMTransaction } from './types/EVMTransaction.js'; | ||
@@ -8,4 +9,26 @@ import { EVMReadRequest } from './types/EVMReadRequest.js'; | ||
| type ApproveParameters = { | ||
| tokenAddress: `0x${string}`; | ||
| spender: `0x${string}`; | ||
| amount: string; | ||
| }; | ||
| type GetTokenAllowanceParameters = { | ||
| tokenAddress: `0x${string}`; | ||
| owner: `0x${string}`; | ||
| spender: `0x${string}`; | ||
| }; | ||
| type TransferFromParameters = { | ||
| tokenAddress: `0x${string}`; | ||
| from: `0x${string}`; | ||
| to: `0x${string}`; | ||
| amount: string; | ||
| }; | ||
| type EVMWalletClientCtorParams = { | ||
| tokens?: Token[]; | ||
| enableSend?: boolean; | ||
| }; | ||
| declare abstract class EVMWalletClient extends WalletClientBase { | ||
| abstract getChain(): EvmChain; | ||
| protected tokens: Token[]; | ||
| protected enableSend: boolean; | ||
| constructor({ tokens, enableSend }?: EVMWalletClientCtorParams); | ||
| abstract sendTransaction(transaction: EVMTransaction): Promise<{ | ||
@@ -15,5 +38,41 @@ hash: string; | ||
| abstract read(request: EVMReadRequest): Promise<EVMReadResult>; | ||
| abstract getNativeBalance(): Promise<bigint>; | ||
| abstract signTypedData(data: EVMTypedData): Promise<Signature>; | ||
| abstract getChain(): EvmChain; | ||
| balanceOf(address: string, tokenAddress?: `0x${string}`): Promise<Balance>; | ||
| getTokenInfoByTicker(ticker: string): Promise<{ | ||
| symbol: string; | ||
| contractAddress: string; | ||
| decimals: number; | ||
| name: string; | ||
| }>; | ||
| _getTokenDecimals(tokenAddress?: `0x${string}`): Promise<number>; | ||
| convertToBaseUnits(params: { | ||
| amount: string; | ||
| tokenAddress?: `0x${string}`; | ||
| }): Promise<string>; | ||
| convertFromBaseUnits(params: { | ||
| amount: string; | ||
| tokenAddress?: `0x${string}`; | ||
| }): Promise<string>; | ||
| sendToken(params: { | ||
| recipient: `0x${string}`; | ||
| amountInBaseUnits: string; | ||
| tokenAddress?: `0x${string}`; | ||
| }): Promise<{ | ||
| hash: string; | ||
| }>; | ||
| getTokenAllowance(params: GetTokenAllowanceParameters): Promise<string>; | ||
| approve(params: ApproveParameters): Promise<{ | ||
| hash: string; | ||
| }>; | ||
| revokeApproval(params: { | ||
| tokenAddress: `0x${string}`; | ||
| spender: `0x${string}`; | ||
| }): Promise<{ | ||
| hash: string; | ||
| }>; | ||
| getCoreTools(): ToolBase[]; | ||
| } | ||
| export { EVMWalletClient }; | ||
| export { type ApproveParameters, EVMWalletClient, type EVMWalletClientCtorParams, type GetTokenAllowanceParameters, type TransferFromParameters }; |
@@ -1,1 +0,1 @@ | ||
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7LYFZ5ZNjs = require('./chunk-7LYFZ5ZN.js');require('./chunk-EI7MMDWY.js');exports.EVMWalletClient = _chunk7LYFZ5ZNjs.a; | ||
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5ZQCRQCRjs = require('./chunk-5ZQCRQCR.js');require('./chunk-NPSGHTUW.js');require('./chunk-D6CXV7AO.js');require('./chunk-NLS5UWPF.js');require('./chunk-EI7MMDWY.js');exports.EVMWalletClient = _chunk5ZQCRQCRjs.a; |
@@ -1,1 +0,1 @@ | ||
| import{a}from"./chunk-LH6LE2QP.mjs";import"./chunk-YSXGDEY5.mjs";export{a as EVMWalletClient}; | ||
| import{a}from"./chunk-7QP2WIGH.mjs";import"./chunk-5LTZEZUT.mjs";import"./chunk-UNOJYU6C.mjs";import"./chunk-7YKIZPCS.mjs";import"./chunk-YSXGDEY5.mjs";export{a as EVMWalletClient}; |
+4
-5
@@ -0,1 +1,3 @@ | ||
| export { EVMSmartWalletClient } from './EVMSmartWalletClient.mjs'; | ||
| export { ApproveParameters, EVMWalletClient, EVMWalletClientCtorParams, GetTokenAllowanceParameters, TransferFromParameters } from './EVMWalletClient.mjs'; | ||
| export { EVMTransaction, EVMTransactionOptions } from './types/EVMTransaction.mjs'; | ||
@@ -5,7 +7,4 @@ export { EVMReadRequest } from './types/EVMReadRequest.mjs'; | ||
| export { EVMTypedData } from './types/EVMTypedData.mjs'; | ||
| export { EVMWalletClient } from './EVMWalletClient.mjs'; | ||
| export { EVMSmartWalletClient } from './EVMSmartWalletClient.mjs'; | ||
| export { SendETHPlugin, sendETH } from './sendETH.plugin.mjs'; | ||
| export { MODE, PEPE, PREDEFINED_TOKENS, Token, USDC, WETH } from './tokens.mjs'; | ||
| import '@goat-sdk/core'; | ||
| import 'abitype'; | ||
| import '@goat-sdk/core'; | ||
| import 'zod'; |
+4
-5
@@ -0,1 +1,3 @@ | ||
| export { EVMSmartWalletClient } from './EVMSmartWalletClient.js'; | ||
| export { ApproveParameters, EVMWalletClient, EVMWalletClientCtorParams, GetTokenAllowanceParameters, TransferFromParameters } from './EVMWalletClient.js'; | ||
| export { EVMTransaction, EVMTransactionOptions } from './types/EVMTransaction.js'; | ||
@@ -5,7 +7,4 @@ export { EVMReadRequest } from './types/EVMReadRequest.js'; | ||
| export { EVMTypedData } from './types/EVMTypedData.js'; | ||
| export { EVMWalletClient } from './EVMWalletClient.js'; | ||
| export { EVMSmartWalletClient } from './EVMSmartWalletClient.js'; | ||
| export { SendETHPlugin, sendETH } from './sendETH.plugin.js'; | ||
| export { MODE, PEPE, PREDEFINED_TOKENS, Token, USDC, WETH } from './tokens.js'; | ||
| import '@goat-sdk/core'; | ||
| import 'abitype'; | ||
| import '@goat-sdk/core'; | ||
| import 'zod'; |
+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 _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; | ||
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-VQHFGGR7.js');require('./chunk-D4GZ5WLQ.js');require('./chunk-7YBI42YF.js');var _chunkFL65SZ2Mjs = require('./chunk-FL65SZ2M.js');var _chunk5ZQCRQCRjs = require('./chunk-5ZQCRQCR.js');require('./chunk-NPSGHTUW.js');require('./chunk-D6CXV7AO.js');var _chunkNLS5UWPFjs = require('./chunk-NLS5UWPF.js');require('./chunk-EI7MMDWY.js');require('./chunk-G2UI43AF.js');require('./chunk-Q27JQKTX.js');exports.EVMSmartWalletClient = _chunkFL65SZ2Mjs.a; exports.EVMWalletClient = _chunk5ZQCRQCRjs.a; exports.MODE = _chunkNLS5UWPFjs.c; exports.PEPE = _chunkNLS5UWPFjs.a; exports.PREDEFINED_TOKENS = _chunkNLS5UWPFjs.e; exports.USDC = _chunkNLS5UWPFjs.b; exports.WETH = _chunkNLS5UWPFjs.d; |
+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-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}; | ||
| import"./chunk-5FBYVXPD.mjs";import"./chunk-RSMO7DOJ.mjs";import"./chunk-TB5UT6ZN.mjs";import{a as t}from"./chunk-73ORIQXW.mjs";import{a as p}from"./chunk-7QP2WIGH.mjs";import"./chunk-5LTZEZUT.mjs";import"./chunk-UNOJYU6C.mjs";import{a as o,b as r,c as e,d as f,e as m}from"./chunk-7YKIZPCS.mjs";import"./chunk-YSXGDEY5.mjs";import"./chunk-JKZZRC57.mjs";import"./chunk-TILO4CTR.mjs";export{t as EVMSmartWalletClient,p as EVMWalletClient,e as MODE,o as PEPE,m as PREDEFINED_TOKENS,r as USDC,f as WETH}; |
@@ -1,1 +0,1 @@ | ||
| "use strict";require('../chunk-VQHFGGR7.js');require('../chunk-G2UI43AF.js');require('../chunk-Q27JQKTX.js');require('../chunk-D4GZ5WLQ.js');require('../chunk-7YBI42YF.js'); | ||
| "use strict";require('../chunk-VQHFGGR7.js');require('../chunk-D4GZ5WLQ.js');require('../chunk-7YBI42YF.js');require('../chunk-G2UI43AF.js');require('../chunk-Q27JQKTX.js'); |
@@ -1,1 +0,1 @@ | ||
| import"../chunk-5FBYVXPD.mjs";import"../chunk-JKZZRC57.mjs";import"../chunk-TILO4CTR.mjs";import"../chunk-RSMO7DOJ.mjs";import"../chunk-TB5UT6ZN.mjs"; | ||
| import"../chunk-5FBYVXPD.mjs";import"../chunk-RSMO7DOJ.mjs";import"../chunk-TB5UT6ZN.mjs";import"../chunk-JKZZRC57.mjs";import"../chunk-TILO4CTR.mjs"; |
+3
-3
| { | ||
| "name": "@goat-sdk/wallet-evm", | ||
| "version": "0.2.11", | ||
| "version": "0.3.0", | ||
| "sideEffects": false, | ||
@@ -17,6 +17,6 @@ "files": [ | ||
| "zod": "3.23.8", | ||
| "@goat-sdk/core": "0.4.9" | ||
| "@goat-sdk/core": "0.5.0" | ||
| }, | ||
| "peerDependencies": { | ||
| "@goat-sdk/core": "0.4.9" | ||
| "@goat-sdk/core": "0.5.0" | ||
| }, | ||
@@ -23,0 +23,0 @@ "homepage": "https://ohmygoat.dev", |
+1
-1
@@ -48,3 +48,3 @@ <div align="center"> | ||
| <a href="https://github.com/goat-sdk/goat"> | ||
| <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;"> | ||
| </a> |
| 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});var _chunkEI7MMDWYjs = require('./chunk-EI7MMDWY.js');var _core = require('@goat-sdk/core');var s=class extends _core.WalletClientBase{static{_chunkEI7MMDWYjs.a.call(void 0, this,"EVMWalletClient")}};exports.a = s; |
| "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; |
| import{a as e}from"./chunk-YSXGDEY5.mjs";import{WalletClientBase as o}from"@goat-sdk/core";var s=class extends o{static{e(this,"EVMWalletClient")}};export{s as a}; |
| "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7LYFZ5ZNjs = require('./chunk-7LYFZ5ZN.js');var _chunkEI7MMDWYjs = require('./chunk-EI7MMDWY.js');var s=class extends _chunk7LYFZ5ZNjs.a{static{_chunkEI7MMDWYjs.a.call(void 0, this,"EVMSmartWalletClient")}};exports.a = s; |
| import{a as o}from"./chunk-LH6LE2QP.mjs";import{a as e}from"./chunk-YSXGDEY5.mjs";var s=class extends o{static{e(this,"EVMSmartWalletClient")}};export{s as a}; |
| import * as _goat_sdk_core from '@goat-sdk/core'; | ||
| import { PluginBase, Chain } from '@goat-sdk/core'; | ||
| import { z } from 'zod'; | ||
| import { EVMWalletClient } from './EVMWalletClient.mjs'; | ||
| import './types/EVMTransaction.mjs'; | ||
| import 'abitype'; | ||
| import './types/EVMReadRequest.mjs'; | ||
| import './types/EVMReadResult.mjs'; | ||
| import './types/EVMTypedData.mjs'; | ||
| declare class SendETHPlugin extends PluginBase<EVMWalletClient> { | ||
| constructor(); | ||
| supportsChain: (chain: Chain) => chain is _goat_sdk_core.EvmChain; | ||
| getTools(walletClient: EVMWalletClient): { | ||
| execute(parameters: { | ||
| to: string; | ||
| amount: string; | ||
| }): string | Promise<string>; | ||
| readonly name: string; | ||
| readonly description: string; | ||
| readonly parameters: z.ZodObject<{ | ||
| to: z.ZodString; | ||
| amount: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| to: string; | ||
| amount: string; | ||
| }, { | ||
| to: string; | ||
| amount: string; | ||
| }>; | ||
| }[]; | ||
| } | ||
| declare const sendETH: () => SendETHPlugin; | ||
| export { SendETHPlugin, sendETH }; |
| import * as _goat_sdk_core from '@goat-sdk/core'; | ||
| import { PluginBase, Chain } from '@goat-sdk/core'; | ||
| import { z } from 'zod'; | ||
| import { EVMWalletClient } from './EVMWalletClient.js'; | ||
| import './types/EVMTransaction.js'; | ||
| import 'abitype'; | ||
| import './types/EVMReadRequest.js'; | ||
| import './types/EVMReadResult.js'; | ||
| import './types/EVMTypedData.js'; | ||
| declare class SendETHPlugin extends PluginBase<EVMWalletClient> { | ||
| constructor(); | ||
| supportsChain: (chain: Chain) => chain is _goat_sdk_core.EvmChain; | ||
| getTools(walletClient: EVMWalletClient): { | ||
| execute(parameters: { | ||
| to: string; | ||
| amount: string; | ||
| }): string | Promise<string>; | ||
| readonly name: string; | ||
| readonly description: string; | ||
| readonly parameters: z.ZodObject<{ | ||
| to: z.ZodString; | ||
| amount: z.ZodString; | ||
| }, "strip", z.ZodTypeAny, { | ||
| to: string; | ||
| amount: string; | ||
| }, { | ||
| to: string; | ||
| amount: string; | ||
| }>; | ||
| }[]; | ||
| } | ||
| declare const sendETH: () => SendETHPlugin; | ||
| export { SendETHPlugin, sendETH }; |
| "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; |
| import{a,b}from"./chunk-25XBPQGK.mjs";import"./chunk-YSXGDEY5.mjs";export{a as SendETHPlugin,b as sendETH}; |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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 3 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 3 instances
62418
275.13%68
21.43%523
241.83%12
140%1
Infinity%+ Added
- Removed
Updated