@ottocode/openclaw-setu 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as s,c as g,d as C,f as P}from"./chunk-86peddhn.mjs";import{l as f,m as y,n as l,p as h,r as S}from"./chunk-vw7de3g2.mjs";import"./chunk-k1btvkaq.mjs";import"./chunk-2pmp70f4.mjs";import"./chunk-w1g9nypz.mjs";import"./chunk-gr14hnnm.mjs";import{qd as m}from"./chunk-enz73nmb.mjs";var
|
|
1
|
+
import{b as s,c as g,d as C,f as P}from"./chunk-86peddhn.mjs";import{l as f,m as y,n as l,p as h,r as S}from"./chunk-vw7de3g2.mjs";import"./chunk-k1btvkaq.mjs";import"./chunk-2pmp70f4.mjs";import"./chunk-w1g9nypz.mjs";import"./chunk-gr14hnnm.mjs";import{qd as m}from"./chunk-enz73nmb.mjs";var x=8403;function $(e){return e.pluginConfig?.port??x}var K={id:"openclaw-setu",name:"Setu",description:"Pay for AI with Solana USDC — no API keys, just a wallet.",version:"0.1.0",register(e){let n=$(e);try{g(n)}catch{}try{C()}catch{}if(!e.config.models)e.config.models={providers:{}};if(!e.config.models.providers)e.config.models.providers={};let r=s(n);if(e.config.models.providers.setu={baseUrl:r.baseUrl,api:r.api,apiKey:r.apiKey,models:r.models},!e.config.agents)e.config.agents={};let u=e.config.agents;if(!u.defaults)u.defaults={};let d=u.defaults;if(!d.model)d.model={};let w=d.model;if(!w.primary)w.primary="setu/claude-sonnet-4-6";e.registerProvider({id:"setu",label:"Setu (Solana USDC)",aliases:["setu-solana"],envVars:["SETU_PRIVATE_KEY"],models:s(n),auth:[{id:"setu-wallet",label:"Solana Wallet",hint:"Generate or import a Solana wallet — pay per token with USDC",kind:"custom",async run(o){let t=l();if(t)return o.prompter.note(`Existing Setu wallet found: ${t.publicKey}`),{profiles:[{profileId:"setu-wallet",credential:{apiKey:"setu-proxy-handles-auth",type:"wallet",walletAddress:t.publicKey}}],configPatch:{models:{providers:{setu:s(n)}}},defaultModel:"setu/claude-sonnet-4-6",notes:[`Wallet: ${t.publicKey}`,"Fund with USDC on Solana to start using.","Run `openclaw-setu start` to start the proxy."]};let a=await o.prompter.text({message:"Enter Solana private key (base58) or press Enter to generate a new one:",validate:(i)=>{if(i&&!f(i))return"Invalid Solana private key";return}}),c=typeof a==="string"?a.trim():"";if(c&&f(c)){let{saveWallet:i}=await import("./chunk-nj01dc2r.mjs");i(c)}else h();let p=l();return await g(n),{profiles:[{profileId:"setu-wallet",credential:{apiKey:"setu-proxy-handles-auth",type:"wallet",walletAddress:p.publicKey}}],configPatch:{models:{providers:{setu:s(n)}}},defaultModel:"setu/claude-sonnet-4-6",notes:[`Wallet generated: ${p.publicKey}`,`Key stored at: ${y()}`,`Fund with USDC on Solana: ${p.publicKey}`,"Run `openclaw-setu start` to start the proxy."]}}}]});let b={name:"wallet",description:"Show your Setu wallet address and balances",requireAuth:!0,async handler(){let o=l();if(!o)return{text:"No Setu wallet found. Run `openclaw-setu setup`."};let t=await S(o.privateKey),a=[`Wallet: ${o.publicKey}`];if(t.setu)a.push(`Setu Balance: $${t.setu.balance.toFixed(4)}`),a.push(`Total Spent: $${t.setu.totalSpent.toFixed(4)}`),a.push(`Requests: ${t.setu.requestCount}`);if(t.wallet)a.push(`On-chain USDC: $${t.wallet.usdcBalance.toFixed(4)} (${t.wallet.network})`);return{text:a.join(`
|
|
2
2
|
`)}}};e.registerCommand(b);let v={name:"setu-status",description:"Check Setu plugin configuration status",async handler(){let o=l(),t=P();return{text:[`Wallet: ${o?o.publicKey:"not set up"}`,`OpenClaw config: ${t?"injected":"not configured"}`,`Proxy port: ${n}`].join(`
|
|
3
|
-
`)}}};e.registerCommand(v),e.registerService({id:"setu-proxy",async start(){if(!l()){e.logger.warn("Setu: No wallet found. Run `openclaw-setu setup` first.");return}try{let{createProxy:t}=await import("./chunk-kvpwet74.mjs");t({port:n,verbose:!1}),e.logger.info(`Setu proxy running on http://localhost:${n}`)}catch(t){e.logger.error(`Setu proxy failed: ${t.message}`)}}})}},
|
|
3
|
+
`)}}};e.registerCommand(v),e.registerService({id:"setu-proxy",async start(){if(typeof globalThis.Bun>"u"){e.logger.info("Setu: Run `openclaw-setu start` to start the proxy (requires Bun).");return}if(!l()){e.logger.warn("Setu: No wallet found. Run `openclaw-setu setup` first.");return}try{let{createProxy:t}=await import("./chunk-kvpwet74.mjs");t({port:n,verbose:!1}),e.logger.info(`Setu proxy running on http://localhost:${n}`)}catch(t){e.logger.error(`Setu proxy failed: ${t.message}`)}}})}},O=K;export{O as default};
|
package/openclaw.plugin.json
CHANGED