@oneie/cli 5.10.2 → 5.10.3
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/README.md +1 -0
- package/dist/package.json +1 -1
- package/dist/src/{age-8m0v06sc.js → age-74tmaw4t.js} +1 -1
- package/dist/src/client-3daam667.js +1 -0
- package/dist/src/{evm-tx-mfhhgpsb.js → evm-tx-33z1n2zx.js} +1 -1
- package/dist/src/{hl-run-z8bwmhf8.js → hl-run-bx11y304.js} +1 -1
- package/dist/src/{index-abbkxz62.js → index-exa86q8e.js} +7 -7
- package/dist/src/{index-sdgefh6q.js → index-stdwesmk.js} +1 -1
- package/dist/src/index.js +261 -256
- package/dist/src/{message-key-eqq90drz.js → message-key-sy2jmj5v.js} +1 -1
- package/dist/src/{message-lock-y872a869.js → message-lock-9p4jbjtc.js} +1 -1
- package/dist/src/{sweep-runner-f1ee3pdt.js → sweep-runner-mk3ek1mk.js} +1 -1
- package/dist/src/{wallet-zjprdjn2.js → wallet-e3473qat.js} +1 -1
- package/package.json +1 -1
- package/dist/src/client-vgmvv2zt.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Se,zt,an}from"./index-
|
|
1
|
+
import{Se,zt,an}from"./index-stdwesmk.js";import{_,ie,de,ue,q}from"./index-exa86q8e.js";var o="message-x25519-v1";function n(e){if(e.length!==32)throw Error("the master is 32 bytes");let t=Se(_,e,new Uint8Array(0),new TextEncoder().encode(o),32),r=ie.getPublicKey(t);return{recipient:zt(r),publicKey:r,secret:t}}function f(e){let t=e.trim().toLowerCase().split(/\s+/).join(" ");if(!ue(t,q))throw Error("that is not a valid 24-word BIP-39 recovery phrase");let r=de(t,q);if(r.length!==32)throw Error("that is not a 24-word BIP-39 recovery phrase");try{return n(r)}finally{r.fill(0)}}function d(e){return an(e.secret)}export{o as MESSAGE_KEY_INFO,n as deriveMessageKey,d as messageIdentityText,f as messageKeyFromPhrase};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j,L,xe}from"./index-
|
|
1
|
+
import{j,L,xe}from"./index-exa86q8e.js";var a="ONE message lock v1",c=/^age1[a-z0-9]{58}$/,l=/^[a-z0-9][a-z0-9-]{0,62}$/,u=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;function g(n,t){return`${a}
|
|
2
2
|
${n}
|
|
3
3
|
${t}`}function h(n,t,e){return`${a}
|
|
4
4
|
${n}/${t}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{cn,Wt,ln}from"./index-y4xe5pm7.js";import{pe,wn}from"./index-
|
|
1
|
+
import{cn,Wt,ln}from"./index-y4xe5pm7.js";import{pe,wn}from"./index-exa86q8e.js";function A(e,r){return pe(r.chain,e,Wt(r))}function x(e,r){return pe(r.chain,e,ln(r))}function v(){let e=crypto.getRandomValues(new Uint8Array(24));return btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var p=(e,r)=>typeof e==="string"&&typeof r==="string"&&e.toLowerCase()===r.toLowerCase();async function E(e,r){let s=r.now??(()=>Date.now()),t=await r.ask("wallet:sweep",{workspace:e.workspace,actor:e.actor,chain:e.chain,pending:!0});if(t.ok!==!0)return{ok:!1,error:String(t.error??"pending_read_failed"),results:[]};if(!p(t.agentAddress,e.agentKey.address))return{ok:!1,error:"agent_address_mismatch",results:[]};let c=String(t.to??"");if(!c)return{ok:!1,error:"owner_address_unproven",results:[]};if(e.ownerAddress!==void 0&&!p(e.ownerAddress,c))return{ok:!1,error:"owner_address_mismatch",results:[]};let i=Array.isArray(t.orders)?t.orders:[],a=[];for(let n of i){let o=String(n.nonce??""),u=(d)=>(a.push({nonce:o,ok:!1,error:d}),a),f=typeof n.amountUnits==="string"&&/^\d+$/.test(n.amountUnits)?BigInt(n.amountUnits):null,w=Number(n.expiresAt);if(f===null||f<=0n||!Number.isSafeInteger(w)){u("order_invalid");continue}if(w-s()<cn){u("order_too_close_to_expiry");continue}if(!p(n.destination,c)){u("order_destination_mismatch");continue}let m={workspace:e.workspace,actor:e.actor,chain:e.chain,destination:String(n.destination),amount:f,nonce:o,expiresAt:w};if(!wn(e.chain,c,n.signature,Wt(m))){u("order_signature_invalid");continue}let y=r.transfer?.[e.chain];if(!y){u(`no_signer:${e.chain}`);continue}let l;try{l=await y({chain:e.chain,from:e.agentKey.address,to:m.destination,amountUnits:f,privateKeyHex:e.agentKey.privateKeyHex})}catch(d){return u(`transfer_failed:${d instanceof Error?d.message:String(d)}`),{ok:!1,error:"transfer_failed",results:a}}let h=await r.ask("wallet:sweep",{workspace:e.workspace,actor:e.actor,chain:e.chain,nonce:o,paymentTx:l});if(h.settled===!0)a.push({nonce:o,ok:!0,settled:!0,paymentTx:l});else a.push({nonce:o,ok:!1,settled:!1,paymentTx:l,error:String(h.error??"settle_failed")})}return{ok:a.every((n)=>n.ok),results:a}}var _=(e)=>Uint8Array.from((e.match(/.{2}/g)??[]).map((r)=>parseInt(r,16)));async function g(e){let[r,s,t]=await Promise.all([e("@mysten/sui/keypairs/ed25519"),e("@mysten/sui/jsonRpc"),e("@mysten/sui/transactions")]);return{keypairs:r,client:s,transactions:t}}function K(e){let r=e.load??((s)=>import(s));return async(s)=>{if(s.chain!=="sui")throw Error(`no_signer:${s.chain}`);let t;try{t=await g(r)}catch{throw Error("sui_signer_unavailable: install @mysten/sui in the agent runtime")}let c=t.keypairs.Ed25519Keypair.fromSecretKey(_(s.privateKeyHex));if(!p(c.toSuiAddress(),s.from))throw Error("agent_key_mismatch");let i=new t.transactions.Transaction;i.setSender(c.toSuiAddress());let[a]=i.splitCoins(i.gas,[i.pure.u64(s.amountUnits)]);i.transferObjects([a],i.pure.address(s.to));let n=new t.client.SuiJsonRpcClient({url:e.rpcUrl,network:e.network}),o=await n.signAndExecuteTransaction({transaction:i,signer:c,options:{showEffects:!0}});if(await n.waitForTransaction({digest:o.digest}),o.effects?.status?.status!=="success")throw Error(o.effects?.status?.error??"sui_transfer_failed");return o.digest}}export{v as newOrderNonce,E as runSweepOrders,x as signHandoverOffer,A as signSweepOrder,K as suiTransfer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Le,Ft,on,yt,Kt,De,C,x}from"./index-
|
|
1
|
+
import{Le,Ft,on,yt,Kt,De,C,x}from"./index-exa86q8e.js";export{C as promptSecret,yt as registerAgentWallet,Kt as registerSealedWallet,Ft as sealWallet,x as unlock,on as walletCmd,Le as walletFor,De as writeKeysFile};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneie/cli",
|
|
3
|
-
"version": "5.10.
|
|
3
|
+
"version": "5.10.3",
|
|
4
4
|
"description": "Give your agent financial superpowers. One command makes a key on your machine, five wallets, a shop and a test sale — your agent can sell and be paid in USDC, and asks you before real money moves.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o,i,s,n,e}from"./index-abbkxz62.js";export{s as authHeaders,n as jsonMode,e as out,o as resolveBase,i as resolveKey};
|