supercolony 0.1.4 → 0.1.6
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 +20 -18
- package/dist/commands/task.mjs +1 -1
- package/dist/commands/wallet.mjs +1 -1
- package/dist/lib/drafts.mjs +1 -0
- package/dist/lib/funding-error.mjs +1 -1
- package/dist/lib/funding-state.mjs +1 -1
- package/dist/lib/funding.mjs +1 -1
- package/dist/lib/local-wallet.mjs +1 -1
- package/dist/lib/payment-coins.mjs +1 -1
- package/dist/lib/payment-networks.mjs +1 -1
- package/dist/lib/payment-options.mjs +1 -0
- package/dist/lib/publish.mjs +1 -1
- package/dist/lib/support.mjs +1 -1
- package/dist/lib/task-wallet.mjs +1 -1
- package/dist/lib/wallet-receive.mjs +1 -1
- package/dist/lib/wallet-status.mjs +1 -1
- package/dist/program.mjs +1 -1
- package/dist/tui/app.mjs +1 -1
- package/dist/tui/controller.mjs +1 -1
- package/dist/tui/index.mjs +1 -1
- package/dist/tui/presentation.mjs +1 -1
- package/dist/tui/services.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# colony
|
|
2
2
|
|
|
3
|
-
Interactive payments offer two choices: **official fee + 10% optional support** (highlighted first), or **Original price**. The message is “Help us make Colony better.” Final payment confirmation still defaults to Cancel. For a 0.5 IMD task, the support option totals 0.55 IMD before network fees. The payment card shows the official fee and
|
|
3
|
+
Interactive payments offer two choices: **official fee + 10% optional support** (highlighted first), or **Original price**. The message is “Help us make Colony better.” Final payment confirmation still defaults to Cancel. For a 0.5 IMD task, the support option totals 0.55 IMD before network fees. The payment card shows the official fee, the coin and network it pays with, the payment amount and, separately, the gas (network fee) cap paid in ETH. Swap slippage is calculated automatically: 0.75%–5% on Ethereum and 0.75% on Robinhood. Authorization covers only the reviewed maximum; slippage is never increased after confirmation.
|
|
4
4
|
|
|
5
5
|
Support goes to the public address in `src/lib/support-recipient.mjs` on the selected payment network. The private key is never distributed with Colony. Support is a separate IMD transfer sent before task payment; it is not refunded if task admission fails. The review shows the support amount, total and recipient. Signed transfers are saved before broadcast and reused on recovery. Non-interactive commands and `--yes` use the original price without adding support.
|
|
6
6
|
|
|
@@ -25,13 +25,12 @@ colony --ascii
|
|
|
25
25
|
|
|
26
26
|
The dashboard has **My tasks**, **Explore**, **Workers** and **Wallets** at the top. Wide terminals show a list and details side by side; below 100 columns, Enter opens details and Esc returns to the list. Use an interactive terminal at least 40 columns by 20 rows. `--ascii` uses ordinary ASCII borders. Special fonts, WSL and a browser are not required.
|
|
27
27
|
|
|
28
|
-
Panel actions stay visible along the bottom of their frame. Task lists contain New task, Search and Refresh; My tasks also has Filter. The Workers list contains Add target, Search and Refresh, while the selected worker's actions stay in its details pane. Wallet actions and Refresh belong to the selected wallet; New, Import and
|
|
28
|
+
Panel actions stay visible along the bottom of their frame. Task lists contain New task, Search and Refresh; My tasks also has Filter. The Workers list contains Add target, Search and Refresh, while the selected worker's actions stay in its details pane. Wallet actions and Refresh belong to the selected wallet; New, Import, Manage and Receive funds remain in Wallet management. Selection and Enter/Tab hints stay in the list; return, scrolling and detail-tab hints stay in the details pane. Shortcuts wrap as whole entries on narrow terminals. The screen footer contains only global Help and Quit; during input, confirmation or an operation, it shows Ctrl+C to exit.
|
|
29
29
|
|
|
30
30
|
| Key | Action |
|
|
31
31
|
| --- | --- |
|
|
32
32
|
| `1`–`4` | Switch workspace |
|
|
33
33
|
| `n` | Describe a task, then review its official fee |
|
|
34
|
-
| Up / Down in the task form | Switch payment coin |
|
|
35
34
|
| Up / Down, Enter, Esc | Select, open, return |
|
|
36
35
|
| `/`, `f`, `r` | Search, cycle My tasks filters, refresh |
|
|
37
36
|
| Tab, `[` / `]`, Page Up / Down | Focus list/details, switch detail tab, scroll |
|
|
@@ -42,11 +41,10 @@ Panel actions stay visible along the bottom of their frame. Task lists contain N
|
|
|
42
41
|
| `n`, `i`, `m` in Wallets | Create wallet, import a private key or backup, selected wallet actions |
|
|
43
42
|
| `u`, `g` in Wallets | Use the selected wallet, manage all wallets |
|
|
44
43
|
| `d`, `b` in Wallets | Receive funds / QR code, back up encrypted wallet |
|
|
45
|
-
| `p` in Wallets | Choose Ethereum or Robinhood Chain for new payments |
|
|
46
44
|
| Down at the end of Explore, `l` | Automatically load older tasks; `l` also loads/retries manually |
|
|
47
45
|
| `e`, `?`, `q` | Full error, keyboard help, quit |
|
|
48
46
|
|
|
49
|
-
Form fields use Enter to advance/submit and Tab to switch fields. A new task asks only for your request, then uses the local planner and the existing IMD payment/order workflow. The payment card shows the official admission fee; confirmation defaults to **Cancel**.
|
|
47
|
+
Form fields use Enter to advance/submit and Tab to switch fields. A new task asks only for your request, then uses the local planner and the existing IMD payment/order workflow. You never pick a network up front. Colony checks Ethereum and Robinhood Chain together and picks a coin and network with enough balance (IMD first, then stablecoins, then ETH; the lower-gas network wins ties). The payment card shows the official admission fee, "Pay with <coin> on <network>", the payment amount and the gas (network fee) cap separately; confirmation defaults to **Cancel**. **Change payment** lists the other funded options with their amounts. If no option has enough funds, the card lists both networks side by side, for example "0.5 IMD or ≈ 2.01 USDC or ≈ 0.0006 ETH" plus gas, and suggests the smallest top-up. **Add funds** first asks which network you will send on, then shows that network's address, QR code and amounts. Tab selects the payment action, Enter confirms, and Esc returns to editing without signing. `--yes` never bypasses this dashboard confirmation. `i` reveals the payment network, asset, recipient and server-prepared input. Task admission does not guarantee completion. Wallet authorization transactions can incur separate gas fees.
|
|
50
48
|
|
|
51
49
|
Explore shows the server's actual task total and refreshes in the background every 30 seconds. New tasks appear at the top, changed states update in place, and the selected task, loaded history and detail scroll position are preserved. Refreshing pauses during forms, payment confirmation and worker operations. Read errors are visible and the next scheduled refresh retries. Reaching the end of the loaded list automatically appends older tasks. Loading, errors and the end of history are visible; search results show the loaded count until all matches have been fetched because the API does not provide a search total. `r` reloads the latest list and resets loaded history.
|
|
52
50
|
|
|
@@ -78,6 +76,10 @@ First-time preparation names **Qwen** (about 533 MB) and explains its purpose: u
|
|
|
78
76
|
|
|
79
77
|
Before a paid task loads the local LLM or requests an order, Colony checks the selected wallet, payment coin and ETH network fee allowance using the current IMD price and live exchange quotes. If funds are insufficient, the dashboard shows the receiving address and network with **Check balance & continue**. The entered task is kept. This read-only check needs no wallet password; the final review includes the exact quote and any optional support. `--dry-run` remains available without a wallet. Startup tips explain natural-language tasks, automatic task settings, local inference and payment review.
|
|
80
78
|
|
|
79
|
+
The dashboard saves your request as a local **Draft** before checking the wallet or downloading the LLM. If no wallet exists, choose **Open Wallets** to create/import one, or return to My tasks. Drafts survive restarts; select one and press `o` to continue editing and publishing. Task actions also let you delete an unwanted draft. Once an order is saved, it takes over the same local request ID and replaces the draft in My tasks.
|
|
80
|
+
|
|
81
|
+
When the balance is insufficient, choose **Add funds** to open the receiving QR code for that payment's wallet and network. Press Esc to return to the same balance prompt, then **Check balance & continue** after depositing. Saving the QR with `s` is also available. Your request and completed payment steps are kept; balances, exchange rates and fees are checked again before the payment review.
|
|
82
|
+
|
|
81
83
|
## 安装
|
|
82
84
|
|
|
83
85
|
需要 Node.js 22+,Windows、Linux 和 macOS 使用相同安装命令。npm 包名为 `supercolony`:
|
|
@@ -127,8 +129,8 @@ npm publish
|
|
|
127
129
|
--api <url> IMD API,默认 COLONY_API_URL 或 https://api.imd.fun
|
|
128
130
|
--home <dir> 本地状态目录,默认 COLONY_HOME 或 ~/.super-colony
|
|
129
131
|
--rpc <url> 可选自定义 RPC,也可用 COLONY_RPC_URL;两条付款链已内置默认节点
|
|
130
|
-
--payment-chain <network>
|
|
131
|
-
--pay-with <coin>
|
|
132
|
+
--payment-chain <network> 可选,只在 ethereum 或 robinhood 上付款;默认按余额自动选择
|
|
133
|
+
--pay-with <coin> 可选,只用 IMD / ETH / USDT / USDC / USDG 付款;默认按余额自动选择
|
|
132
134
|
--key-env <name> 可选脚本用私钥环境变量;没有本地钱包时使用,默认 COLONY_PRIVATE_KEY
|
|
133
135
|
--json 只向 stdout 输出一份 JSON;提示/日志走 stderr
|
|
134
136
|
--yes 跳过交互确认(脚本用)
|
|
@@ -281,6 +283,8 @@ colony task continue <jobId> --request-key <requestKey>
|
|
|
281
283
|
|
|
282
284
|
私钥和密码均隐藏输入,不必配置环境变量。钱包采用标准 Ethereum V3 JSON Keystore:首个钱包保存在 `$COLONY_HOME/wallet.json`,其他钱包保存在 `$COLONY_HOME/wallets/<address>.json`;已有首个钱包无需移动或改写,其密码就是本地统一密码。`wallet-selection.json` 仅记录当前公开地址。界面不显示锁定状态,也无需手动解锁。只有付款、授权、新增或导入等需要使用密码的操作才会询问;本次运行中已输入的密码可复用,付款仍需确认金额。浏览、查余额、收款和加密备份不需要密码。退出仪表盘清除当前进程内的密码和签名账户缓存,密码不以明文保存在磁盘。
|
|
283
285
|
|
|
286
|
+
在所选本地钱包的 `m` → **Delete wallet** 中可删除钱包。两次确认均显示完整地址并默认保留;完成两次确认后删除本机加密私钥。链上资金、已导出的备份和任务记录保留。删除当前钱包会选择另一个本地钱包,删除最后一个后可重新创建或导入;其他钱包仍使用原来的统一密码。
|
|
287
|
+
|
|
284
288
|
`d` 展示充值地址和二维码,`s` 可保存 SVG。请在发送方选择页面显示的 Ethereum 或 Robinhood Chain,并留一些 ETH 支付网络费。二维码只含公开地址、不包含私钥或密码,也不会替发送方自动选择网络。余额查询、充值和加密备份不需要解锁。终端太小时会提示扩大窗口或导出二维码,不显示被裁剪的二维码。
|
|
285
289
|
|
|
286
290
|
首次充值前按 `b` 备份所选钱包,并单独保管本地统一密码。每个钱包需要分别备份。恢复需要备份文件和它原来的密码;恢复到已有钱包库时,使用本地统一密码重新加密。恢复到空目录时,备份密码成为本地密码。Colony 无法找回丢失的密码。创建、导入和恢复会添加钱包,不覆盖已有钱包;重复地址提示切换到已保存的钱包。备份和二维码导出也不会覆盖已有文件。
|
|
@@ -297,30 +301,28 @@ colony wallet receive --out colony-receive.svg
|
|
|
297
301
|
colony wallet backup --out colony-wallet-backup.json
|
|
298
302
|
colony wallet restore --file colony-wallet-backup.json # 添加并选中恢复的钱包
|
|
299
303
|
colony wallet address
|
|
300
|
-
colony wallet
|
|
301
|
-
colony wallet network robinhood # 保存为 Robinhood Chain
|
|
302
|
-
colony wallet status
|
|
304
|
+
colony wallet status # 同时列出 Ethereum 和 Robinhood Chain 的余额
|
|
303
305
|
colony wallet approve --amount 0.5
|
|
304
|
-
colony task create "Build a website for my coffee shop"
|
|
305
|
-
|
|
306
|
-
colony wallet network ethereum # 切回 Ethereum
|
|
307
|
-
colony task create "Write a research report" --payment-chain robinhood
|
|
306
|
+
colony task create "Build a website for my coffee shop" # 自动选择网络和币种
|
|
307
|
+
colony task create "Write a research report" --payment-chain robinhood # 只在 Robinhood Chain 付款
|
|
308
308
|
```
|
|
309
309
|
|
|
310
310
|
- 本地钱包优先使用,私钥只以加密形式写盘,不上传。`--key-env` 仅保留给没有本地钱包的脚本用法,普通用户无需使用它。密码不接受命令行参数,也不写入订单、日志或终端交接消息。
|
|
311
311
|
- `wallet approve` 是显式链上交易,只授权指定数量;Ethereum 授权 Permit2,Robinhood 授权真实报价对应的 Intake,**不会默认无限授权**。
|
|
312
312
|
- CLI 可用 `wallet approve --amount 0.5 --wallet <address>` 明确指定预期地址。确认时显示该地址,签名前若当前钱包已经改变则停止。任务付款也绑定本次流程开始时的钱包,避免另一终端切换钱包后从不同账户付款。
|
|
313
|
-
- 支持 Ethereum 与 Robinhood Chain 两条正式付款链,公共 RPC 均已内置。普通用户无需设置 RPC
|
|
314
|
-
-
|
|
313
|
+
- 支持 Ethereum 与 Robinhood Chain 两条正式付款链,公共 RPC 均已内置。普通用户无需设置 RPC,也不需要切换网络:同一个地址在两条链上通用,余额分别计算。每次付款时 Colony 同时查询两条链,自动选一个余额足够的方案(优先直接用 IMD,其次稳定币,再次 ETH;同类中选 gas 更低的网络)。确认卡上的 `Change payment` 可改用其他余额足够的网络或币种。不提供 Sepolia 测试币付款。
|
|
314
|
+
- 付款金额和 gas(网络费)分开显示。gas 总是用同一网络上的 ETH 支付;用 ETH 付款时,付款和 gas 都从 ETH 余额扣。
|
|
315
|
+
- 余额不足时,提示页并排列出两条链各自的价格、每种可用币种的金额(例如 “0.5 IMD 或 ≈ 2.01 USDC 或 ≈ 0.0006 ETH”)、gas 估算和最省事的补足方式。选择 `Add funds` 后先选打算转入的网络,再显示该网络的收款地址、二维码和需要的金额。
|
|
316
|
+
- Ethereum 沿用 x402 签名付款;Robinhood 使用同一份 HTTP 订单返回的签名报价,通过 Intake `pay` 结算。任务和续作仍进入同一个“我的任务”列表。已经签名或广播过的订单恢复时固定使用原付款网络和币种。
|
|
315
317
|
- 直接用 IMD 支付时,两条链都会检查余额和授权额度;额度不足会在付款确认后自动授权本次所需数量,无需另外运行命令。原价、可选支持和自动换币使用同一付款准备流程。确认卡显示实际网络、价格、最高扣款及 ETH 手续费上限。
|
|
316
318
|
- Robinhood 的签名交易及其哈希在广播前保存。中断后 `order submit` 先查原订单和交易;需要重发时只广播原字节,不创建新订单、不重新签付款。签过的记录不能本地取消或删除。
|
|
317
|
-
- `wallet status` 从 capabilities
|
|
319
|
+
- `wallet status` 从 capabilities 读取资产/价格,同时查询两条链的付款币种余额及 IMD 支付额度,并校验节点链 id。某条链暂时不可用时,只在该链下显示错误。
|
|
318
320
|
- `--rpc` / `COLONY_RPC_URL` 仅用于显式覆盖默认节点。自定义节点失败或链 id 不符时直接报错;不自动切换到其他节点。付款只支持这两条主网;其他网络的 worker 链上操作需要显式提供 RPC。
|
|
319
321
|
- 开发/CI 不应执行真实 approve 或 register 交易。
|
|
320
322
|
|
|
321
323
|
### 自动换币付款
|
|
322
324
|
|
|
323
|
-
Ethereum 支持 **IMD、ETH、USDT、USDC**;Robinhood Chain 支持 **IMD、ETH、USDG
|
|
325
|
+
Ethereum 支持 **IMD、ETH、USDT、USDC**;Robinhood Chain 支持 **IMD、ETH、USDG**。默认自动选择余额足够的币种和网络;CLI 可用 `--pay-with` / `--payment-chain` 限定,仪表盘在确认卡上用 `Change payment` 更换。尚未签名的订单恢复时也可以更换付款方式。
|
|
324
326
|
|
|
325
327
|
```sh
|
|
326
328
|
colony task create "Build a website for my coffee shop" --pay-with USDC
|
package/dist/commands/task.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{writeDiagnostic as _0x21ccbf}from'../lib/terminal-text.mjs';import{paymentProgressReporter as _0x47f5e4}from'../lib/payment-progress.mjs';import{request as _0x25f307,print as _0x5afad3}from'../shared.mjs';function _0x358c(){const _0x5769d0=['\x20--refresh','length','option','retry','count','stringify','paidBy','files','source:\x20\x20\x20\x20','toFixed','saved\x20input:\x20','challenge','runnable\x20skill\x20id','--limit\x20<n>','input','updated:\x20\x20\x20','--exclude-oracle','--github','before','--commit\x20<sha>','statusUrl','github','skill','only\x20run\x20the\x20free\x20check\x20and\x20print\x20the\x20input','\x20tx\x20','Your\x20request\x20is\x20saved.\x20Continue\x20payment\x20to\x20check\x20the\x20original\x20payment\x20before\x20retrying.','s\x20(retry\x20','source','reuse\x20a\x20saved\x20order\x20request\x20key','explorerUrl','payment_failed','head','blocked','kind','browse\x20and\x20publish\x20IMD\x20tasks','requestKey','--before\x20<time>','transactionHash','\x20was\x20created\x20for\x20action\x20','\x20\x20\x20\x20hash:\x20','\x20versions=','optsWithGlobals','refusalProblems','deliverables','--path\x20<path>','trim','payTo','exclude','repo','complete:\x20\x20','show\x20<id>','prepared\x20input:','paid\x20by:\x20\x20\x20','excludeOracle','payWith','json','--file\x20<path>','result','--since\x20<time>','path','list\x20jobs','validate\x20a\x20job\x20body\x20without\x20creating\x20an\x20order','reviews','order\x20ended\x20with\x20status:\x20','\x20head=','string','mediaType','file','submissionHash','Payment\x20needs\x20review.','launch:\x20\x20\x20\x20','show\x20one\x20job','requiredOption','list','project:\x20\x20\x20','resultUrl','request\x20key\x20','status:\x20\x20\x20\x20','delivery','exitCode','home','stdin','create\x20[objective]','rpc','result\x20response\x20is\x20missing\x20jobId','jobs','--out\x20<dir>','jobs\x20response\x20is\x20missing\x20jobs','action\x20to\x20check\x20(defaults\x20from\x20parentJobId)','payer','asset','since','template:\x20\x20','paymentChain','attempt','check,\x20quote,\x20sign\x20and\x20submit\x20a\x20job\x20file','--action\x20<action>','\x20->\x20','hash','code','named\x20input\x20preset\x20(report)','node','save','reason','limit','parent:\x20\x20\x20\x20','summary','detail','base\x20commit\x20for\x20--repo','answer','isArray','interrupted','wait\x20<id>','\x20version(s))','\x20(poll\x20','updatedAt','commit','data','elapsedMs','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20500','join','url','order\x20','\x20verdict=','Network\x20error','description','yes','download:\x20','job\x20template','title','template','oracle','job:\x20\x20\x20\x20\x20\x20\x20','amount','short','complete','show\x20a\x20job\x20result\x20and\x20artifact\x20URLs','/jobs/','expired','versions','status','resultUrl:\x20','summary:\x20','check:\x20\x20\x20\x20\x20','poll\x20interval\x20in\x20seconds','completed','blockers:\x20','\x20belongs\x20to\x20parent\x20job\x20','project\x20ready','transaction','questions','job.open','outcome','payment:\x20','publish',';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20','\x20--home\x20','unknown','\x20blocker(s)','retries','result\x20<id>','check:\x20','toString','complete\x20continuation\x20body\x20JSON\x20file','/result','complete\x20job\x20body\x20JSON\x20file','input:','page\x20size\x20(1-500)','blockers','payment_reconciling','isTTY','keyEnv',',\x20not\x20','objective','download\x20a\x20completed\x20job\x27s\x20files\x20under\x20--out','padEnd','objective:\x20','wait:\x20','workflow','slice',';\x20retrying\x20in\x20','--template\x20<name>','--preset\x20<name>','ethereum','jobs\x20that\x20moved\x20after\x20this\x20time','delivery:\x20\x20','save\x20the\x20input\x20JSON\x20without\x20overwriting','action','--answer\x20<text>','quote','push','task','\x20task\x20continue\x20','api','command','verdict','exclude\x20oracle\x20panel\x20jobs','dryRun','--request-key\x20<uuid>','delayMs','s)\x0a','pendingTransaction','poll','none','poll\x20a\x20job\x20result\x20until\x20it\x20completes,\x20fails\x20or\x20times\x20out','repository\x20path\x20the\x20job\x20may\x20write\x20(repeatable)','check','\x0aquestions:\x0a','\x20\x20\x20\x20url:\x20\x20','saved','launch','\x20--request-key\x20','\x20\x20-\x20','--repo\x20<url>','set','\x20\x20-\x20none','interval','plan','wait:\x20interrupted\x0a','state','colony\x20--api\x20','destination\x20directory','refused','--save\x20<path>','isInteger','--dry-run','bytes','project','paymentStatus','statusUrl:\x20','\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it','nodes','type','transaction:\x20','parent','files:\x20\x20\x20\x20\x20','tx:\x20\x20\x20\x20\x20\x20\x20\x20','message','state:\x20\x20\x20\x20\x20','reviews:\x20\x20\x20','job\x20response\x20is\x20missing\x20id','parentJobId','job\x20body\x20JSON\x20file','expiresAt','orderId','job.continue','objective\x20or\x20job\x20id\x20prefix','--interval\x20<seconds>','preset','workflow:\x20\x20',';\x20rerun\x20with\x20--api\x20','jobId','create\x20a\x20job\x20from\x20a\x20clear\x20objective\x20or\x20a\x20JSON\x20file'];_0x358c=function(){return _0x5769d0;};return _0x358c();}import{checkJob as _0x51329e,publishJob as _0xe17452,readJobFile as _0xf06f7d}from'../lib/publish.mjs';import{loadOrder as _0x5e9534}from'../lib/orders.mjs';import{buildContinueInput as _0x5bd41a,buildCreateInput as _0x191f76,parentSummary as _0x180a5a,resolveAction as _0x35cbad,saveInputFile as _0x17d4ce}from'../lib/task-input.mjs';import{DEFAULT_INTERVAL_SECONDS as _0x531daf,DEFAULT_TIMEOUT_SECONDS as _0x293eeb,downloadTaskFiles as _0x500ece,waitForResult as _0xc012f9}from'../lib/task-result.mjs';import{askQuestions as _0x2a6a3f,loadLocalPlanner as _0x4d9a9e,planTask as _0x1f89a4}from'../planner/flow.mjs';import{registerMyTaskCommands as _0x59d651}from'./my-tasks.mjs';import{orderPayment as _0x228938}from'../lib/payments.mjs';import{checkTaskWallet as _0x1e393c}from'../lib/task-wallet.mjs';function V(_0x31ad26){const _0x4b2f47=_0x9bc3,_0x1cfb09=new URLSearchParams();if(_0x31ad26['q']!==void 0x0&&_0x1cfb09['set']('q',_0x31ad26['q']),_0x31ad26[_0x4b2f47(0x1d2)]!==void 0x0&&_0x1cfb09[_0x4b2f47(0x296)](_0x4b2f47(0x1d2),_0x31ad26['before']),_0x31ad26['since']!==void 0x0&&_0x1cfb09[_0x4b2f47(0x296)]('since',_0x31ad26[_0x4b2f47(0x21b)]),_0x31ad26[_0x4b2f47(0x228)]!==void 0x0){const _0x184d18=Number(_0x31ad26[_0x4b2f47(0x228)]);if(!Number[_0x4b2f47(0x2a0)](_0x184d18)||_0x184d18<0x1||_0x184d18>0x1f4)throw new Error(_0x4b2f47(0x237));_0x1cfb09['set'](_0x4b2f47(0x228),String(_0x184d18));}_0x31ad26[_0x4b2f47(0x1f5)]&&_0x1cfb09[_0x4b2f47(0x296)](_0x4b2f47(0x1ef),_0x4b2f47(0x243));const _0x3c417b=_0x1cfb09[_0x4b2f47(0x262)]();return _0x3c417b?'/jobs?'+_0x3c417b:'/jobs';}function y(_0x4e23a1,_0x32dc0e=0x5a){const _0x20d833=_0x9bc3,_0x5999cd=String(_0x4e23a1??'')['replace'](/\s+/g,'\x20')[_0x20d833(0x1ed)]();return _0x5999cd[_0x20d833(0x1c1)]>_0x32dc0e?_0x5999cd[_0x20d833(0x273)](0x0,_0x32dc0e-0x1)+'…':_0x5999cd;}function X(_0x1b8860){const _0x5e63fe=_0x9bc3;if(!Array[_0x5e63fe(0x22e)](_0x1b8860?.['jobs']))throw new Error(_0x5e63fe(0x217));const _0x19b3f2=[_0x1b8860[_0x5e63fe(0x1c4)]+'\x20job(s)'];for(const _0x4e93fd of _0x1b8860[_0x5e63fe(0x215)])_0x19b3f2['push'](_0x4e93fd['id']+'\x20\x20'+_0x4e93fd[_0x5e63fe(0x29b)][_0x5e63fe(0x26f)](0xa)+'\x20\x20'+String(_0x4e93fd[_0x5e63fe(0x242)]??'')[_0x5e63fe(0x26f)](0x16)+'\x20\x20'+(_0x4e93fd[_0x5e63fe(0x233)]??'')+'\x20\x20'+y(_0x4e93fd[_0x5e63fe(0x26d)]));return _0x19b3f2[_0x5e63fe(0x238)]('\x0a');}function Z(_0xe08137){const _0x5026a4=_0x9bc3;if(!_0xe08137?.['id'])throw new Error(_0x5026a4(0x2b0));const _0x111a0f=['job:\x20\x20\x20\x20\x20\x20\x20'+_0xe08137['id'],_0x5026a4(0x2ae)+_0xe08137[_0x5026a4(0x29b)],_0x5026a4(0x21c)+(_0xe08137[_0x5026a4(0x242)]??''),_0x5026a4(0x270)+y(_0xe08137[_0x5026a4(0x26d)],0x1f4),'created:\x20\x20\x20'+(_0xe08137['createdAt']??''),_0x5026a4(0x1cf)+(_0xe08137[_0x5026a4(0x233)]??''),_0x5026a4(0x1f4)+(_0xe08137[_0x5026a4(0x1c6)]??''),_0x5026a4(0x20a)+(_0xe08137[_0x5026a4(0x2a3)]?_0xe08137[_0x5026a4(0x2a3)]['id']+'\x20('+(_0xe08137[_0x5026a4(0x2a3)][_0x5026a4(0x24b)]?.[_0x5026a4(0x1c1)]??0x0)+_0x5026a4(0x231):_0x5026a4(0x28b)),_0x5026a4(0x279)+(_0xe08137['delivery']?JSON[_0x5026a4(0x1c5)](_0xe08137[_0x5026a4(0x20e)]):_0x5026a4(0x28b)),_0x5026a4(0x206)+(_0xe08137[_0x5026a4(0x292)]?JSON[_0x5026a4(0x1c5)](_0xe08137[_0x5026a4(0x292)]):'none')];if(Array['isArray'](_0xe08137['nodes'])){_0x111a0f[_0x5026a4(0x27e)]('nodes:\x20\x20\x20\x20\x20'+_0xe08137['nodes'][_0x5026a4(0x1c1)]);for(const _0xac8d11 of _0xe08137[_0x5026a4(0x2a7)])_0x111a0f[_0x5026a4(0x27e)](_0x5026a4(0x294)+_0xac8d11['key']+':\x20'+_0xac8d11[_0x5026a4(0x29b)]+'\x20attempt='+_0xac8d11['attempt']+_0x5026a4(0x23b)+(_0xac8d11[_0x5026a4(0x283)]?.[_0x5026a4(0x24c)]??_0x5026a4(0x28b)));}return Array[_0x5026a4(0x22e)](_0xe08137[_0x5026a4(0x1fe)])&&_0x111a0f['push'](_0x5026a4(0x2af)+_0xe08137[_0x5026a4(0x1fe)][_0x5026a4(0x1c1)]),_0xe08137[_0x5026a4(0x272)]?.['id']&&_0x111a0f[_0x5026a4(0x27e)]((_0x5026a4(0x2b9)+_0xe08137['workflow']['id']+'\x20'+(_0xe08137[_0x5026a4(0x272)][_0x5026a4(0x24c)]??''))['trim']()),_0x111a0f['join']('\x0a');}function S(_0x5e8d3f){const _0x7f955a=_0x9bc3;if(!_0x5e8d3f?.[_0x7f955a(0x2bb)])throw new Error(_0x7f955a(0x214));const _0x5454f4=['job:\x20\x20\x20\x20\x20\x20\x20'+_0x5e8d3f['jobId'],_0x7f955a(0x2ae)+_0x5e8d3f[_0x7f955a(0x29b)],_0x7f955a(0x1f1)+_0x5e8d3f['complete']],_0x2fe17c=Array[_0x7f955a(0x22e)](_0x5e8d3f[_0x7f955a(0x1c7)])?_0x5e8d3f[_0x7f955a(0x1c7)]:[];_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x2ab)+_0x2fe17c[_0x7f955a(0x1c1)]);for(const _0x55a9de of _0x2fe17c)_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x294)+_0x55a9de[_0x7f955a(0x1fb)]+'\x20('+_0x55a9de[_0x7f955a(0x2a2)]+'\x20bytes,\x20'+_0x55a9de[_0x7f955a(0x202)]+')'),_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x1e7)+_0x55a9de[_0x7f955a(0x222)]),_0x5454f4['push'](_0x7f955a(0x290)+_0x55a9de[_0x7f955a(0x239)]);const _0x1393e1=Array[_0x7f955a(0x22e)](_0x5e8d3f[_0x7f955a(0x1db)])?_0x5e8d3f[_0x7f955a(0x1db)]:[];_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x1c8)+_0x1393e1[_0x7f955a(0x1c1)]);for(const _0x5c46c8 of _0x1393e1)_0x5454f4['push']('\x20\x20-\x20'+(_0x5c46c8[_0x7f955a(0x225)]??_0x5c46c8[_0x7f955a(0x204)])+':\x20'+_0x5c46c8[_0x7f955a(0x239)]);return _0x5e8d3f[_0x7f955a(0x20e)]&&_0x5454f4[_0x7f955a(0x27e)](_0x7f955a(0x279)+JSON['stringify'](_0x5e8d3f[_0x7f955a(0x20e)])),_0x5e8d3f['launch']&&_0x5454f4['push'](_0x7f955a(0x206)+JSON[_0x7f955a(0x1c5)](_0x5e8d3f[_0x7f955a(0x292)])),_0x5454f4[_0x7f955a(0x238)]('\x0a');}function ee(_0x1bc48f){const _0x12ac00=_0x9bc3,_0x156feb=[_0x12ac00(0x244)+_0x1bc48f['jobId'],_0x12ac00(0x2ae)+_0x1bc48f[_0x12ac00(0x29b)],_0x12ac00(0x2ab)+_0x1bc48f['files']['length']];for(const _0x466e7e of _0x1bc48f[_0x12ac00(0x1c7)])_0x156feb[_0x12ac00(0x27e)](_0x12ac00(0x294)+_0x466e7e[_0x12ac00(0x1fb)]+_0x12ac00(0x221)+_0x466e7e[_0x12ac00(0x203)]+'\x20('+_0x466e7e[_0x12ac00(0x2a2)]+'\x20bytes)'),_0x156feb[_0x12ac00(0x27e)](_0x12ac00(0x1e7)+_0x466e7e[_0x12ac00(0x222)]);return _0x156feb[_0x12ac00(0x238)]('\x0a');}function x(_0x380ca6){const _0x1d21f4=_0x9bc3,_0x1b8480=[_0x1d21f4(0x252)+_0x380ca6[_0x1d21f4(0x268)][_0x1d21f4(0x1c1)]];for(const _0x313fc7 of _0x380ca6[_0x1d21f4(0x268)])_0x1b8480[_0x1d21f4(0x27e)]('\x20\x20-\x20'+_0x313fc7['code']+':\x20'+_0x313fc7['detail']);const _0x2e64f7=Array['isArray'](_0x380ca6[_0x1d21f4(0x299)])?_0x380ca6[_0x1d21f4(0x299)]:[];_0x1b8480[_0x1d21f4(0x27e)]('plan:\x20'+_0x2e64f7['length']);for(const _0x17afd2 of _0x2e64f7)_0x1b8480[_0x1d21f4(0x27e)](_0x1d21f4(0x294)+(_0x17afd2[_0x1d21f4(0x241)]??_0x17afd2[_0x1d21f4(0x246)]??_0x17afd2['skill'])+(_0x17afd2[_0x1d21f4(0x1d6)]?'\x20('+_0x17afd2[_0x1d21f4(0x1d6)]+')':''));return _0x1b8480[_0x1d21f4(0x238)]('\x0a');}function I(_0x4c647a){const _0x2e0b41=_0x9bc3,_0x3ee11b=_0x4c647a[_0x2e0b41(0x27d)]?_0x228938(_0x4c647a):null;return{'status':_0x4c647a['status'],'action':_0x4c647a[_0x2e0b41(0x27b)],'requestKey':_0x4c647a['requestKey'],'orderId':_0x4c647a['orderId'],'jobId':_0x4c647a['jobId']??null,'statusUrl':_0x4c647a['statusUrl']??null,'resultUrl':_0x4c647a[_0x2e0b41(0x20b)]??null,'transactionHash':_0x4c647a['transactionHash']??null,'problems':_0x4c647a[_0x2e0b41(0x1ea)]??null,'parentJobId':_0x4c647a[_0x2e0b41(0x1ce)]?.[_0x2e0b41(0x2b1)]??null,'parent':_0x4c647a['parent']??null,'project':_0x4c647a[_0x2e0b41(0x28e)]?.[_0x2e0b41(0x2a3)]??null,'payer':_0x4c647a[_0x2e0b41(0x219)]??null,'paymentChain':_0x4c647a[_0x2e0b41(0x21d)]??_0x2e0b41(0x277),'payWith':_0x4c647a['payWith']??'IMD','prepared':_0x4c647a['challenge']?.[_0x2e0b41(0x1ce)]??null,'quote':_0x4c647a[_0x2e0b41(0x27d)]?{'amount':_0x3ee11b[_0x2e0b41(0x245)],'asset':_0x3ee11b[_0x2e0b41(0x21a)],'payTo':_0x3ee11b[_0x2e0b41(0x1ee)],'expiresAt':_0x4c647a[_0x2e0b41(0x27d)][_0x2e0b41(0x2b3)]}:null};}function te(_0x512f17){const _0x2dde33=_0x9bc3,_0x3937dd=[_0x2dde33(0x20d)+_0x512f17[_0x2dde33(0x24c)],'action:\x20\x20\x20\x20'+_0x512f17[_0x2dde33(0x27b)],'order:\x20\x20\x20\x20\x20'+_0x512f17[_0x2dde33(0x2b4)],_0x2dde33(0x244)+(_0x512f17['jobId']??'')];if(_0x512f17[_0x2dde33(0x1d4)]&&_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x2a5)+_0x512f17[_0x2dde33(0x1d4)]),_0x512f17[_0x2dde33(0x20b)]&&_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x24d)+_0x512f17[_0x2dde33(0x20b)]),_0x512f17[_0x2dde33(0x1e5)]&&_0x3937dd['push'](_0x2dde33(0x2ac)+_0x512f17[_0x2dde33(0x1e5)]),_0x512f17[_0x2dde33(0x2aa)]&&(_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x229)+_0x512f17[_0x2dde33(0x2aa)]['id']+'\x20('+(_0x512f17[_0x2dde33(0x2aa)]['state']??_0x2dde33(0x25d))+')'),_0x512f17['parent'][_0x2dde33(0x2a3)]&&_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x20a)+_0x512f17[_0x2dde33(0x2aa)][_0x2dde33(0x2a3)]['id']+_0x2dde33(0x200)+(_0x512f17['parent'][_0x2dde33(0x2a3)][_0x2dde33(0x1df)]??''))),_0x512f17[_0x2dde33(0x28e)]?.['project']){const _0x5f9a19=_0x512f17[_0x2dde33(0x28e)][_0x2dde33(0x2a3)];_0x3937dd['push'](_0x2dde33(0x24f)+(_0x5f9a19['summary']??_0x5f9a19['id']??_0x2dde33(0x254)));}return!_0x512f17['plan']&&_0x512f17[_0x2dde33(0x27b)]===_0x2dde33(0x2b5)&&_0x512f17[_0x2dde33(0x1cb)]?.[_0x2dde33(0x1ce)]&&(_0x3937dd[_0x2dde33(0x27e)](_0x2dde33(0x1f3)),_0x3937dd[_0x2dde33(0x27e)](JSON['stringify'](_0x512f17[_0x2dde33(0x1cb)][_0x2dde33(0x1ce)],null,0x2))),_0x3937dd[_0x2dde33(0x238)]('\x0a');}function C(_0x5b7ef1,_0x144c0f){const _0x947461=_0x9bc3;if(_0x5b7ef1['status']===_0x947461(0x1e0)){_0x144c0f[_0x947461(0x1f7)]?_0x5afad3({'status':_0x947461(0x1e0),'action':_0x5b7ef1[_0x947461(0x29b)]['action'],'requestKey':_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x1e3)],'parent':_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2aa)]??null,'check':_0x5b7ef1[_0x947461(0x28e)]},_0x144c0f):(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2aa)]&&_0x21ccbf(A(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2aa)])+'\x0a'),_0x21ccbf(x(_0x5b7ef1[_0x947461(0x28e)])+'\x0anot\x20paid:\x20blockers\x20must\x20be\x20resolved\x20first\x0a')),process[_0x947461(0x20f)]=0x1;return;}if(_0x5b7ef1[_0x947461(0x24c)]==='refused'){const _0x38663c=I(_0x5b7ef1[_0x947461(0x29b)]);if(_0x144c0f[_0x947461(0x1f7)])_0x5afad3({..._0x38663c,'status':_0x947461(0x29e)},_0x144c0f);else{const _0x3d120e=[_0x947461(0x23a)+_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2b4)]+'\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.',_0x947461(0x259)+(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x2a4)]??'unknown')+(_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x1e5)]?_0x947461(0x1d8)+_0x5b7ef1[_0x947461(0x29b)][_0x947461(0x1e5)]:'')];for(const _0x192211 of _0x5b7ef1['state'][_0x947461(0x1ea)]??[])_0x3d120e[_0x947461(0x27e)](_0x947461(0x294)+(_0x192211[_0x947461(0x223)]??_0x947461(0x29e))+':\x20'+(_0x192211[_0x947461(0x22b)]??JSON[_0x947461(0x1c5)](_0x192211)));_0x3d120e[_0x947461(0x27e)]('inspect:\x20colony\x20order\x20show\x20'+_0x5b7ef1['state'][_0x947461(0x2b4)]+_0x947461(0x1c0)),_0x21ccbf(_0x3d120e[_0x947461(0x238)]('\x0a')+'\x0a');}process[_0x947461(0x20f)]=0x1;return;}if([_0x947461(0x24a),_0x947461(0x1de),'transaction_pending',_0x947461(0x269)]['includes'](_0x5b7ef1[_0x947461(0x24c)])){const _0x2eed46=_0x5b7ef1[_0x947461(0x29b)];if(_0x144c0f['json'])_0x5afad3({...I(_0x2eed46),'status':_0x5b7ef1['status']},_0x144c0f);else{const _0x5a357d=_0x2eed46[_0x947461(0x289)]??_0x2eed46[_0x947461(0x255)],_0x2dec83=[_0x947461(0x205),_0x947461(0x1d9)];_0x5a357d?.[_0x947461(0x222)]&&_0x2dec83[_0x947461(0x27e)](_0x947461(0x2a9)+_0x5a357d['hash']+(_0x5a357d[_0x947461(0x1e1)]?'\x20('+_0x5a357d['kind']+')':'')),_0x5a357d?.[_0x947461(0x227)]&&_0x2dec83[_0x947461(0x27e)]('reason:\x20\x20\x20\x20\x20\x20'+_0x5a357d[_0x947461(0x227)]),_0x5a357d?.['explorerUrl']&&_0x2dec83['push']('explorer:\x20\x20\x20\x20'+_0x5a357d[_0x947461(0x1dd)]),_0x2eed46[_0x947461(0x1e5)]&&_0x2eed46[_0x947461(0x1e5)]!==_0x5a357d?.['hash']&&_0x2dec83[_0x947461(0x27e)](_0x947461(0x2a9)+_0x2eed46[_0x947461(0x1e5)]),_0x2eed46[_0x947461(0x2b4)]&&_0x2dec83['push']('continue:\x20\x20\x20\x20colony\x20order\x20submit\x20'+_0x2eed46[_0x947461(0x2b4)]),_0x21ccbf(_0x2dec83['join']('\x0a')+'\x0a');}process[_0x947461(0x20f)]=0x1;return;}if(_0x5b7ef1[_0x947461(0x24c)]!=='admitted')throw new Error(_0x947461(0x1ff)+_0x5b7ef1['status']+_0x947461(0x25b)+_0x5b7ef1[_0x947461(0x29b)]['orderId']+_0x947461(0x1c0));_0x5afad3(_0x144c0f[_0x947461(0x1f7)]?I(_0x5b7ef1[_0x947461(0x29b)]):te(_0x5b7ef1[_0x947461(0x29b)]),_0x144c0f);}function A(_0x11c2ac){const _0x118cab=_0x9bc3,_0x12169a=_0x180a5a(_0x11c2ac),_0x3f6d4f=[_0x118cab(0x229)+_0x12169a['id'],_0x118cab(0x2ae)+(_0x12169a[_0x118cab(0x29b)]??''),'template:\x20\x20'+(_0x12169a[_0x118cab(0x242)]??''),_0x118cab(0x270)+y(_0x12169a[_0x118cab(0x26d)],0x1f4),_0x118cab(0x1f4)+(_0x12169a[_0x118cab(0x1c6)]??'')];return _0x12169a[_0x118cab(0x2a3)]&&_0x3f6d4f[_0x118cab(0x27e)](_0x118cab(0x20a)+_0x12169a[_0x118cab(0x2a3)]['id']+_0x118cab(0x200)+(_0x12169a[_0x118cab(0x2a3)][_0x118cab(0x1df)]??'')+_0x118cab(0x1e8)+_0x12169a[_0x118cab(0x2a3)][_0x118cab(0x24b)][_0x118cab(0x1c1)]),_0x3f6d4f['join']('\x0a');}function ne(_0x34bcd9){const _0x1e71dd=_0x9bc3;return _0x34bcd9?_0x34bcd9[_0x1e71dd(0x22a)]?'project:\x20\x20\x20'+y(_0x34bcd9['summary'],0x1f4):_0x34bcd9['id']?_0x1e71dd(0x20a)+_0x34bcd9['id']:null:null;}function K(_0x136c7a,_0x15d1d5,_0x5a14b8,_0x412225){const _0xbb5062=_0x9bc3,_0x4c9445=[];_0x412225&&_0x4c9445[_0xbb5062(0x27e)](A(_0x412225)),_0x4c9445[_0xbb5062(0x27e)]('action:\x20\x20\x20\x20'+_0x136c7a),_0x4c9445[_0xbb5062(0x27e)](_0xbb5062(0x266)),_0x4c9445[_0xbb5062(0x27e)](JSON[_0xbb5062(0x1c5)](_0x15d1d5,null,0x2)),_0x4c9445[_0xbb5062(0x27e)](x(_0x5a14b8));const _0x39a68e=ne(_0x5a14b8[_0xbb5062(0x2a3)]);return _0x39a68e&&_0x4c9445[_0xbb5062(0x27e)](_0x39a68e),_0x4c9445[_0xbb5062(0x238)]('\x0a');}function J(_0x54d622){const _0xa4ba9c=_0x9bc3;return _0x54d622[_0xa4ba9c(0x203)]!==void 0x0||_0x54d622[_0xa4ba9c(0x2b8)]!==void 0x0||_0x54d622[_0xa4ba9c(0x1d6)]!==void 0x0||_0x54d622[_0xa4ba9c(0x242)]!==void 0x0||Array['isArray'](_0x54d622[_0xa4ba9c(0x1fb)])&&_0x54d622[_0xa4ba9c(0x1fb)]['length']>0x0;}function O(_0xdf395){const _0x36e28c=_0x9bc3;return _0xdf395[_0x36e28c(0x203)]!==void 0x0||_0xdf395['skill']!==void 0x0||_0xdf395[_0x36e28c(0x242)]!==void 0x0||Array[_0x36e28c(0x22e)](_0xdf395[_0x36e28c(0x1fb)])&&_0xdf395[_0x36e28c(0x1fb)][_0x36e28c(0x1c1)]>0x0;}function oe(_0x14e624,_0x2c55f7){const _0x5e55a5=_0x9bc3;return typeof _0x14e624==_0x5e55a5(0x201)&&_0x14e624['trim']()!==''&&!J(_0x2c55f7);}function ie(_0x3bc16f,_0x1648c4){const _0x53a78e=_0x9bc3;return typeof _0x3bc16f==_0x53a78e(0x201)&&_0x3bc16f['trim']()!==''&&!O(_0x1648c4);}function b(_0x3467ee){const _0x4d5ec3=_0x9bc3,_0x3f4865=[_0x4d5ec3(0x24e)+_0x3467ee[_0x4d5ec3(0x22a)],'deliverables:'];_0x3467ee['deliverables'][_0x4d5ec3(0x1c1)]===0x0&&_0x3f4865['push'](_0x4d5ec3(0x297));for(const _0x3eb3b9 of _0x3467ee[_0x4d5ec3(0x1eb)])_0x3f4865[_0x4d5ec3(0x27e)](_0x4d5ec3(0x294)+_0x3eb3b9);return _0x3f4865[_0x4d5ec3(0x238)]('\x0a');}function U(_0x4abce8,_0x126245){const _0x4e3c0d=_0x9bc3,_0x27be26=[b(_0x4abce8),_0x4e3c0d(0x261)+_0x126245[_0x4e3c0d(0x268)][_0x4e3c0d(0x1c1)]+_0x4e3c0d(0x25e)];for(const _0x229107 of _0x126245['blockers'])_0x27be26[_0x4e3c0d(0x27e)](_0x4e3c0d(0x294)+_0x229107[_0x4e3c0d(0x223)]+':\x20'+_0x229107['detail']);return _0x27be26[_0x4e3c0d(0x238)]('\x0a');}function _0x9bc3(_0x587028,_0x358c72){_0x587028=_0x587028-0x1c0;const _0x9bc34=_0x358c();let _0x1ff695=_0x9bc34[_0x587028];return _0x1ff695;}function N(_0x28c01e,_0x48103c,_0x310612){const _0x447733=_0x9bc3;if(_0x310612[_0x447733(0x1f7)])_0x5afad3({'action':_0x48103c,'summary':_0x28c01e['summary'],'deliverables':_0x28c01e[_0x447733(0x1eb)],'questions':_0x28c01e['questions'],'input':null},_0x310612);else{const _0x30b3af=_0x28c01e[_0x447733(0x256)]['map'](_0x3e67da=>_0x447733(0x294)+_0x3e67da)[_0x447733(0x238)]('\x0a');_0x5afad3(b(_0x28c01e)+_0x447733(0x28f)+_0x30b3af,_0x310612);}process[_0x447733(0x20f)]=0x1;}function re(_0x1e1c9f){const _0x704d8c=_0x9bc3;return _0x1e1c9f['repo']===void 0x0&&_0x1e1c9f[_0x704d8c(0x234)]===void 0x0?null:{'repoUrl':_0x1e1c9f['repo'],'baseCommit':_0x1e1c9f[_0x704d8c(0x234)]};}async function R({api:_0x36a1ca,home:_0x12bd03,objective:_0x2e1268,answers:_0x338640,parent:_0x17953f=null,source:_0x3de999=null,github:_0x2ceb33=!0x1,opts:_0x2b0dab,loadPlanner:_0x15f3d7}){const _0x3876a0=_0x9bc3;return _0x1f89a4({'api':_0x36a1ca,'home':_0x12bd03,'loadPlanner':_0x15f3d7,'objective':_0x2e1268,'answers':_0x338640,'parent':_0x17953f,'source':_0x3de999,'github':_0x2ceb33,'ask':!_0x2b0dab[_0x3876a0(0x1f7)]&&process[_0x3876a0(0x211)][_0x3876a0(0x26a)]?_0x2a6a3f:null});}function W(_0x11cb91,_0x49e163,{api:_0x852fa0,action:_0x34e973}){const _0x5b40c9=_0x9bc3;if(!_0x11cb91)throw new Error('unknown\x20request\x20key:\x20'+_0x49e163);if(_0x11cb91[_0x5b40c9(0x281)]!==_0x852fa0)throw new Error(_0x5b40c9(0x23a)+_0x11cb91[_0x5b40c9(0x1e3)]+'\x20belongs\x20to\x20'+_0x11cb91['api']+_0x5b40c9(0x2ba)+_0x11cb91[_0x5b40c9(0x281)]);if(_0x11cb91[_0x5b40c9(0x27b)]!==_0x34e973)throw new Error('request\x20key\x20'+_0x11cb91['requestKey']+_0x5b40c9(0x1e6)+_0x11cb91[_0x5b40c9(0x27b)]+_0x5b40c9(0x26c)+_0x34e973);if(!_0x11cb91['input']||typeof _0x11cb91['input']!='object'||Array[_0x5b40c9(0x22e)](_0x11cb91[_0x5b40c9(0x1ce)]))throw new Error(_0x5b40c9(0x20c)+_0x11cb91[_0x5b40c9(0x1e3)]+'\x20has\x20no\x20saved\x20input');return _0x11cb91[_0x5b40c9(0x1ce)];}function se(_0x5635ac,_0x4bd220){const _0x3bafb5=_0x9bc3;return _0x3bafb5(0x29c)+_0x5635ac['api']+'\x20--home\x20'+_0x4bd220[_0x3bafb5(0x210)]+'\x20task\x20create\x20--request-key\x20'+_0x5635ac['requestKey'];}function ae(_0x246cbf,_0x4c9894){const _0x5e518a=_0x9bc3;return _0x5e518a(0x29c)+_0x246cbf[_0x5e518a(0x281)]+_0x5e518a(0x25c)+_0x4c9894[_0x5e518a(0x210)]+_0x5e518a(0x280)+_0x246cbf[_0x5e518a(0x1ce)][_0x5e518a(0x2b1)]+_0x5e518a(0x293)+_0x246cbf[_0x5e518a(0x1e3)];}function we(_0x3db825,{loadPlanner:_0x3ffaa9=_0x4d9a9e}={}){const _0x44034a=_0x9bc3,_0x1cc173=_0x3db825[_0x44034a(0x282)](_0x44034a(0x27f))[_0x44034a(0x23d)](_0x44034a(0x1e2));_0x59d651(_0x1cc173),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x209))[_0x44034a(0x23d)](_0x44034a(0x1fc))['option']('--q\x20<text>',_0x44034a(0x2b6))[_0x44034a(0x1c2)](_0x44034a(0x1e4),'creation-time\x20cursor\x20(exclusive)')['option'](_0x44034a(0x1fa),_0x44034a(0x278))['option'](_0x44034a(0x1cd),_0x44034a(0x267))[_0x44034a(0x1c2)](_0x44034a(0x1d0),_0x44034a(0x284))[_0x44034a(0x27b)](async(_0x513872,_0x55d61)=>{const _0x467edc=_0x44034a,_0x71d0fe=_0x55d61[_0x467edc(0x1e9)](),_0x25de7e=await _0x25f307(_0x71d0fe[_0x467edc(0x281)],V(_0x71d0fe));_0x5afad3(_0x71d0fe['json']?_0x25de7e['data']:X(_0x25de7e['data']),_0x71d0fe);}),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x1f2))[_0x44034a(0x23d)](_0x44034a(0x207))[_0x44034a(0x27b)](async(_0x3ad70e,_0x40604a,_0xf4bffb)=>{const _0x91f868=_0x44034a,_0xa71891=_0xf4bffb['optsWithGlobals'](),_0x5f2d67=await _0x25f307(_0xa71891[_0x91f868(0x281)],_0x91f868(0x249)+encodeURIComponent(_0x3ad70e));_0x5afad3(_0xa71891['json']?_0x5f2d67[_0x91f868(0x235)]:Z(_0x5f2d67['data']),_0xa71891);}),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x260))[_0x44034a(0x23d)](_0x44034a(0x248))['action'](async(_0xcbd006,_0x4c5e32,_0x7fb975)=>{const _0x57e1fd=_0x44034a,_0x2a8c17=_0x7fb975['optsWithGlobals'](),_0x47dab5=await _0x25f307(_0x2a8c17['api'],'/jobs/'+encodeURIComponent(_0xcbd006)+_0x57e1fd(0x264));_0x5afad3(_0x2a8c17[_0x57e1fd(0x1f7)]?_0x47dab5[_0x57e1fd(0x235)]:S(_0x47dab5['data']),_0x2a8c17);}),_0x1cc173[_0x44034a(0x282)](_0x44034a(0x230))['description'](_0x44034a(0x28c))[_0x44034a(0x1c2)](_0x44034a(0x2b7),_0x44034a(0x250),String(_0x531daf))[_0x44034a(0x1c2)]('--timeout\x20<seconds>','total\x20timeout\x20in\x20seconds',String(_0x293eeb))[_0x44034a(0x27b)](async(_0x1da800,_0x1a5ac2,_0x2edc07)=>{const _0x625d34=_0x44034a,_0x282296=_0x2edc07[_0x625d34(0x1e9)](),_0x589094=await _0xc012f9({'api':_0x282296[_0x625d34(0x281)],'id':_0x1da800,'interval':_0x282296[_0x625d34(0x298)],'timeout':_0x282296['timeout'],'onProgress':_0x4b3a57=>{const _0x4955f4=_0x625d34;_0x4b3a57['type']===_0x4955f4(0x28a)?_0x21ccbf(_0x4955f4(0x271)+_0x4b3a57[_0x4955f4(0x29b)]+'\x20complete='+_0x4b3a57[_0x4955f4(0x247)]+_0x4955f4(0x232)+_0x4b3a57[_0x4955f4(0x21e)]+',\x20'+(_0x4b3a57[_0x4955f4(0x236)]/0x3e8)[_0x4955f4(0x1c9)](0x1)+_0x4955f4(0x288)):_0x4b3a57[_0x4955f4(0x2a8)]===_0x4955f4(0x1c3)&&_0x21ccbf(_0x4955f4(0x271)+(_0x4b3a57[_0x4955f4(0x24c)]?'HTTP\x20'+_0x4b3a57[_0x4955f4(0x24c)]:_0x4955f4(0x23c))+_0x4955f4(0x274)+(_0x4b3a57[_0x4955f4(0x287)]/0x3e8)['toFixed'](0x1)+_0x4955f4(0x1da)+_0x4b3a57[_0x4955f4(0x25f)]+')\x0a');}});if(_0x589094[_0x625d34(0x258)]===_0x625d34(0x22f)){_0x21ccbf(_0x625d34(0x29a)),process[_0x625d34(0x20f)]=0x82;return;}_0x589094[_0x625d34(0x1f9)]&&_0x5afad3(_0x282296[_0x625d34(0x1f7)]?_0x589094['result']:S(_0x589094[_0x625d34(0x1f9)]),_0x282296),_0x589094['outcome']!==_0x625d34(0x251)&&(_0x21ccbf(_0x625d34(0x271)+_0x589094[_0x625d34(0x2ad)]+'\x0a'),process[_0x625d34(0x20f)]=0x1);}),_0x1cc173[_0x44034a(0x282)]('download\x20<id>')[_0x44034a(0x23d)](_0x44034a(0x26e))['requiredOption'](_0x44034a(0x216),_0x44034a(0x29d))[_0x44034a(0x27b)](async(_0x5e6ff9,_0x29b04a,_0xddbeb6)=>{const _0x4cc94d=_0x44034a,_0x4dffc6=_0xddbeb6[_0x4cc94d(0x1e9)](),_0x44ef9c=await _0x500ece({'api':_0x4dffc6[_0x4cc94d(0x281)],'id':_0x5e6ff9,'out':_0x4dffc6['out'],'onProgress':_0x2359f9=>{const _0x31d9d0=_0x4cc94d;_0x2359f9['type']===_0x31d9d0(0x291)&&_0x21ccbf(_0x31d9d0(0x23f)+_0x2359f9['path']+_0x31d9d0(0x221)+_0x2359f9['file']+'\x0a');}});_0x5afad3(_0x4dffc6[_0x4cc94d(0x1f7)]?_0x44ef9c:ee(_0x44ef9c),_0x4dffc6);}),_0x1cc173['command'](_0x44034a(0x28e))[_0x44034a(0x23d)](_0x44034a(0x1fd))['requiredOption'](_0x44034a(0x1f8),_0x44034a(0x2b2))[_0x44034a(0x1c2)](_0x44034a(0x220),_0x44034a(0x218))[_0x44034a(0x27b)](async(_0x3cc2f5,_0x14bbe4)=>{const _0xded98e=_0x44034a,_0x3d9c44=_0x14bbe4[_0xded98e(0x1e9)](),_0x47a179=await _0xf06f7d(_0x3d9c44[_0xded98e(0x203)]),_0x2400af=_0x3d9c44[_0xded98e(0x27b)]??_0x35cbad(_0x47a179),_0x827386=await _0x51329e(_0x3d9c44['api'],_0x47a179,_0x2400af);_0x5afad3(_0x3d9c44['json']?_0x827386:x(_0x827386),_0x3d9c44);}),_0x1cc173['command'](_0x44034a(0x25a))[_0x44034a(0x23d)](_0x44034a(0x21f))[_0x44034a(0x208)]('--file\x20<path>',_0x44034a(0x2b2))[_0x44034a(0x1c2)](_0x44034a(0x286),_0x44034a(0x1dc))['action'](async(_0x494402,_0x2ff54a)=>{const _0x2455f8=_0x44034a,_0x35c40e=_0x2ff54a[_0x2455f8(0x1e9)]();_0x35c40e[_0x2455f8(0x1e3)]||await _0x1e393c({..._0x35c40e,'action':_0x2455f8(0x257)});const _0x486a33=await _0xe17452({'api':_0x35c40e[_0x2455f8(0x281)],'home':_0x35c40e['home'],'file':_0x35c40e['file'],'action':_0x2455f8(0x257),'requestKey':_0x35c40e[_0x2455f8(0x1e3)],'yes':_0x35c40e[_0x2455f8(0x23e)],'keyEnv':_0x35c40e['keyEnv'],'rpc':_0x35c40e[_0x2455f8(0x213)],'paymentChain':_0x35c40e['paymentChain'],'payWith':_0x35c40e[_0x2455f8(0x1f6)],'onProgress':_0x47f5e4(_0x35c40e)});C(_0x486a33,_0x35c40e);}),_0x1cc173['command'](_0x44034a(0x212))[_0x44034a(0x23d)](_0x44034a(0x2bc))[_0x44034a(0x1c2)](_0x44034a(0x1f8),_0x44034a(0x265))[_0x44034a(0x1c2)](_0x44034a(0x276),_0x44034a(0x224))[_0x44034a(0x1c2)]('--skill\x20<id>',_0x44034a(0x1cc))['option']('--template\x20<name>',_0x44034a(0x240))['option']('--path\x20<path>',_0x44034a(0x28d),(_0x2430bb,_0x412dc2)=>[..._0x412dc2,_0x2430bb],[])['option'](_0x44034a(0x295),'public\x20GitHub\x20repository\x20URL')['option'](_0x44034a(0x1d3),_0x44034a(0x22c))[_0x44034a(0x1c2)](_0x44034a(0x1d1),'publish\x20the\x20result\x20to\x20GitHub')[_0x44034a(0x1c2)](_0x44034a(0x27c),'answer\x20a\x20business\x20clarification\x20(repeatable)',(_0x8f6c43,_0x43aacc)=>[..._0x43aacc,_0x8f6c43],[])[_0x44034a(0x1c2)](_0x44034a(0x2a1),_0x44034a(0x1d7))[_0x44034a(0x1c2)](_0x44034a(0x29f),_0x44034a(0x27a))['option'](_0x44034a(0x286),_0x44034a(0x1dc))[_0x44034a(0x27b)](async(_0x6a7a1,_0x85e042,_0x4fa8fe)=>{const _0x3cb6e6=_0x44034a,_0x2fff6c=_0x4fa8fe[_0x3cb6e6(0x1e9)]();!_0x2fff6c[_0x3cb6e6(0x285)]&&!_0x2fff6c[_0x3cb6e6(0x1e3)]&&await _0x1e393c({..._0x2fff6c,'action':_0x3cb6e6(0x257)});const _0x491593=oe(_0x6a7a1,_0x2fff6c);let _0x599a7a,_0x5956f8=null;if(_0x2fff6c[_0x3cb6e6(0x1e3)]&&!J(_0x2fff6c)&&(_0x6a7a1===void 0x0||_0x491593)){const _0x1a03ed=await _0x5e9534(_0x2fff6c[_0x3cb6e6(0x210)],_0x2fff6c[_0x3cb6e6(0x1e3)]);if(_0x599a7a=W(_0x1a03ed,_0x2fff6c[_0x3cb6e6(0x1e3)],{'api':_0x2fff6c[_0x3cb6e6(0x281)],'action':_0x3cb6e6(0x257)}),_0x6a7a1!==void 0x0&&_0x6a7a1!==_0x599a7a[_0x3cb6e6(0x26d)])throw new Error(_0x3cb6e6(0x20c)+_0x2fff6c[_0x3cb6e6(0x1e3)]+_0x3cb6e6(0x2a6));}else{if(_0x491593){if(_0x5956f8=await R({'api':_0x2fff6c[_0x3cb6e6(0x281)],'home':_0x2fff6c[_0x3cb6e6(0x210)],'objective':_0x6a7a1,'answers':_0x2fff6c[_0x3cb6e6(0x22d)],'source':re(_0x2fff6c),'github':_0x2fff6c[_0x3cb6e6(0x1d5)]===!0x0,'opts':_0x2fff6c,'loadPlanner':_0x3ffaa9}),_0x5956f8[_0x3cb6e6(0x1ce)]===null){N(_0x5956f8,_0x3cb6e6(0x257),_0x2fff6c);return;}_0x599a7a=_0x5956f8[_0x3cb6e6(0x1ce)];}else{const _0x4228d5=_0x2fff6c[_0x3cb6e6(0x203)]?await _0xf06f7d(_0x2fff6c[_0x3cb6e6(0x203)]):void 0x0;_0x599a7a=await _0x191f76({'fileInput':_0x4228d5,'objective':_0x6a7a1,'preset':_0x2fff6c[_0x3cb6e6(0x2b8)],'skill':_0x2fff6c['skill'],'template':_0x2fff6c[_0x3cb6e6(0x242)],'paths':_0x2fff6c[_0x3cb6e6(0x1fb)],'repo':_0x2fff6c[_0x3cb6e6(0x1f0)],'commit':_0x2fff6c[_0x3cb6e6(0x234)],'github':_0x2fff6c[_0x3cb6e6(0x1d5)]});}}if(_0x2fff6c['save']&&(await _0x17d4ce(_0x2fff6c[_0x3cb6e6(0x226)],_0x599a7a),_0x2fff6c[_0x3cb6e6(0x1f7)]||_0x21ccbf(_0x3cb6e6(0x1ca)+_0x2fff6c[_0x3cb6e6(0x226)]+'\x0a')),_0x2fff6c[_0x3cb6e6(0x285)]){const _0xb7f4e4=await _0x51329e(_0x2fff6c['api'],_0x599a7a,_0x3cb6e6(0x257));_0x2fff6c[_0x3cb6e6(0x1f7)]?_0x5afad3({'action':_0x3cb6e6(0x257),..._0x5956f8?{'summary':_0x5956f8['summary'],'deliverables':_0x5956f8[_0x3cb6e6(0x1eb)]}:{},'input':_0x599a7a,'check':_0xb7f4e4},_0x2fff6c):_0x5afad3(_0x5956f8?U(_0x5956f8,_0xb7f4e4):K(_0x3cb6e6(0x257),_0x599a7a,_0xb7f4e4),_0x2fff6c),_0xb7f4e4[_0x3cb6e6(0x268)][_0x3cb6e6(0x1c1)]>0x0&&(process['exitCode']=0x1);return;}_0x5956f8&&!_0x2fff6c[_0x3cb6e6(0x1f7)]&&_0x21ccbf(b(_0x5956f8)+'\x0a');const _0x2b8695=await _0xe17452({'api':_0x2fff6c[_0x3cb6e6(0x281)],'home':_0x2fff6c[_0x3cb6e6(0x210)],'input':_0x599a7a,'action':_0x3cb6e6(0x257),'requestKey':_0x2fff6c['requestKey'],'plan':_0x5956f8?{'summary':_0x5956f8[_0x3cb6e6(0x22a)],'deliverables':_0x5956f8[_0x3cb6e6(0x1eb)]}:void 0x0,'yes':_0x2fff6c[_0x3cb6e6(0x23e)],'keyEnv':_0x2fff6c['keyEnv'],'rpc':_0x2fff6c[_0x3cb6e6(0x213)],'paymentChain':_0x2fff6c[_0x3cb6e6(0x21d)],'payWith':_0x2fff6c[_0x3cb6e6(0x1f6)],'onProgress':_0x47f5e4(_0x2fff6c),'retryCommand':_0x2b6cda=>se(_0x2b6cda,_0x2fff6c)});C(_0x2b8695,_0x2fff6c);}),_0x1cc173[_0x44034a(0x282)]('continue\x20<id>\x20[objective]')['description']('continue\x20the\x20project\x20of\x20a\x20job\x20you\x20paid\x20for')[_0x44034a(0x1c2)](_0x44034a(0x1f8),_0x44034a(0x263))[_0x44034a(0x1c2)]('--skill\x20<id>',_0x44034a(0x1cc))[_0x44034a(0x1c2)](_0x44034a(0x275),_0x44034a(0x240))['option'](_0x44034a(0x1ec),_0x44034a(0x28d),(_0x36ee6f,_0xca6cd8)=>[..._0xca6cd8,_0x36ee6f],[])[_0x44034a(0x1c2)](_0x44034a(0x27c),'answer\x20a\x20business\x20clarification\x20(repeatable)',(_0x1217a3,_0x12524f)=>[..._0x12524f,_0x1217a3],[])[_0x44034a(0x1c2)]('--dry-run',_0x44034a(0x1d7))['option'](_0x44034a(0x29f),_0x44034a(0x27a))[_0x44034a(0x1c2)](_0x44034a(0x286),_0x44034a(0x1dc))[_0x44034a(0x27b)](async(_0x28de72,_0x5b923b,_0x5ec3f6,_0x4f9a83)=>{const _0x3811d0=_0x44034a,_0x3ef1db=_0x4f9a83[_0x3811d0(0x1e9)]();!_0x3ef1db[_0x3811d0(0x285)]&&!_0x3ef1db[_0x3811d0(0x1e3)]&&await _0x1e393c({..._0x3ef1db,'action':_0x3811d0(0x2b5)});const _0x816a2e=ie(_0x5b923b,_0x3ef1db);let _0x2e2648,_0x5f29a2,_0x2ec3a9=null;if(_0x3ef1db['requestKey']&&!O(_0x3ef1db)&&(_0x5b923b===void 0x0||_0x816a2e)){const _0x21e942=await _0x5e9534(_0x3ef1db['home'],_0x3ef1db[_0x3811d0(0x1e3)]);if(_0x2e2648=W(_0x21e942,_0x3ef1db[_0x3811d0(0x1e3)],{'api':_0x3ef1db[_0x3811d0(0x281)],'action':'job.continue'}),_0x2e2648['parentJobId']!==_0x28de72)throw new Error(_0x3811d0(0x20c)+_0x3ef1db['requestKey']+_0x3811d0(0x253)+(_0x2e2648[_0x3811d0(0x2b1)]??'<none>')+_0x3811d0(0x26c)+_0x28de72);if(_0x5b923b!==void 0x0&&_0x5b923b!==_0x2e2648['objective'])throw new Error(_0x3811d0(0x20c)+_0x3ef1db[_0x3811d0(0x1e3)]+'\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it');_0x5f29a2=(await _0x25f307(_0x3ef1db[_0x3811d0(0x281)],'/jobs/'+encodeURIComponent(_0x28de72)))['data'];}else{if(_0x816a2e){if(_0x5f29a2=(await _0x25f307(_0x3ef1db[_0x3811d0(0x281)],_0x3811d0(0x249)+encodeURIComponent(_0x28de72)))[_0x3811d0(0x235)],_0x2ec3a9=await R({'api':_0x3ef1db[_0x3811d0(0x281)],'home':_0x3ef1db[_0x3811d0(0x210)],'objective':_0x5b923b,'answers':_0x3ef1db[_0x3811d0(0x22d)],'parent':_0x5f29a2,'opts':_0x3ef1db,'loadPlanner':_0x3ffaa9}),_0x2ec3a9['input']===null){N(_0x2ec3a9,_0x3811d0(0x2b5),_0x3ef1db);return;}_0x2e2648=_0x2ec3a9['input'],_0x2e2648['parentJobId']!==_0x28de72&&(_0x2e2648={..._0x2e2648,'parentJobId':_0x28de72});}else{const _0x40d9c8=_0x3ef1db[_0x3811d0(0x203)]?await _0xf06f7d(_0x3ef1db[_0x3811d0(0x203)]):void 0x0;_0x2e2648=await _0x5bd41a({'id':_0x28de72,'fileInput':_0x40d9c8,'objective':_0x5b923b,'skill':_0x3ef1db[_0x3811d0(0x1d6)],'template':_0x3ef1db['template'],'paths':_0x3ef1db[_0x3811d0(0x1fb)]}),_0x5f29a2=(await _0x25f307(_0x3ef1db['api'],'/jobs/'+encodeURIComponent(_0x28de72)))['data'];}}if(_0x3ef1db[_0x3811d0(0x226)]&&(await _0x17d4ce(_0x3ef1db[_0x3811d0(0x226)],_0x2e2648),_0x3ef1db[_0x3811d0(0x1f7)]||_0x21ccbf(_0x3811d0(0x1ca)+_0x3ef1db[_0x3811d0(0x226)]+'\x0a')),_0x3ef1db[_0x3811d0(0x285)]){const _0x113c9f=await _0x51329e(_0x3ef1db[_0x3811d0(0x281)],_0x2e2648,'job.continue');_0x3ef1db[_0x3811d0(0x1f7)]?_0x5afad3({'action':_0x3811d0(0x2b5),..._0x2ec3a9?{'summary':_0x2ec3a9[_0x3811d0(0x22a)],'deliverables':_0x2ec3a9['deliverables']}:{},'parent':_0x180a5a(_0x5f29a2),'input':_0x2e2648,'check':_0x113c9f},_0x3ef1db):_0x5afad3(_0x2ec3a9?U(_0x2ec3a9,_0x113c9f):K(_0x3811d0(0x2b5),_0x2e2648,_0x113c9f,_0x5f29a2),_0x3ef1db),_0x113c9f[_0x3811d0(0x268)][_0x3811d0(0x1c1)]>0x0&&(process[_0x3811d0(0x20f)]=0x1);return;}_0x2ec3a9&&!_0x3ef1db[_0x3811d0(0x1f7)]&&_0x21ccbf(b(_0x2ec3a9)+'\x0a');const _0x232126=await _0xe17452({'api':_0x3ef1db[_0x3811d0(0x281)],'home':_0x3ef1db[_0x3811d0(0x210)],'input':_0x2e2648,'action':_0x3811d0(0x2b5),'requestKey':_0x3ef1db[_0x3811d0(0x1e3)],'plan':_0x2ec3a9?{'summary':_0x2ec3a9[_0x3811d0(0x22a)],'deliverables':_0x2ec3a9['deliverables']}:void 0x0,'yes':_0x3ef1db['yes'],'keyEnv':_0x3ef1db[_0x3811d0(0x26b)],'rpc':_0x3ef1db[_0x3811d0(0x213)],'paymentChain':_0x3ef1db['paymentChain'],'payWith':_0x3ef1db['payWith'],'onProgress':_0x47f5e4(_0x3ef1db),'retryCommand':_0x5b7eb1=>ae(_0x5b7eb1,_0x3ef1db)});_0x232126['state']&&(_0x232126[_0x3811d0(0x29b)][_0x3811d0(0x2aa)]=_0x180a5a(_0x5f29a2)),C(_0x232126,_0x3ef1db);});}export{we as registerTaskCommands};
|
|
1
|
+
import{writeDiagnostic as _0x253e14}from'../lib/terminal-text.mjs';import{paymentProgressReporter as _0x2aaf95}from'../lib/payment-progress.mjs';import{request as _0x6e1b30,print as _0x40216c}from'../shared.mjs';import{checkJob as _0x347c7b,publishJob as _0x3706aa,readJobFile as _0x41f5a5}from'../lib/publish.mjs';import{loadOrder as _0x96fca9,orderActions as _0x58da2f}from'../lib/orders.mjs';import{buildContinueInput as _0x274855,buildCreateInput as _0x5d1a0d,parentSummary as _0x3bbc3b,resolveAction as _0x53f80f,saveInputFile as _0x2e7447}from'../lib/task-input.mjs';import{DEFAULT_INTERVAL_SECONDS as _0x4e7f2d,DEFAULT_TIMEOUT_SECONDS as _0x2f6fa0,downloadTaskFiles as _0x59c773,waitForResult as _0x36a815}from'../lib/task-result.mjs';import{askQuestions as _0x5da7a4,loadLocalPlanner as _0x43d523,planTask as _0x1ddb5f}from'../planner/flow.mjs';import{registerMyTaskCommands as _0x287884}from'./my-tasks.mjs';import{orderPayment as _0x4e5577}from'../lib/payments.mjs';import{checkTaskWallet as _0x1a2fa6}from'../lib/task-wallet.mjs';async function x(_0x21fc22,_0x4b8caf){const _0x26d468=_0x5aee;let _0x22e01d;if(_0x21fc22[_0x26d468(0x1fe)]){const _0x4980bb=await _0x96fca9(_0x21fc22[_0x26d468(0x189)],_0x21fc22[_0x26d468(0x1fe)]);if(_0x4980bb&&!_0x58da2f(_0x4980bb)[_0x26d468(0x1f7)])return null;_0x4980bb&&(_0x22e01d={'paymentChain':_0x4980bb['paymentChain']??_0x26d468(0x247),'payWith':_0x4980bb[_0x26d468(0x262)]??_0x26d468(0x20f)});}const _0x38a4cf=await _0x1a2fa6({..._0x21fc22,'action':_0x4b8caf,'prefer':_0x22e01d});return _0x21fc22[_0x26d468(0x1f4)]||_0x253e14(_0x26d468(0x1bd)+_0x38a4cf[_0x26d468(0x262)]+'\x20on\x20'+_0x38a4cf[_0x26d468(0x179)]+_0x26d468(0x232)),_0x38a4cf;}function _0x5aee(_0x579e19,_0x4864f7){_0x579e19=_0x579e19-0x171;const _0x5aeef3=_0x4864();let _0x548a82=_0x5aeef3[_0x579e19];return _0x548a82;}function _0x4864(){const _0x4ec2e7=['paymentChain','/jobs?','none','detail',',\x20not\x20','continue\x20<id>\x20[objective]','blocked','publish','chainName','exclude\x20oracle\x20panel\x20jobs','padEnd','payment_failed','delivery','\x20\x20\x20\x20hash:\x20','--action\x20<action>','updated:\x20\x20\x20','\x20head=','github','replace','attempt','save','type','\x20verdict=','job\x20template','home','quote','<none>','task','complete\x20continuation\x20body\x20JSON\x20file','transactionHash','before','interval','input','base\x20commit\x20for\x20--repo','submissionHash','\x20belongs\x20to\x20parent\x20job\x20','code','expiresAt','job:\x20\x20\x20\x20\x20\x20\x20','\x20job(s)','trim','\x20version(s))','Network\x20error','state','orderId','--before\x20<time>','order\x20','optsWithGlobals','delayMs','source','check:\x20\x20\x20\x20\x20','reuse\x20a\x20saved\x20order\x20request\x20key','/jobs/','check,\x20quote,\x20sign\x20and\x20submit\x20a\x20job\x20file','rpc','statusUrl','explorerUrl','plan','url','retry','--answer\x20<text>','yes','saved','reviews','\x20blocker(s)','elapsedMs','complete:\x20\x20','--file\x20<path>','includes','push','blockers','wait:\x20','file','template:\x20\x20','Payment\x20needs\x20review.','exitCode','Paying\x20with\x20','nodes','poll\x20interval\x20in\x20seconds','poll\x20a\x20job\x20result\x20until\x20it\x20completes,\x20fails\x20or\x20times\x20out','repository\x20path\x20the\x20job\x20may\x20write\x20(repeatable)','delivery:\x20\x20','pendingTransaction','--request-key\x20<uuid>','job\x20response\x20is\x20missing\x20id','tx:\x20\x20\x20\x20\x20\x20\x20\x20','retries','set','kind','data','string','poll','\x0aquestions:\x0a','refusalProblems','result\x20<id>','\x0anot\x20paid:\x20blockers\x20must\x20be\x20resolved\x20first\x0a','answer\x20a\x20business\x20clarification\x20(repeatable)','--dry-run','verdict','--interval\x20<seconds>','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20500','short','admitted','statusUrl:\x20','map','files:\x20\x20\x20\x20\x20','state:\x20\x20\x20\x20\x20','stdin','--skill\x20<id>','refused','createdAt','launch','workflow','path','isArray','page\x20size\x20(1-500)','job.open','colony\x20--api\x20','action','\x20(poll\x20','objective','requiredOption','\x20has\x20no\x20saved\x20input','key','browse\x20and\x20publish\x20IMD\x20tasks','--out\x20<dir>','paymentStatus','length','challenge','source:\x20\x20\x20\x20','download\x20<id>','json','completed','named\x20input\x20preset\x20(report)','canCancel','\x20was\x20admitted,\x20but\x20IMD\x20refused\x20the\x20job.','check','message','\x20complete=','transaction:\x20','mediaType','requestKey','/result','parentJobId','show\x20one\x20job','\x20versions=','--template\x20<name>','publish\x20the\x20result\x20to\x20GitHub','interrupted','versions','\x20\x20-\x20','/jobs','resultUrl','request\x20key\x20','s\x20(retry\x20','wait:\x20interrupted\x0a','--limit\x20<n>','join','IMD','\x20bytes)','list','runnable\x20skill\x20id','launch:\x20\x20\x20\x20','project\x20ready','result','isTTY','oracle','--save\x20<path>','deliverables','\x20belongs\x20to\x20','\x20->\x20','\x20tx\x20','prepared\x20input:','parent:\x20\x20\x20\x20','dryRun','commit','stringify','limit','job.continue','create\x20[objective]','exclude','asset','result\x20response\x20is\x20missing\x20jobId','summary','continue\x20the\x20project\x20of\x20a\x20job\x20you\x20paid\x20for','HTTP\x20','complete\x20job\x20body\x20JSON\x20file','slice','toFixed','paidBy','payment:\x20','list\x20jobs','saved\x20input:\x20','\x20(enough\x20balance\x20found).\x0a','command','\x20--home\x20','show\x20<id>','objective:\x20','jobs\x20response\x20is\x20missing\x20jobs','--repo\x20<url>','outcome','files','repo','template','complete','action\x20to\x20check\x20(defaults\x20from\x20parentJobId)','reason','since','bytes','order:\x20\x20\x20\x20\x20',';\x20inspect\x20it\x20with\x20colony\x20order\x20show\x20','option','keyEnv','title','ethereum','plan:\x20','status','project','timeout','unknown','answer','api','unknown\x20request\x20key:\x20',';\x20rerun\x20with\x20--api\x20','--timeout\x20<seconds>','\x20--refresh','job\x20body\x20JSON\x20file','description','--preset\x20<name>','input:','order\x20ended\x20with\x20status:\x20','action:\x20\x20\x20\x20','preset','hash','public\x20GitHub\x20repository\x20URL','excludeOracle','skill','project:\x20\x20\x20','nodes:\x20\x20\x20\x20\x20','--path\x20<path>','jobs','payWith','only\x20run\x20the\x20free\x20check\x20and\x20print\x20the\x20input','payTo','download\x20a\x20completed\x20job\x27s\x20files\x20under\x20--out','questions','\x20attempt=','created:\x20\x20\x20','updatedAt','--github','payment_reconciling','transaction','save\x20the\x20input\x20JSON\x20without\x20overwriting','out','toString','jobId','--commit\x20<sha>','parent','head'];_0x4864=function(){return _0x4ec2e7;};return _0x4864();}function ee(_0x4439e9){const _0x54318b=_0x5aee,_0x42b841=new URLSearchParams();if(_0x4439e9['q']!==void 0x0&&_0x42b841['set']('q',_0x4439e9['q']),_0x4439e9['before']!==void 0x0&&_0x42b841[_0x54318b(0x1c8)](_0x54318b(0x18f),_0x4439e9[_0x54318b(0x18f)]),_0x4439e9[_0x54318b(0x240)]!==void 0x0&&_0x42b841[_0x54318b(0x1c8)](_0x54318b(0x240),_0x4439e9['since']),_0x4439e9[_0x54318b(0x222)]!==void 0x0){const _0x1d2df3=Number(_0x4439e9['limit']);if(!Number['isInteger'](_0x1d2df3)||_0x1d2df3<0x1||_0x1d2df3>0x1f4)throw new Error(_0x54318b(0x1d5));_0x42b841[_0x54318b(0x1c8)](_0x54318b(0x222),String(_0x1d2df3));}_0x4439e9[_0x54318b(0x25c)]&&_0x42b841[_0x54318b(0x1c8)](_0x54318b(0x225),_0x54318b(0x217));const _0x164e13=_0x42b841[_0x54318b(0x26f)]();return _0x164e13?_0x54318b(0x172)+_0x164e13:_0x54318b(0x208);}function b(_0x76b1ba,_0x28df34=0x5a){const _0x5737c2=_0x5aee,_0x818f2a=String(_0x76b1ba??'')[_0x5737c2(0x183)](/\s+/g,'\x20')[_0x5737c2(0x199)]();return _0x818f2a[_0x5737c2(0x1f0)]>_0x28df34?_0x818f2a[_0x5737c2(0x22c)](0x0,_0x28df34-0x1)+'…':_0x818f2a;}function te(_0x3a13c4){const _0x3af718=_0x5aee;if(!Array[_0x3af718(0x1e3)](_0x3a13c4?.[_0x3af718(0x261)]))throw new Error(_0x3af718(0x237));const _0x2b9585=[_0x3a13c4['count']+_0x3af718(0x198)];for(const _0x6cf962 of _0x3a13c4[_0x3af718(0x261)])_0x2b9585[_0x3af718(0x1b6)](_0x6cf962['id']+'\x20\x20'+_0x6cf962[_0x3af718(0x19c)][_0x3af718(0x17b)](0xa)+'\x20\x20'+String(_0x6cf962['template']??'')[_0x3af718(0x17b)](0x16)+'\x20\x20'+(_0x6cf962[_0x3af718(0x269)]??'')+'\x20\x20'+b(_0x6cf962[_0x3af718(0x1e9)]));return _0x2b9585[_0x3af718(0x20e)]('\x0a');}function ne(_0x4f13ff){const _0x1d42b5=_0x5aee;if(!_0x4f13ff?.['id'])throw new Error(_0x1d42b5(0x1c5));const _0x3d8391=[_0x1d42b5(0x197)+_0x4f13ff['id'],'state:\x20\x20\x20\x20\x20'+_0x4f13ff['state'],_0x1d42b5(0x1ba)+(_0x4f13ff[_0x1d42b5(0x23c)]??''),_0x1d42b5(0x236)+b(_0x4f13ff[_0x1d42b5(0x1e9)],0x1f4),_0x1d42b5(0x268)+(_0x4f13ff[_0x1d42b5(0x1df)]??''),_0x1d42b5(0x180)+(_0x4f13ff['updatedAt']??''),'paid\x20by:\x20\x20\x20'+(_0x4f13ff[_0x1d42b5(0x22e)]??''),'project:\x20\x20\x20'+(_0x4f13ff[_0x1d42b5(0x24a)]?_0x4f13ff[_0x1d42b5(0x24a)]['id']+'\x20('+(_0x4f13ff[_0x1d42b5(0x24a)][_0x1d42b5(0x206)]?.['length']??0x0)+_0x1d42b5(0x19a):_0x1d42b5(0x173)),_0x1d42b5(0x1c2)+(_0x4f13ff['delivery']?JSON[_0x1d42b5(0x221)](_0x4f13ff[_0x1d42b5(0x17d)]):_0x1d42b5(0x173)),_0x1d42b5(0x213)+(_0x4f13ff[_0x1d42b5(0x1e0)]?JSON['stringify'](_0x4f13ff[_0x1d42b5(0x1e0)]):_0x1d42b5(0x173))];if(Array[_0x1d42b5(0x1e3)](_0x4f13ff[_0x1d42b5(0x1be)])){_0x3d8391[_0x1d42b5(0x1b6)](_0x1d42b5(0x25f)+_0x4f13ff[_0x1d42b5(0x1be)]['length']);for(const _0x105038 of _0x4f13ff[_0x1d42b5(0x1be)])_0x3d8391[_0x1d42b5(0x1b6)]('\x20\x20-\x20'+_0x105038[_0x1d42b5(0x1ec)]+':\x20'+_0x105038[_0x1d42b5(0x19c)]+_0x1d42b5(0x267)+_0x105038[_0x1d42b5(0x184)]+_0x1d42b5(0x187)+(_0x105038[_0x1d42b5(0x1d3)]?.[_0x1d42b5(0x249)]??_0x1d42b5(0x173)));}return Array[_0x1d42b5(0x1e3)](_0x4f13ff[_0x1d42b5(0x1b0)])&&_0x3d8391[_0x1d42b5(0x1b6)]('reviews:\x20\x20\x20'+_0x4f13ff[_0x1d42b5(0x1b0)][_0x1d42b5(0x1f0)]),_0x4f13ff[_0x1d42b5(0x1e1)]?.['id']&&_0x3d8391[_0x1d42b5(0x1b6)](('workflow:\x20\x20'+_0x4f13ff[_0x1d42b5(0x1e1)]['id']+'\x20'+(_0x4f13ff[_0x1d42b5(0x1e1)]['status']??''))[_0x1d42b5(0x199)]()),_0x3d8391['join']('\x0a');}function S(_0x6a9b30){const _0x37af4a=_0x5aee;if(!_0x6a9b30?.[_0x37af4a(0x270)])throw new Error(_0x37af4a(0x227));const _0x169312=['job:\x20\x20\x20\x20\x20\x20\x20'+_0x6a9b30[_0x37af4a(0x270)],_0x37af4a(0x1db)+_0x6a9b30['state'],_0x37af4a(0x1b3)+_0x6a9b30['complete']],_0x8bd074=Array['isArray'](_0x6a9b30[_0x37af4a(0x23a)])?_0x6a9b30[_0x37af4a(0x23a)]:[];_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x1da)+_0x8bd074[_0x37af4a(0x1f0)]);for(const _0x5e5521 of _0x8bd074)_0x169312[_0x37af4a(0x1b6)]('\x20\x20-\x20'+_0x5e5521['path']+'\x20('+_0x5e5521[_0x37af4a(0x241)]+'\x20bytes,\x20'+_0x5e5521[_0x37af4a(0x1fd)]+')'),_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x17e)+_0x5e5521['hash']),_0x169312[_0x37af4a(0x1b6)]('\x20\x20\x20\x20url:\x20\x20'+_0x5e5521[_0x37af4a(0x1ab)]);const _0xf01a86=Array[_0x37af4a(0x1e3)](_0x6a9b30['source'])?_0x6a9b30[_0x37af4a(0x1a2)]:[];_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x1f2)+_0xf01a86['length']);for(const _0x53b436 of _0xf01a86)_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x207)+(_0x53b436['node']??_0x53b436[_0x37af4a(0x193)])+':\x20'+_0x53b436[_0x37af4a(0x1ab)]);return _0x6a9b30[_0x37af4a(0x17d)]&&_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x1c2)+JSON[_0x37af4a(0x221)](_0x6a9b30[_0x37af4a(0x17d)])),_0x6a9b30['launch']&&_0x169312[_0x37af4a(0x1b6)](_0x37af4a(0x213)+JSON[_0x37af4a(0x221)](_0x6a9b30[_0x37af4a(0x1e0)])),_0x169312[_0x37af4a(0x20e)]('\x0a');}function oe(_0xcf6f58){const _0x3495fb=_0x5aee,_0x174584=[_0x3495fb(0x197)+_0xcf6f58[_0x3495fb(0x270)],'state:\x20\x20\x20\x20\x20'+_0xcf6f58[_0x3495fb(0x19c)],_0x3495fb(0x1da)+_0xcf6f58[_0x3495fb(0x23a)][_0x3495fb(0x1f0)]];for(const _0x806c4b of _0xcf6f58[_0x3495fb(0x23a)])_0x174584[_0x3495fb(0x1b6)](_0x3495fb(0x207)+_0x806c4b[_0x3495fb(0x1e2)]+_0x3495fb(0x21b)+_0x806c4b[_0x3495fb(0x1b9)]+'\x20('+_0x806c4b[_0x3495fb(0x241)]+_0x3495fb(0x210)),_0x174584[_0x3495fb(0x1b6)](_0x3495fb(0x17e)+_0x806c4b[_0x3495fb(0x25a)]);return _0x174584['join']('\x0a');}function I(_0x4a292a){const _0x3f4cd6=_0x5aee,_0x1c00c5=['blockers:\x20'+_0x4a292a[_0x3f4cd6(0x1b7)]['length']];for(const _0x9eab4d of _0x4a292a[_0x3f4cd6(0x1b7)])_0x1c00c5[_0x3f4cd6(0x1b6)]('\x20\x20-\x20'+_0x9eab4d[_0x3f4cd6(0x195)]+':\x20'+_0x9eab4d['detail']);const _0x4cc5c5=Array['isArray'](_0x4a292a[_0x3f4cd6(0x1aa)])?_0x4a292a[_0x3f4cd6(0x1aa)]:[];_0x1c00c5['push'](_0x3f4cd6(0x248)+_0x4cc5c5[_0x3f4cd6(0x1f0)]);for(const _0x2b93ba of _0x4cc5c5)_0x1c00c5['push']('\x20\x20-\x20'+(_0x2b93ba[_0x3f4cd6(0x246)]??_0x2b93ba[_0x3f4cd6(0x1d6)]??_0x2b93ba[_0x3f4cd6(0x25d)])+(_0x2b93ba[_0x3f4cd6(0x25d)]?'\x20('+_0x2b93ba[_0x3f4cd6(0x25d)]+')':''));return _0x1c00c5[_0x3f4cd6(0x20e)]('\x0a');}function T(_0x3c9d23){const _0x51d6eb=_0x5aee,_0x3de66a=_0x3c9d23[_0x51d6eb(0x18a)]?_0x4e5577(_0x3c9d23):null;return{'status':_0x3c9d23[_0x51d6eb(0x249)],'action':_0x3c9d23[_0x51d6eb(0x1e7)],'requestKey':_0x3c9d23['requestKey'],'orderId':_0x3c9d23['orderId'],'jobId':_0x3c9d23['jobId']??null,'statusUrl':_0x3c9d23[_0x51d6eb(0x1a8)]??null,'resultUrl':_0x3c9d23[_0x51d6eb(0x209)]??null,'transactionHash':_0x3c9d23['transactionHash']??null,'problems':_0x3c9d23[_0x51d6eb(0x1ce)]??null,'parentJobId':_0x3c9d23[_0x51d6eb(0x191)]?.['parentJobId']??null,'parent':_0x3c9d23['parent']??null,'project':_0x3c9d23[_0x51d6eb(0x1f9)]?.['project']??null,'payer':_0x3c9d23['payer']??null,'paymentChain':_0x3c9d23[_0x51d6eb(0x171)]??'ethereum','payWith':_0x3c9d23[_0x51d6eb(0x262)]??_0x51d6eb(0x20f),'prepared':_0x3c9d23[_0x51d6eb(0x1f1)]?.['input']??null,'quote':_0x3c9d23[_0x51d6eb(0x18a)]?{'amount':_0x3de66a['amount'],'asset':_0x3de66a[_0x51d6eb(0x226)],'payTo':_0x3de66a[_0x51d6eb(0x264)],'expiresAt':_0x3c9d23['quote'][_0x51d6eb(0x196)]}:null};}function ie(_0x3e6c3a){const _0x35ff0a=_0x5aee,_0x2e4549=['status:\x20\x20\x20\x20'+_0x3e6c3a[_0x35ff0a(0x249)],_0x35ff0a(0x258)+_0x3e6c3a['action'],_0x35ff0a(0x242)+_0x3e6c3a[_0x35ff0a(0x19d)],_0x35ff0a(0x197)+(_0x3e6c3a['jobId']??'')];if(_0x3e6c3a[_0x35ff0a(0x1a8)]&&_0x2e4549['push'](_0x35ff0a(0x1d8)+_0x3e6c3a[_0x35ff0a(0x1a8)]),_0x3e6c3a[_0x35ff0a(0x209)]&&_0x2e4549[_0x35ff0a(0x1b6)]('resultUrl:\x20'+_0x3e6c3a['resultUrl']),_0x3e6c3a[_0x35ff0a(0x18e)]&&_0x2e4549['push'](_0x35ff0a(0x1c6)+_0x3e6c3a['transactionHash']),_0x3e6c3a[_0x35ff0a(0x272)]&&(_0x2e4549[_0x35ff0a(0x1b6)](_0x35ff0a(0x21e)+_0x3e6c3a[_0x35ff0a(0x272)]['id']+'\x20('+(_0x3e6c3a[_0x35ff0a(0x272)][_0x35ff0a(0x19c)]??'unknown')+')'),_0x3e6c3a[_0x35ff0a(0x272)][_0x35ff0a(0x24a)]&&_0x2e4549['push'](_0x35ff0a(0x25e)+_0x3e6c3a[_0x35ff0a(0x272)]['project']['id']+_0x35ff0a(0x181)+(_0x3e6c3a[_0x35ff0a(0x272)][_0x35ff0a(0x24a)]['head']??''))),_0x3e6c3a[_0x35ff0a(0x1f9)]?.[_0x35ff0a(0x24a)]){const _0xe19e7=_0x3e6c3a[_0x35ff0a(0x1f9)][_0x35ff0a(0x24a)];_0x2e4549[_0x35ff0a(0x1b6)](_0x35ff0a(0x1a3)+(_0xe19e7['summary']??_0xe19e7['id']??_0x35ff0a(0x214)));}return!_0x3e6c3a[_0x35ff0a(0x1aa)]&&_0x3e6c3a[_0x35ff0a(0x1e7)]===_0x35ff0a(0x223)&&_0x3e6c3a[_0x35ff0a(0x1f1)]?.[_0x35ff0a(0x191)]&&(_0x2e4549[_0x35ff0a(0x1b6)](_0x35ff0a(0x21d)),_0x2e4549[_0x35ff0a(0x1b6)](JSON[_0x35ff0a(0x221)](_0x3e6c3a[_0x35ff0a(0x1f1)]['input'],null,0x2))),_0x2e4549['join']('\x0a');}function A(_0xffe040,_0xdd1a7b){const _0x1fd6ea=_0x5aee;if(_0xffe040[_0x1fd6ea(0x249)]===_0x1fd6ea(0x177)){_0xdd1a7b['json']?_0x40216c({'status':'blocked','action':_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x1e7)],'requestKey':_0xffe040[_0x1fd6ea(0x19c)]['requestKey'],'parent':_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x272)]??null,'check':_0xffe040[_0x1fd6ea(0x1f9)]},_0xdd1a7b):(_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x272)]&&_0x253e14(K(_0xffe040[_0x1fd6ea(0x19c)]['parent'])+'\x0a'),_0x253e14(I(_0xffe040['check'])+_0x1fd6ea(0x1d0))),process[_0x1fd6ea(0x1bc)]=0x1;return;}if(_0xffe040[_0x1fd6ea(0x249)]==='refused'){const _0xec4e79=T(_0xffe040['state']);if(_0xdd1a7b[_0x1fd6ea(0x1f4)])_0x40216c({..._0xec4e79,'status':_0x1fd6ea(0x1de)},_0xdd1a7b);else{const _0x2cbd1e=[_0x1fd6ea(0x19f)+_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x19d)]+_0x1fd6ea(0x1f8),_0x1fd6ea(0x22f)+(_0xffe040['state'][_0x1fd6ea(0x1ef)]??_0x1fd6ea(0x24c))+(_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x18e)]?_0x1fd6ea(0x21c)+_0xffe040[_0x1fd6ea(0x19c)][_0x1fd6ea(0x18e)]:'')];for(const _0x5f5b9d of _0xffe040[_0x1fd6ea(0x19c)]['refusalProblems']??[])_0x2cbd1e[_0x1fd6ea(0x1b6)]('\x20\x20-\x20'+(_0x5f5b9d[_0x1fd6ea(0x195)]??_0x1fd6ea(0x1de))+':\x20'+(_0x5f5b9d[_0x1fd6ea(0x174)]??JSON[_0x1fd6ea(0x221)](_0x5f5b9d)));_0x2cbd1e[_0x1fd6ea(0x1b6)]('inspect:\x20colony\x20order\x20show\x20'+_0xffe040[_0x1fd6ea(0x19c)]['orderId']+_0x1fd6ea(0x252)),_0x253e14(_0x2cbd1e['join']('\x0a')+'\x0a');}process['exitCode']=0x1;return;}if(['expired',_0x1fd6ea(0x17c),'transaction_pending',_0x1fd6ea(0x26b)][_0x1fd6ea(0x1b5)](_0xffe040[_0x1fd6ea(0x249)])){const _0x654ff8=_0xffe040[_0x1fd6ea(0x19c)];if(_0xdd1a7b[_0x1fd6ea(0x1f4)])_0x40216c({...T(_0x654ff8),'status':_0xffe040[_0x1fd6ea(0x249)]},_0xdd1a7b);else{const _0x3a749e=_0x654ff8[_0x1fd6ea(0x1c3)]??_0x654ff8[_0x1fd6ea(0x26c)],_0x24cc26=[_0x1fd6ea(0x1bb),'Your\x20request\x20is\x20saved.\x20Continue\x20payment\x20to\x20check\x20the\x20original\x20payment\x20before\x20retrying.'];_0x3a749e?.[_0x1fd6ea(0x25a)]&&_0x24cc26[_0x1fd6ea(0x1b6)](_0x1fd6ea(0x1fc)+_0x3a749e['hash']+(_0x3a749e['kind']?'\x20('+_0x3a749e[_0x1fd6ea(0x1c9)]+')':'')),_0x3a749e?.[_0x1fd6ea(0x23f)]&&_0x24cc26[_0x1fd6ea(0x1b6)]('reason:\x20\x20\x20\x20\x20\x20'+_0x3a749e[_0x1fd6ea(0x23f)]),_0x3a749e?.[_0x1fd6ea(0x1a9)]&&_0x24cc26[_0x1fd6ea(0x1b6)]('explorer:\x20\x20\x20\x20'+_0x3a749e[_0x1fd6ea(0x1a9)]),_0x654ff8[_0x1fd6ea(0x18e)]&&_0x654ff8[_0x1fd6ea(0x18e)]!==_0x3a749e?.[_0x1fd6ea(0x25a)]&&_0x24cc26['push'](_0x1fd6ea(0x1fc)+_0x654ff8['transactionHash']),_0x654ff8[_0x1fd6ea(0x19d)]&&_0x24cc26[_0x1fd6ea(0x1b6)]('continue:\x20\x20\x20\x20colony\x20order\x20submit\x20'+_0x654ff8['orderId']),_0x253e14(_0x24cc26['join']('\x0a')+'\x0a');}process['exitCode']=0x1;return;}if(_0xffe040['status']!==_0x1fd6ea(0x1d7))throw new Error(_0x1fd6ea(0x257)+_0xffe040[_0x1fd6ea(0x249)]+_0x1fd6ea(0x243)+_0xffe040[_0x1fd6ea(0x19c)]['orderId']+_0x1fd6ea(0x252));_0x40216c(_0xdd1a7b[_0x1fd6ea(0x1f4)]?T(_0xffe040[_0x1fd6ea(0x19c)]):ie(_0xffe040[_0x1fd6ea(0x19c)]),_0xdd1a7b);}function K(_0x349076){const _0x2147b8=_0x5aee,_0x3bf134=_0x3bbc3b(_0x349076),_0x2e1db8=[_0x2147b8(0x21e)+_0x3bf134['id'],_0x2147b8(0x1db)+(_0x3bf134[_0x2147b8(0x19c)]??''),_0x2147b8(0x1ba)+(_0x3bf134[_0x2147b8(0x23c)]??''),_0x2147b8(0x236)+b(_0x3bf134[_0x2147b8(0x1e9)],0x1f4),'paid\x20by:\x20\x20\x20'+(_0x3bf134[_0x2147b8(0x22e)]??'')];return _0x3bf134[_0x2147b8(0x24a)]&&_0x2e1db8[_0x2147b8(0x1b6)](_0x2147b8(0x25e)+_0x3bf134['project']['id']+_0x2147b8(0x181)+(_0x3bf134[_0x2147b8(0x24a)][_0x2147b8(0x273)]??'')+_0x2147b8(0x202)+_0x3bf134['project'][_0x2147b8(0x206)]['length']),_0x2e1db8[_0x2147b8(0x20e)]('\x0a');}function re(_0x4f633d){const _0x55ca7c=_0x5aee;return _0x4f633d?_0x4f633d['summary']?_0x55ca7c(0x25e)+b(_0x4f633d['summary'],0x1f4):_0x4f633d['id']?_0x55ca7c(0x25e)+_0x4f633d['id']:null:null;}function J(_0x344026,_0x4077fb,_0x4c7138,_0x51cb0e){const _0x1a9130=_0x5aee,_0x3c548a=[];_0x51cb0e&&_0x3c548a[_0x1a9130(0x1b6)](K(_0x51cb0e)),_0x3c548a[_0x1a9130(0x1b6)](_0x1a9130(0x258)+_0x344026),_0x3c548a[_0x1a9130(0x1b6)](_0x1a9130(0x256)),_0x3c548a['push'](JSON[_0x1a9130(0x221)](_0x4077fb,null,0x2)),_0x3c548a[_0x1a9130(0x1b6)](I(_0x4c7138));const _0x4647e1=re(_0x4c7138[_0x1a9130(0x24a)]);return _0x4647e1&&_0x3c548a[_0x1a9130(0x1b6)](_0x4647e1),_0x3c548a[_0x1a9130(0x20e)]('\x0a');}function O(_0x1aaa4e){const _0x5187b9=_0x5aee;return _0x1aaa4e[_0x5187b9(0x1b9)]!==void 0x0||_0x1aaa4e[_0x5187b9(0x259)]!==void 0x0||_0x1aaa4e[_0x5187b9(0x25d)]!==void 0x0||_0x1aaa4e[_0x5187b9(0x23c)]!==void 0x0||Array[_0x5187b9(0x1e3)](_0x1aaa4e[_0x5187b9(0x1e2)])&&_0x1aaa4e[_0x5187b9(0x1e2)][_0x5187b9(0x1f0)]>0x0;}function N(_0xc6c2dc){const _0xc78133=_0x5aee;return _0xc6c2dc[_0xc78133(0x1b9)]!==void 0x0||_0xc6c2dc[_0xc78133(0x25d)]!==void 0x0||_0xc6c2dc['template']!==void 0x0||Array[_0xc78133(0x1e3)](_0xc6c2dc['path'])&&_0xc6c2dc[_0xc78133(0x1e2)]['length']>0x0;}function se(_0x23b9fd,_0x219a69){const _0x2c0014=_0x5aee;return typeof _0x23b9fd==_0x2c0014(0x1cb)&&_0x23b9fd[_0x2c0014(0x199)]()!==''&&!O(_0x219a69);}function ae(_0x57dfb8,_0xdcbd9e){const _0x2baf0b=_0x5aee;return typeof _0x57dfb8==_0x2baf0b(0x1cb)&&_0x57dfb8[_0x2baf0b(0x199)]()!==''&&!N(_0xdcbd9e);}function $(_0x232002){const _0x55fbb9=_0x5aee,_0x526b42=['summary:\x20'+_0x232002[_0x55fbb9(0x228)],'deliverables:'];_0x232002[_0x55fbb9(0x219)]['length']===0x0&&_0x526b42[_0x55fbb9(0x1b6)]('\x20\x20-\x20none');for(const _0x157825 of _0x232002[_0x55fbb9(0x219)])_0x526b42[_0x55fbb9(0x1b6)]('\x20\x20-\x20'+_0x157825);return _0x526b42[_0x55fbb9(0x20e)]('\x0a');}function U(_0x393614,_0x125a77){const _0x2fbbb6=_0x5aee,_0x15eac2=[$(_0x393614),'check:\x20'+_0x125a77[_0x2fbbb6(0x1b7)][_0x2fbbb6(0x1f0)]+_0x2fbbb6(0x1b1)];for(const _0x38fd39 of _0x125a77[_0x2fbbb6(0x1b7)])_0x15eac2[_0x2fbbb6(0x1b6)](_0x2fbbb6(0x207)+_0x38fd39['code']+':\x20'+_0x38fd39[_0x2fbbb6(0x174)]);return _0x15eac2['join']('\x0a');}function W(_0x27597f,_0x511e90,_0x5180f8){const _0xcf4b45=_0x5aee;if(_0x5180f8[_0xcf4b45(0x1f4)])_0x40216c({'action':_0x511e90,'summary':_0x27597f[_0xcf4b45(0x228)],'deliverables':_0x27597f[_0xcf4b45(0x219)],'questions':_0x27597f[_0xcf4b45(0x266)],'input':null},_0x5180f8);else{const _0x343e50=_0x27597f[_0xcf4b45(0x266)][_0xcf4b45(0x1d9)](_0x153de5=>_0xcf4b45(0x207)+_0x153de5)['join']('\x0a');_0x40216c($(_0x27597f)+_0xcf4b45(0x1cd)+_0x343e50,_0x5180f8);}process[_0xcf4b45(0x1bc)]=0x1;}function pe(_0x1b4bad){const _0x16ab31=_0x5aee;return _0x1b4bad[_0x16ab31(0x23b)]===void 0x0&&_0x1b4bad[_0x16ab31(0x220)]===void 0x0?null:{'repoUrl':_0x1b4bad[_0x16ab31(0x23b)],'baseCommit':_0x1b4bad[_0x16ab31(0x220)]};}async function P({api:_0x396cfc,home:_0x6ab66b,objective:_0x23e6d9,answers:_0xc02b90,parent:_0x3cd4e0=null,source:_0x3c9993=null,github:_0x33d3bb=!0x1,opts:_0x28c93f,loadPlanner:_0x25b3ad}){const _0x1f0521=_0x5aee;return _0x1ddb5f({'api':_0x396cfc,'home':_0x6ab66b,'loadPlanner':_0x25b3ad,'objective':_0x23e6d9,'answers':_0xc02b90,'parent':_0x3cd4e0,'source':_0x3c9993,'github':_0x33d3bb,'ask':!_0x28c93f[_0x1f0521(0x1f4)]&&process[_0x1f0521(0x1dc)][_0x1f0521(0x216)]?_0x5da7a4:null});}function R(_0x28d2d7,_0x50cb13,{api:_0x3c7f0d,action:_0x28c8c4}){const _0x1149d2=_0x5aee;if(!_0x28d2d7)throw new Error(_0x1149d2(0x24f)+_0x50cb13);if(_0x28d2d7[_0x1149d2(0x24e)]!==_0x3c7f0d)throw new Error(_0x1149d2(0x19f)+_0x28d2d7[_0x1149d2(0x1fe)]+_0x1149d2(0x21a)+_0x28d2d7['api']+_0x1149d2(0x250)+_0x28d2d7[_0x1149d2(0x24e)]);if(_0x28d2d7['action']!==_0x28c8c4)throw new Error(_0x1149d2(0x20a)+_0x28d2d7[_0x1149d2(0x1fe)]+'\x20was\x20created\x20for\x20action\x20'+_0x28d2d7[_0x1149d2(0x1e7)]+_0x1149d2(0x175)+_0x28c8c4);if(!_0x28d2d7[_0x1149d2(0x191)]||typeof _0x28d2d7[_0x1149d2(0x191)]!='object'||Array[_0x1149d2(0x1e3)](_0x28d2d7[_0x1149d2(0x191)]))throw new Error(_0x1149d2(0x20a)+_0x28d2d7[_0x1149d2(0x1fe)]+_0x1149d2(0x1eb));return _0x28d2d7['input'];}function ue(_0x25a842,_0x561660){const _0x465abe=_0x5aee;return _0x465abe(0x1e6)+_0x25a842[_0x465abe(0x24e)]+_0x465abe(0x234)+_0x561660[_0x465abe(0x189)]+'\x20task\x20create\x20--request-key\x20'+_0x25a842[_0x465abe(0x1fe)];}function le(_0xf583fd,_0x2271aa){const _0x2e12d0=_0x5aee;return _0x2e12d0(0x1e6)+_0xf583fd[_0x2e12d0(0x24e)]+_0x2e12d0(0x234)+_0x2271aa[_0x2e12d0(0x189)]+'\x20task\x20continue\x20'+_0xf583fd['input']['parentJobId']+'\x20--request-key\x20'+_0xf583fd[_0x2e12d0(0x1fe)];}function ge(_0x511387,{loadPlanner:_0x154f0a=_0x43d523}={}){const _0x561359=_0x5aee,_0x3c66da=_0x511387['command'](_0x561359(0x18c))[_0x561359(0x254)](_0x561359(0x1ed));_0x287884(_0x3c66da),_0x3c66da[_0x561359(0x233)](_0x561359(0x211))[_0x561359(0x254)](_0x561359(0x230))[_0x561359(0x244)]('--q\x20<text>','objective\x20or\x20job\x20id\x20prefix')[_0x561359(0x244)](_0x561359(0x19e),'creation-time\x20cursor\x20(exclusive)')['option']('--since\x20<time>','jobs\x20that\x20moved\x20after\x20this\x20time')[_0x561359(0x244)](_0x561359(0x20d),_0x561359(0x1e4))['option']('--exclude-oracle',_0x561359(0x17a))['action'](async(_0x585187,_0x4732d1)=>{const _0x12c648=_0x561359,_0x42c827=_0x4732d1[_0x12c648(0x1a0)](),_0x1817d2=await _0x6e1b30(_0x42c827['api'],ee(_0x42c827));_0x40216c(_0x42c827[_0x12c648(0x1f4)]?_0x1817d2['data']:te(_0x1817d2[_0x12c648(0x1ca)]),_0x42c827);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x235))['description'](_0x561359(0x201))[_0x561359(0x1e7)](async(_0x2e606f,_0x2d9166,_0x4890c7)=>{const _0x2a1fd2=_0x561359,_0x410f0b=_0x4890c7[_0x2a1fd2(0x1a0)](),_0x4248eb=await _0x6e1b30(_0x410f0b[_0x2a1fd2(0x24e)],_0x2a1fd2(0x1a5)+encodeURIComponent(_0x2e606f));_0x40216c(_0x410f0b[_0x2a1fd2(0x1f4)]?_0x4248eb[_0x2a1fd2(0x1ca)]:ne(_0x4248eb[_0x2a1fd2(0x1ca)]),_0x410f0b);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x1cf))[_0x561359(0x254)]('show\x20a\x20job\x20result\x20and\x20artifact\x20URLs')[_0x561359(0x1e7)](async(_0x3aa943,_0x243e4e,_0x2afdac)=>{const _0x8b8efc=_0x561359,_0x1452af=_0x2afdac[_0x8b8efc(0x1a0)](),_0x576925=await _0x6e1b30(_0x1452af[_0x8b8efc(0x24e)],_0x8b8efc(0x1a5)+encodeURIComponent(_0x3aa943)+_0x8b8efc(0x1ff));_0x40216c(_0x1452af[_0x8b8efc(0x1f4)]?_0x576925[_0x8b8efc(0x1ca)]:S(_0x576925[_0x8b8efc(0x1ca)]),_0x1452af);}),_0x3c66da[_0x561359(0x233)]('wait\x20<id>')[_0x561359(0x254)](_0x561359(0x1c0))[_0x561359(0x244)](_0x561359(0x1d4),_0x561359(0x1bf),String(_0x4e7f2d))[_0x561359(0x244)](_0x561359(0x251),'total\x20timeout\x20in\x20seconds',String(_0x2f6fa0))[_0x561359(0x1e7)](async(_0x123623,_0x50036b,_0x24f059)=>{const _0x44546d=_0x561359,_0x38b69d=_0x24f059['optsWithGlobals'](),_0x156b64=await _0x36a815({'api':_0x38b69d['api'],'id':_0x123623,'interval':_0x38b69d[_0x44546d(0x190)],'timeout':_0x38b69d[_0x44546d(0x24b)],'onProgress':_0x4aea78=>{const _0x309747=_0x44546d;_0x4aea78[_0x309747(0x186)]===_0x309747(0x1cc)?_0x253e14('wait:\x20'+_0x4aea78[_0x309747(0x19c)]+_0x309747(0x1fb)+_0x4aea78[_0x309747(0x23d)]+_0x309747(0x1e8)+_0x4aea78[_0x309747(0x184)]+',\x20'+(_0x4aea78[_0x309747(0x1b2)]/0x3e8)[_0x309747(0x22d)](0x1)+'s)\x0a'):_0x4aea78[_0x309747(0x186)]===_0x309747(0x1ac)&&_0x253e14('wait:\x20'+(_0x4aea78[_0x309747(0x249)]?_0x309747(0x22a)+_0x4aea78[_0x309747(0x249)]:_0x309747(0x19b))+';\x20retrying\x20in\x20'+(_0x4aea78[_0x309747(0x1a1)]/0x3e8)[_0x309747(0x22d)](0x1)+_0x309747(0x20b)+_0x4aea78[_0x309747(0x1c7)]+')\x0a');}});if(_0x156b64[_0x44546d(0x239)]===_0x44546d(0x205)){_0x253e14(_0x44546d(0x20c)),process['exitCode']=0x82;return;}_0x156b64[_0x44546d(0x215)]&&_0x40216c(_0x38b69d[_0x44546d(0x1f4)]?_0x156b64[_0x44546d(0x215)]:S(_0x156b64[_0x44546d(0x215)]),_0x38b69d),_0x156b64['outcome']!==_0x44546d(0x1f5)&&(_0x253e14(_0x44546d(0x1b8)+_0x156b64[_0x44546d(0x1fa)]+'\x0a'),process['exitCode']=0x1);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x1f3))['description'](_0x561359(0x265))[_0x561359(0x1ea)](_0x561359(0x1ee),'destination\x20directory')[_0x561359(0x1e7)](async(_0x3e45b4,_0x134ada,_0x8b85a0)=>{const _0x376b7d=_0x561359,_0x39680e=_0x8b85a0['optsWithGlobals'](),_0x100458=await _0x59c773({'api':_0x39680e[_0x376b7d(0x24e)],'id':_0x3e45b4,'out':_0x39680e[_0x376b7d(0x26e)],'onProgress':_0x1bd4cb=>{const _0x31ba0a=_0x376b7d;_0x1bd4cb[_0x31ba0a(0x186)]===_0x31ba0a(0x1af)&&_0x253e14('download:\x20'+_0x1bd4cb[_0x31ba0a(0x1e2)]+_0x31ba0a(0x21b)+_0x1bd4cb[_0x31ba0a(0x1b9)]+'\x0a');}});_0x40216c(_0x39680e[_0x376b7d(0x1f4)]?_0x100458:oe(_0x100458),_0x39680e);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x1f9))['description']('validate\x20a\x20job\x20body\x20without\x20creating\x20an\x20order')['requiredOption'](_0x561359(0x1b4),'job\x20body\x20JSON\x20file')['option'](_0x561359(0x17f),_0x561359(0x23e))['action'](async(_0x5a98ac,_0x35f706)=>{const _0xd24d48=_0x561359,_0x4455a2=_0x35f706[_0xd24d48(0x1a0)](),_0x309f15=await _0x41f5a5(_0x4455a2[_0xd24d48(0x1b9)]),_0x1292cd=_0x4455a2[_0xd24d48(0x1e7)]??_0x53f80f(_0x309f15),_0x1a601a=await _0x347c7b(_0x4455a2[_0xd24d48(0x24e)],_0x309f15,_0x1292cd);_0x40216c(_0x4455a2[_0xd24d48(0x1f4)]?_0x1a601a:I(_0x1a601a),_0x4455a2);}),_0x3c66da['command'](_0x561359(0x178))[_0x561359(0x254)](_0x561359(0x1a6))[_0x561359(0x1ea)](_0x561359(0x1b4),_0x561359(0x253))['option'](_0x561359(0x1c4),_0x561359(0x1a4))[_0x561359(0x1e7)](async(_0x486ab6,_0x278182)=>{const _0x57f371=_0x561359,_0x2f8741=_0x278182[_0x57f371(0x1a0)](),_0x42815b=await x(_0x2f8741,'job.open'),_0x5b699f=await _0x3706aa({'api':_0x2f8741[_0x57f371(0x24e)],'home':_0x2f8741[_0x57f371(0x189)],'file':_0x2f8741[_0x57f371(0x1b9)],'action':_0x57f371(0x1e5),'requestKey':_0x2f8741['requestKey'],'yes':_0x2f8741[_0x57f371(0x1ae)],'keyEnv':_0x2f8741[_0x57f371(0x245)],'rpc':_0x2f8741[_0x57f371(0x1a7)],'paymentChain':_0x2f8741[_0x57f371(0x171)]??_0x42815b?.[_0x57f371(0x171)],'payWith':_0x2f8741['payWith']??_0x42815b?.[_0x57f371(0x262)],'onProgress':_0x2aaf95(_0x2f8741)});A(_0x5b699f,_0x2f8741);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x224))['description']('create\x20a\x20job\x20from\x20a\x20clear\x20objective\x20or\x20a\x20JSON\x20file')[_0x561359(0x244)]('--file\x20<path>',_0x561359(0x22b))['option'](_0x561359(0x255),_0x561359(0x1f6))[_0x561359(0x244)](_0x561359(0x1dd),_0x561359(0x212))[_0x561359(0x244)]('--template\x20<name>','job\x20template')[_0x561359(0x244)](_0x561359(0x260),_0x561359(0x1c1),(_0x1f1c1a,_0x58f51f)=>[..._0x58f51f,_0x1f1c1a],[])[_0x561359(0x244)](_0x561359(0x238),_0x561359(0x25b))[_0x561359(0x244)](_0x561359(0x271),_0x561359(0x192))[_0x561359(0x244)](_0x561359(0x26a),_0x561359(0x204))[_0x561359(0x244)](_0x561359(0x1ad),_0x561359(0x1d1),(_0x2e439a,_0x18f6a5)=>[..._0x18f6a5,_0x2e439a],[])['option'](_0x561359(0x1d2),_0x561359(0x263))[_0x561359(0x244)](_0x561359(0x218),_0x561359(0x26d))[_0x561359(0x244)](_0x561359(0x1c4),_0x561359(0x1a4))[_0x561359(0x1e7)](async(_0x205a24,_0x2028f7,_0x3ac265)=>{const _0x48146a=_0x561359,_0x279a24=_0x3ac265[_0x48146a(0x1a0)](),_0x47fced=_0x279a24['dryRun']?null:await x(_0x279a24,_0x48146a(0x1e5)),_0x5fae7a=se(_0x205a24,_0x279a24);let _0x96574f,_0x32ddaf=null;if(_0x279a24[_0x48146a(0x1fe)]&&!O(_0x279a24)&&(_0x205a24===void 0x0||_0x5fae7a)){const _0x2bdf89=await _0x96fca9(_0x279a24['home'],_0x279a24[_0x48146a(0x1fe)]);if(_0x96574f=R(_0x2bdf89,_0x279a24[_0x48146a(0x1fe)],{'api':_0x279a24[_0x48146a(0x24e)],'action':_0x48146a(0x1e5)}),_0x205a24!==void 0x0&&_0x205a24!==_0x96574f[_0x48146a(0x1e9)])throw new Error(_0x48146a(0x20a)+_0x279a24['requestKey']+'\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it');}else{if(_0x5fae7a){if(_0x32ddaf=await P({'api':_0x279a24[_0x48146a(0x24e)],'home':_0x279a24['home'],'objective':_0x205a24,'answers':_0x279a24[_0x48146a(0x24d)],'source':pe(_0x279a24),'github':_0x279a24[_0x48146a(0x182)]===!0x0,'opts':_0x279a24,'loadPlanner':_0x154f0a}),_0x32ddaf[_0x48146a(0x191)]===null){W(_0x32ddaf,_0x48146a(0x1e5),_0x279a24);return;}_0x96574f=_0x32ddaf[_0x48146a(0x191)];}else{const _0x1120b3=_0x279a24[_0x48146a(0x1b9)]?await _0x41f5a5(_0x279a24[_0x48146a(0x1b9)]):void 0x0;_0x96574f=await _0x5d1a0d({'fileInput':_0x1120b3,'objective':_0x205a24,'preset':_0x279a24[_0x48146a(0x259)],'skill':_0x279a24[_0x48146a(0x25d)],'template':_0x279a24['template'],'paths':_0x279a24[_0x48146a(0x1e2)],'repo':_0x279a24[_0x48146a(0x23b)],'commit':_0x279a24[_0x48146a(0x220)],'github':_0x279a24[_0x48146a(0x182)]});}}if(_0x279a24[_0x48146a(0x185)]&&(await _0x2e7447(_0x279a24[_0x48146a(0x185)],_0x96574f),_0x279a24[_0x48146a(0x1f4)]||_0x253e14('saved\x20input:\x20'+_0x279a24['save']+'\x0a')),_0x279a24[_0x48146a(0x21f)]){const _0x372af5=await _0x347c7b(_0x279a24['api'],_0x96574f,_0x48146a(0x1e5));_0x279a24[_0x48146a(0x1f4)]?_0x40216c({'action':_0x48146a(0x1e5),..._0x32ddaf?{'summary':_0x32ddaf[_0x48146a(0x228)],'deliverables':_0x32ddaf['deliverables']}:{},'input':_0x96574f,'check':_0x372af5},_0x279a24):_0x40216c(_0x32ddaf?U(_0x32ddaf,_0x372af5):J(_0x48146a(0x1e5),_0x96574f,_0x372af5),_0x279a24),_0x372af5[_0x48146a(0x1b7)]['length']>0x0&&(process[_0x48146a(0x1bc)]=0x1);return;}_0x32ddaf&&!_0x279a24[_0x48146a(0x1f4)]&&_0x253e14($(_0x32ddaf)+'\x0a');const _0x10489b=await _0x3706aa({'api':_0x279a24[_0x48146a(0x24e)],'home':_0x279a24[_0x48146a(0x189)],'input':_0x96574f,'action':_0x48146a(0x1e5),'requestKey':_0x279a24[_0x48146a(0x1fe)],'plan':_0x32ddaf?{'summary':_0x32ddaf['summary'],'deliverables':_0x32ddaf['deliverables']}:void 0x0,'yes':_0x279a24['yes'],'keyEnv':_0x279a24[_0x48146a(0x245)],'rpc':_0x279a24[_0x48146a(0x1a7)],'paymentChain':_0x279a24[_0x48146a(0x171)]??_0x47fced?.[_0x48146a(0x171)],'payWith':_0x279a24['payWith']??_0x47fced?.[_0x48146a(0x262)],'onProgress':_0x2aaf95(_0x279a24),'retryCommand':_0x40a75c=>ue(_0x40a75c,_0x279a24)});A(_0x10489b,_0x279a24);}),_0x3c66da[_0x561359(0x233)](_0x561359(0x176))['description'](_0x561359(0x229))[_0x561359(0x244)]('--file\x20<path>',_0x561359(0x18d))[_0x561359(0x244)]('--skill\x20<id>','runnable\x20skill\x20id')[_0x561359(0x244)](_0x561359(0x203),_0x561359(0x188))[_0x561359(0x244)](_0x561359(0x260),_0x561359(0x1c1),(_0x17d858,_0x2ef27d)=>[..._0x2ef27d,_0x17d858],[])[_0x561359(0x244)](_0x561359(0x1ad),_0x561359(0x1d1),(_0x3517f2,_0x58f436)=>[..._0x58f436,_0x3517f2],[])[_0x561359(0x244)](_0x561359(0x1d2),'only\x20run\x20the\x20free\x20check\x20and\x20print\x20the\x20input')[_0x561359(0x244)](_0x561359(0x218),_0x561359(0x26d))[_0x561359(0x244)]('--request-key\x20<uuid>',_0x561359(0x1a4))['action'](async(_0x308516,_0x4da877,_0x3cd0f5,_0x5dc8eb)=>{const _0x215cdd=_0x561359,_0x120030=_0x5dc8eb[_0x215cdd(0x1a0)](),_0x1a34e1=_0x120030['dryRun']?null:await x(_0x120030,_0x215cdd(0x223)),_0x526d11=ae(_0x4da877,_0x120030);let _0x33c19a,_0x364b12,_0x4eb4df=null;if(_0x120030[_0x215cdd(0x1fe)]&&!N(_0x120030)&&(_0x4da877===void 0x0||_0x526d11)){const _0x51fd92=await _0x96fca9(_0x120030[_0x215cdd(0x189)],_0x120030[_0x215cdd(0x1fe)]);if(_0x33c19a=R(_0x51fd92,_0x120030[_0x215cdd(0x1fe)],{'api':_0x120030[_0x215cdd(0x24e)],'action':'job.continue'}),_0x33c19a[_0x215cdd(0x200)]!==_0x308516)throw new Error(_0x215cdd(0x20a)+_0x120030[_0x215cdd(0x1fe)]+_0x215cdd(0x194)+(_0x33c19a[_0x215cdd(0x200)]??_0x215cdd(0x18b))+_0x215cdd(0x175)+_0x308516);if(_0x4da877!==void 0x0&&_0x4da877!==_0x33c19a[_0x215cdd(0x1e9)])throw new Error(_0x215cdd(0x20a)+_0x120030[_0x215cdd(0x1fe)]+'\x20was\x20created\x20for\x20a\x20different\x20objective;\x20omit\x20the\x20new\x20objective\x20to\x20resume\x20it');_0x364b12=(await _0x6e1b30(_0x120030[_0x215cdd(0x24e)],_0x215cdd(0x1a5)+encodeURIComponent(_0x308516)))[_0x215cdd(0x1ca)];}else{if(_0x526d11){if(_0x364b12=(await _0x6e1b30(_0x120030[_0x215cdd(0x24e)],_0x215cdd(0x1a5)+encodeURIComponent(_0x308516)))[_0x215cdd(0x1ca)],_0x4eb4df=await P({'api':_0x120030[_0x215cdd(0x24e)],'home':_0x120030[_0x215cdd(0x189)],'objective':_0x4da877,'answers':_0x120030[_0x215cdd(0x24d)],'parent':_0x364b12,'opts':_0x120030,'loadPlanner':_0x154f0a}),_0x4eb4df[_0x215cdd(0x191)]===null){W(_0x4eb4df,'job.continue',_0x120030);return;}_0x33c19a=_0x4eb4df[_0x215cdd(0x191)],_0x33c19a['parentJobId']!==_0x308516&&(_0x33c19a={..._0x33c19a,'parentJobId':_0x308516});}else{const _0x4a9f6b=_0x120030[_0x215cdd(0x1b9)]?await _0x41f5a5(_0x120030['file']):void 0x0;_0x33c19a=await _0x274855({'id':_0x308516,'fileInput':_0x4a9f6b,'objective':_0x4da877,'skill':_0x120030[_0x215cdd(0x25d)],'template':_0x120030[_0x215cdd(0x23c)],'paths':_0x120030['path']}),_0x364b12=(await _0x6e1b30(_0x120030['api'],_0x215cdd(0x1a5)+encodeURIComponent(_0x308516)))['data'];}}if(_0x120030[_0x215cdd(0x185)]&&(await _0x2e7447(_0x120030[_0x215cdd(0x185)],_0x33c19a),_0x120030[_0x215cdd(0x1f4)]||_0x253e14(_0x215cdd(0x231)+_0x120030[_0x215cdd(0x185)]+'\x0a')),_0x120030[_0x215cdd(0x21f)]){const _0xd1bcde=await _0x347c7b(_0x120030[_0x215cdd(0x24e)],_0x33c19a,_0x215cdd(0x223));_0x120030[_0x215cdd(0x1f4)]?_0x40216c({'action':'job.continue',..._0x4eb4df?{'summary':_0x4eb4df[_0x215cdd(0x228)],'deliverables':_0x4eb4df[_0x215cdd(0x219)]}:{},'parent':_0x3bbc3b(_0x364b12),'input':_0x33c19a,'check':_0xd1bcde},_0x120030):_0x40216c(_0x4eb4df?U(_0x4eb4df,_0xd1bcde):J(_0x215cdd(0x223),_0x33c19a,_0xd1bcde,_0x364b12),_0x120030),_0xd1bcde[_0x215cdd(0x1b7)]['length']>0x0&&(process['exitCode']=0x1);return;}_0x4eb4df&&!_0x120030[_0x215cdd(0x1f4)]&&_0x253e14($(_0x4eb4df)+'\x0a');const _0x2ff870=await _0x3706aa({'api':_0x120030[_0x215cdd(0x24e)],'home':_0x120030[_0x215cdd(0x189)],'input':_0x33c19a,'action':_0x215cdd(0x223),'requestKey':_0x120030[_0x215cdd(0x1fe)],'plan':_0x4eb4df?{'summary':_0x4eb4df['summary'],'deliverables':_0x4eb4df[_0x215cdd(0x219)]}:void 0x0,'yes':_0x120030[_0x215cdd(0x1ae)],'keyEnv':_0x120030[_0x215cdd(0x245)],'rpc':_0x120030['rpc'],'paymentChain':_0x120030[_0x215cdd(0x171)]??_0x1a34e1?.[_0x215cdd(0x171)],'payWith':_0x120030[_0x215cdd(0x262)]??_0x1a34e1?.[_0x215cdd(0x262)],'onProgress':_0x2aaf95(_0x120030),'retryCommand':_0x8b24e2=>le(_0x8b24e2,_0x120030)});_0x2ff870[_0x215cdd(0x19c)]&&(_0x2ff870[_0x215cdd(0x19c)]['parent']=_0x3bbc3b(_0x364b12)),A(_0x2ff870,_0x120030);});}export{ge as registerTaskCommands};
|
package/dist/commands/wallet.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{erc20Abi as _0x7f37dd,parseUnits as _0xfbd0c0}from'viem';import{confirmAction as _0x38bf9c,getRpcClients as _0xb1d9e3,print as _0xe47798}from'../shared.mjs';import{loadPaymentConfig as _0x468388}from'../lib/payments.mjs';import{selectedPaymentNetwork as _0x4c0b9e,savePaymentNetwork as _0x98571a}from'../lib/payment-networks.mjs';import{walletInfo as _0x2d5ca3,saveLocalWallet as _0x11d0d2,backupWallet as _0x19da7d,restoreWallet as _0x48a6c5,walletFile as _0x54d3b9,listWallets as _0x5733fa,selectWallet as _0x30481f}from'../lib/local-wallet.mjs';function _0x8e65(){const _0x18bce6=['copy\x20the\x20encrypted\x20wallet\x20file;\x20never\x20export\x20a\x20plaintext\x20key','Confirm\x20password','length','--amount\x20<amount>','description','writeContract','Receive\x20on\x20','Passwords\x20do\x20not\x20match.','require\x20this\x20wallet\x20address\x20for\x20the\x20authorization','key','api','--amount\x20must\x20be\x20greater\x20than\x20zero','decimals','job.open','\x20(current)','payment\x20allowance:\x20\x20','map','symbol','\x0aAsset:\x20','approve\x20transaction\x20failed:\x20','priceAtomic','\x0aEncrypted\x20file:\x20','asset','allowance','requiredOption','action','list','show\x20IMD\x20balance\x20and\x20payment\x20allowance\x20on\x20the\x20selected\x20network','list\x20saved\x20local\x20wallets\x20and\x20the\x20current\x20selection','address','\x0aSpender:\x20','\x0aBack\x20up\x20this\x20file\x20and\x20keep\x20your\x20password.\x20Both\x20are\x20needed\x20to\x20restore\x20your\x20wallet.\x0aRun\x20colony\x20wallet\x20receive\x20to\x20deposit\x20funds.','authorized\x20','\x20atomic)','balance:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','address:\x20','encrypted\x20JSON\x20keystore\x20backup','optsWithGlobals','Local\x20wallet\x20password\x20(at\x20least\x208\x20characters)','chainName','payment\x20coins:','Active\x20wallet:\x20','quote\x20price:\x20\x20\x20\x20\x20\x20\x20\x20','\x20in\x20the\x20sending\x20wallet.\x20Include\x20ETH\x20for\x20network\x20fees.','path','\x20IMD\x20on\x20','Backup\x20password','asset:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','create\x20a\x20new\x20password-encrypted\x20local\x20wallet','\x0aCoins:\x20','qrFile','token\x20amount\x20to\x20approve,\x20in\x20whole\x20tokens','chain','select\x20a\x20saved\x20wallet','waitForTransactionReceipt','balanceAtomic','write','option','network\x20[name]','\x0aThis\x20transaction\x20also\x20uses\x20ETH\x20for\x20network\x20fees.','coins','--file\x20<file>','use\x20<address>','new\x20backup\x20file\x20path','wallet','active','\x0atx:\x20','amount','authorize\x20an\x20exact\x20IMD\x20amount\x20on\x20the\x20selected\x20payment\x20network','Private\x20key\x20(hidden)','join','out','receive','backup','import\x20a\x20private\x20key\x20using\x20hidden\x20terminal\x20input','approve','address:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','balance','status','--wallet\x20<address>','--out\x20<file>','name','command','home','\x0aSelect\x20','json','configured','allowanceAtomic','file','save\x20an\x20SVG\x20QR\x20code\x20to\x20a\x20new\x20file','network:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','show\x20the\x20deposit\x20address\x20and\x20QR\x20code\x20on\x20the\x20selected\x20network'];_0x8e65=function(){return _0x18bce6;};return _0x8e65();}import{readPassword as _0x2dfd36}from'../lib/password.mjs';import{walletStatus as _0x3459c5}from'../lib/wallet-status.mjs';import{receiveWallet as _0x5b9acb,receiveQr as _0x189770,saveReceiveQr as _0x3e2962}from'../lib/wallet-receive.mjs';async function k(){const _0x5e3aba=_0x1d0b,_0x35a49d=await _0x2dfd36(_0x5e3aba(0x167));if(_0x35a49d!==await _0x2dfd36(_0x5e3aba(0x142)))throw new Error(_0x5e3aba(0x148));return _0x35a49d;}function h(_0x2ddb8c,_0x2c8420){const _0x40f5ff=_0x1d0b;return'Wallet\x20ready:\x20'+_0x2ddb8c[_0x40f5ff(0x15e)]+_0x40f5ff(0x156)+_0x54d3b9(_0x2c8420)+_0x40f5ff(0x160);}function S(_0x5bcb70){const _0x25dc52=_0x1d0b;return _0x25dc52(0x164)+_0x5bcb70;}function _0x1d0b(_0x460f16,_0x8e65e7){_0x460f16=_0x460f16-0x141;const _0x1d0be5=_0x8e65();let _0x5a3a56=_0x1d0be5[_0x460f16];return _0x5a3a56;}function z(_0x247b7e){const _0x486155=_0x1d0b;return[_0x486155(0x18d)+_0x247b7e['address'],_0x486155(0x19b)+_0x247b7e[_0x486155(0x168)]+'\x20('+_0x247b7e['chainId']+')',_0x486155(0x170)+_0x247b7e[_0x486155(0x157)],_0x486155(0x163)+_0x247b7e[_0x486155(0x18e)]+'\x20('+_0x247b7e[_0x486155(0x178)]+_0x486155(0x162),_0x486155(0x150)+_0x247b7e[_0x486155(0x158)]+'\x20('+_0x247b7e[_0x486155(0x198)]+_0x486155(0x162),_0x486155(0x16b)+_0x247b7e['price']+'\x20('+_0x247b7e[_0x486155(0x155)]+_0x486155(0x162),_0x486155(0x169),..._0x247b7e[_0x486155(0x17d)][_0x486155(0x151)](_0x4ffe1a=>'\x20\x20'+_0x4ffe1a[_0x486155(0x152)]+':\x20'+_0x4ffe1a[_0x486155(0x18e)])][_0x486155(0x187)]('\x0a');}function J(_0x3edd11){const _0x550236=_0x1d0b,_0x1d5b11=_0x3edd11[_0x550236(0x193)](_0x550236(0x181))[_0x550236(0x145)]('create,\x20import,\x20back\x20up\x20and\x20fund\x20your\x20local\x20wallet');_0x1d5b11['command'](_0x550236(0x15b))[_0x550236(0x145)](_0x550236(0x15d))[_0x550236(0x15a)]((_0x387749,_0x404aed)=>{const _0x143e75=_0x550236,_0x5ac33f=_0x404aed[_0x143e75(0x166)](),_0x11b0a0=_0x5733fa(_0x5ac33f[_0x143e75(0x194)]);_0xe47798(_0x5ac33f[_0x143e75(0x196)]?_0x11b0a0:_0x11b0a0[_0x143e75(0x143)]?_0x11b0a0[_0x143e75(0x151)](_0x4d1471=>(_0x4d1471[_0x143e75(0x182)]?'*':'\x20')+'\x20'+_0x4d1471[_0x143e75(0x15e)]+(_0x4d1471[_0x143e75(0x182)]?_0x143e75(0x14f):''))[_0x143e75(0x187)]('\x0a'):'No\x20saved\x20wallets.\x20Create,\x20import\x20or\x20restore\x20one.',_0x5ac33f);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x17f))[_0x550236(0x145)](_0x550236(0x176))['action'](async(_0x30c896,_0x33c5c8,_0x5c91ad)=>{const _0x13c08b=_0x550236,_0x410058=_0x5c91ad['optsWithGlobals'](),_0x378629=await _0x30481f(_0x410058[_0x13c08b(0x194)],_0x30c896);_0xe47798(_0x410058[_0x13c08b(0x196)]?_0x378629:_0x13c08b(0x16a)+_0x378629[_0x13c08b(0x15e)],_0x410058);}),_0x1d5b11[_0x550236(0x193)]('create')[_0x550236(0x145)](_0x550236(0x171))['action'](async(_0xde360b,_0x4d9a11)=>{const _0x60abdd=_0x550236,_0x4e8c60=_0x4d9a11['optsWithGlobals'](),_0x5e256f=await _0x11d0d2(_0x4e8c60[_0x60abdd(0x194)],_0x5733fa(_0x4e8c60['home'])[_0x60abdd(0x143)]?void 0x0:await k());_0xe47798(_0x4e8c60[_0x60abdd(0x196)]?_0x5e256f:h(_0x5e256f,_0x4e8c60['home']),_0x4e8c60);}),_0x1d5b11['command']('import')['description'](_0x550236(0x18b))[_0x550236(0x15a)](async(_0x2c868d,_0x536729)=>{const _0x4c7735=_0x550236,_0x430dfc=_0x536729['optsWithGlobals'](),_0x4e97a8=await _0x2dfd36(_0x4c7735(0x186)),_0x229c8d=await _0x11d0d2(_0x430dfc['home'],_0x5733fa(_0x430dfc[_0x4c7735(0x194)])[_0x4c7735(0x143)]?void 0x0:await k(),_0x4e97a8);_0xe47798(_0x430dfc[_0x4c7735(0x196)]?_0x229c8d:h(_0x229c8d,_0x430dfc[_0x4c7735(0x194)]),_0x430dfc);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x18a))['description'](_0x550236(0x141))[_0x550236(0x159)](_0x550236(0x191),_0x550236(0x180))[_0x550236(0x15a)](async(_0x3d19bc,_0x4fef4b)=>{const _0x431d8b=_0x550236,_0x92b02b=_0x4fef4b['optsWithGlobals'](),_0x99fb7=await _0x19da7d(_0x92b02b[_0x431d8b(0x194)],_0x92b02b[_0x431d8b(0x188)]);_0xe47798(_0x92b02b[_0x431d8b(0x196)]?_0x99fb7:'Encrypted\x20backup\x20saved:\x20'+_0x99fb7[_0x431d8b(0x16d)]+'\x0aKeep\x20your\x20wallet\x20password\x20separately.',_0x92b02b);}),_0x1d5b11[_0x550236(0x193)]('restore')[_0x550236(0x145)]('add\x20a\x20wallet\x20from\x20an\x20encrypted\x20backup\x20and\x20select\x20it')[_0x550236(0x159)](_0x550236(0x17e),_0x550236(0x165))[_0x550236(0x15a)](async(_0x2830bf,_0x4a9adc)=>{const _0x4e61fa=_0x550236,_0x535771=_0x4a9adc[_0x4e61fa(0x166)](),_0x27fa7c=await _0x48a6c5(_0x535771['home'],_0x535771[_0x4e61fa(0x199)],await _0x2dfd36(_0x4e61fa(0x16f)));_0xe47798(_0x535771[_0x4e61fa(0x196)]?_0x27fa7c:h(_0x27fa7c,_0x535771['home']),_0x535771);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x189))[_0x550236(0x145)](_0x550236(0x19c))['option'](_0x550236(0x191),_0x550236(0x19a))['action'](async(_0x22a67c,_0x4e5f18)=>{const _0xc0d80d=_0x550236,_0x16913e=_0x4e5f18['optsWithGlobals'](),_0x1eb4a4=await _0x5b9acb(_0x16913e);if(_0x16913e[_0xc0d80d(0x188)]&&(_0x1eb4a4[_0xc0d80d(0x173)]=(await _0x3e2962(_0x1eb4a4[_0xc0d80d(0x15e)],_0x16913e[_0xc0d80d(0x188)]))[_0xc0d80d(0x16d)]),_0x16913e[_0xc0d80d(0x196)])return _0xe47798(_0x1eb4a4,_0x16913e);_0xe47798(_0xc0d80d(0x147)+_0x1eb4a4[_0xc0d80d(0x168)]+'\x0a'+_0x1eb4a4['address']+_0xc0d80d(0x172)+_0x1eb4a4['coins'][_0xc0d80d(0x187)](',\x20')+_0xc0d80d(0x195)+_0x1eb4a4[_0xc0d80d(0x168)]+_0xc0d80d(0x16c),_0x16913e),_0x1eb4a4[_0xc0d80d(0x173)]?_0xe47798('QR\x20saved:\x20'+_0x1eb4a4[_0xc0d80d(0x173)],_0x16913e):process['stdout'][_0xc0d80d(0x179)](await _0x189770(_0x1eb4a4[_0xc0d80d(0x15e)]));}),_0x1d5b11['command'](_0x550236(0x17b))[_0x550236(0x145)]('show\x20or\x20save\x20the\x20payment\x20network:\x20ethereum\x20or\x20robinhood')[_0x550236(0x15a)](async(_0x24816d,_0xc1d836,_0x2bc091)=>{const _0x37c9ab=_0x550236,_0xc14fbc=_0x2bc091[_0x37c9ab(0x166)](),_0x2ed18d=_0x24816d?await _0x98571a(_0xc14fbc['home'],_0x24816d):await _0x4c0b9e(_0xc14fbc),_0x46c10b={'network':_0x2ed18d[_0x37c9ab(0x14a)],'name':_0x2ed18d[_0x37c9ab(0x175)][_0x37c9ab(0x192)],'chainId':_0x2ed18d[_0x37c9ab(0x175)]['id']};_0xe47798(_0xc14fbc[_0x37c9ab(0x196)]?_0x46c10b:'Payment\x20network:\x20'+_0x46c10b[_0x37c9ab(0x192)]+'\x20('+_0x46c10b['network']+')',_0xc14fbc);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x15e))[_0x550236(0x145)]('print\x20your\x20public\x20wallet\x20address\x20without\x20unlocking')[_0x550236(0x15a)]((_0x25f766,_0x44e1dd)=>{const _0x2d148b=_0x550236,_0x1a4cb4=_0x44e1dd[_0x2d148b(0x166)](),_0x4d7573=_0x2d5ca3(_0x1a4cb4);if(!_0x4d7573[_0x2d148b(0x197)])throw new Error('Create\x20or\x20import\x20a\x20wallet\x20first.');_0xe47798(_0x1a4cb4[_0x2d148b(0x196)]?{'address':_0x4d7573[_0x2d148b(0x15e)]}:S(_0x4d7573[_0x2d148b(0x15e)]),_0x1a4cb4);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x18f))[_0x550236(0x145)](_0x550236(0x15c))['action'](async(_0x19a1eb,_0x46bbe9)=>{const _0x456882=_0x550236,_0x687490=_0x46bbe9[_0x456882(0x166)](),_0x3396b4=await _0x3459c5(_0x687490);_0xe47798(_0x687490[_0x456882(0x196)]?_0x3396b4:z(_0x3396b4),_0x687490);}),_0x1d5b11[_0x550236(0x193)](_0x550236(0x18c))[_0x550236(0x145)](_0x550236(0x185))[_0x550236(0x159)](_0x550236(0x144),_0x550236(0x174))[_0x550236(0x17a)](_0x550236(0x190),_0x550236(0x149))[_0x550236(0x15a)](async(_0xfa4bb8,_0x347dea)=>{const _0x182760=_0x550236,_0x38377e=_0x347dea['optsWithGlobals'](),_0x21f37d=_0x38377e[_0x182760(0x181)]??_0x2d5ca3(_0x38377e)[_0x182760(0x15e)],_0x92310a=await _0x4c0b9e(_0x38377e),{payment:_0x32757d,chainId:_0x188b36,spender:_0x36edb0}=await _0x468388(_0x38377e[_0x182760(0x14b)],_0x182760(0x14e),_0x92310a[_0x182760(0x14a)]),_0x43d46a=_0xfbd0c0(_0x38377e[_0x182760(0x184)],_0x32757d[_0x182760(0x14d)]);if(_0x43d46a<=0x0n)throw new Error(_0x182760(0x14c));await _0x38bf9c('Authorize\x20'+_0x38377e[_0x182760(0x184)]+'\x20IMD\x20for\x20payment\x20on\x20'+_0x92310a[_0x182760(0x175)]['name']+'?\x0aWallet:\x20'+_0x21f37d+_0x182760(0x153)+_0x32757d[_0x182760(0x157)]+_0x182760(0x15f)+_0x36edb0+_0x182760(0x17c),_0x38377e);const {publicClient:_0x582d4a,walletClient:_0x12c50f}=await _0xb1d9e3({..._0x38377e,'expectedWallet':_0x21f37d},_0x188b36),_0x8b2e16=await _0x12c50f[_0x182760(0x146)]({'address':_0x32757d[_0x182760(0x157)],'abi':_0x7f37dd,'functionName':_0x182760(0x18c),'args':[_0x36edb0,_0x43d46a]});if((await _0x582d4a[_0x182760(0x177)]({'hash':_0x8b2e16}))[_0x182760(0x18f)]!=='success')throw new Error(_0x182760(0x154)+_0x8b2e16);const _0x3b26c7={'transactionHash':_0x8b2e16,'chainId':_0x188b36,'asset':_0x32757d['asset'],'spender':_0x36edb0,'amount':_0x38377e[_0x182760(0x184)],'amountAtomic':String(_0x43d46a)};_0xe47798(_0x38377e[_0x182760(0x196)]?_0x3b26c7:_0x182760(0x161)+_0x38377e[_0x182760(0x184)]+_0x182760(0x16e)+_0x92310a[_0x182760(0x175)][_0x182760(0x192)]+_0x182760(0x183)+_0x8b2e16,_0x38377e);});}export{J as registerWalletCommands};
|
|
1
|
+
import{erc20Abi as _0x533225,parseUnits as _0x1fdcd8}from'viem';import{confirmAction as _0x33c220,getRpcClients as _0x3fd8b9,print as _0x2c8cb6}from'../shared.mjs';import{loadPaymentConfig as _0x490d93}from'../lib/payments.mjs';import{selectedPaymentNetwork as _0x295ec9}from'../lib/payment-networks.mjs';import{walletInfo as _0x2cc6cb,saveLocalWallet as _0x409d9c,backupWallet as _0x5eb53b,restoreWallet as _0x4c6f31,walletFile as _0x1ab51d,listWallets as _0x5dd19e,selectWallet as _0x526e30}from'../lib/local-wallet.mjs';import{readPassword as _0x1d8192}from'../lib/password.mjs';import{walletStatus as _0x49b775}from'../lib/wallet-status.mjs';import{receiveWallet as _0x61022,receiveQr as _0x572f4e,saveReceiveQr as _0x318d9c}from'../lib/wallet-receive.mjs';async function v(){const _0x58a415=_0x38f2,_0x179994=await _0x1d8192(_0x58a415(0xdd));if(_0x179994!==await _0x1d8192(_0x58a415(0xcb)))throw new Error(_0x58a415(0xc0));return _0x179994;}function _0x38f2(_0x537c22,_0x1d2251){_0x537c22=_0x537c22-0xa8;const _0x38f22c=_0x1d22();let _0x3ed0bb=_0x38f22c[_0x537c22];return _0x3ed0bb;}function w(_0x191208,_0x1af2d5){const _0x13669f=_0x38f2;return'Wallet\x20ready:\x20'+_0x191208['address']+_0x13669f(0xcf)+_0x1ab51d(_0x1af2d5)+_0x13669f(0xf8);}function z(_0x205d86){const _0x22167b=_0x38f2;return _0x22167b(0xd3)+_0x205d86;}function _0x1d22(){const _0x97d13=['length','networks','asset','symbol','\x20\x20task\x20price:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20IMD\x20for\x20payment\x20on\x20','write','path','active','QR\x20saved:\x20','requiredOption','?\x0aWallet:\x20','padEnd','price','approve','map','chainId','\x20\x20IMD\x20authorization:\x20\x20','\x20IMD','status','require\x20this\x20wallet\x20address\x20for\x20the\x20authorization','file','configured','Authorize\x20','Passwords\x20do\x20not\x20match.','waitForTransactionReceipt','--wallet\x20<address>','Encrypted\x20backup\x20saved:\x20','\x20IMD\x20on\x20','command','address','\x0aKeep\x20your\x20wallet\x20password\x20separately.','select\x20a\x20saved\x20wallet','chainName','restore','Confirm\x20password','--out\x20<file>','use\x20<address>','\x20(current)','\x0aEncrypted\x20file:\x20','list','error','action','address:\x20','decimals','name','--amount\x20<amount>','json','list\x20saved\x20local\x20wallets\x20and\x20the\x20current\x20selection','save\x20an\x20SVG\x20QR\x20code\x20to\x20a\x20new\x20file','optsWithGlobals','Create\x20or\x20import\x20a\x20wallet\x20first.','\x20\x20(also\x20pays\x20gas)','Local\x20wallet\x20password\x20(at\x20least\x208\x20characters)','chain','token\x20amount\x20to\x20approve,\x20in\x20whole\x20tokens','import','key','amount','flatMap','allowance','success','option','api','create\x20a\x20new\x20password-encrypted\x20local\x20wallet','home','show\x20the\x20deposit\x20address\x20and\x20QR\x20code\x20(same\x20address\x20on\x20every\x20payment\x20network)','This\x20address\x20works\x20on\x20both\x20networks.\x20Accepted\x20coins:','authorize\x20an\x20exact\x20IMD\x20amount\x20on\x20--payment-chain\x20(default\x20ethereum)','Accepted\x20coins:','coins','show\x20balances\x20on\x20every\x20payment\x20network\x20(narrow\x20with\x20--payment-chain)','add\x20a\x20wallet\x20from\x20an\x20encrypted\x20backup\x20and\x20select\x20it','description','wallet','out','balance','Backup\x20password','join','\x0aThis\x20transaction\x20also\x20uses\x20ETH\x20for\x20network\x20fees.','\x0aBack\x20up\x20this\x20file\x20and\x20keep\x20your\x20password.\x20Both\x20are\x20needed\x20to\x20restore\x20your\x20wallet.\x0aRun\x20colony\x20wallet\x20receive\x20to\x20deposit\x20funds.','\x0aAsset:\x20','import\x20a\x20private\x20key\x20using\x20hidden\x20terminal\x20input','qrFile','--file\x20<file>','In\x20the\x20sending\x20wallet\x20or\x20exchange,\x20choose\x20the\x20network\x20you\x20plan\x20to\x20pay\x20on.\x20Funds\x20stay\x20on\x20that\x20network.'];_0x1d22=function(){return _0x97d13;};return _0x1d22();}function F(_0x1a0b41){const _0x42bb2d=_0x38f2;return _0x1a0b41[_0x42bb2d(0xd1)]?[_0x1a0b41[_0x42bb2d(0xc9)]+'\x20('+_0x1a0b41[_0x42bb2d(0xb8)]+')','\x20\x20balances\x20unavailable:\x20'+_0x1a0b41[_0x42bb2d(0xd1)]]:[_0x1a0b41['chainName']+'\x20('+_0x1a0b41[_0x42bb2d(0xb8)]+')',_0x42bb2d(0xac)+_0x1a0b41[_0x42bb2d(0xb5)]+_0x42bb2d(0xba),..._0x1a0b41['coins'][_0x42bb2d(0xb7)](_0x24b070=>'\x20\x20'+(_0x24b070[_0x42bb2d(0xab)]+':')[_0x42bb2d(0xb4)](0x13)+'\x20'+_0x24b070[_0x42bb2d(0xf4)]+(_0x24b070['symbol']==='ETH'?_0x42bb2d(0xdc):'')),_0x42bb2d(0xb9)+_0x1a0b41[_0x42bb2d(0xe4)]];}function M(_0x5f439b){const _0xc112f4=_0x38f2;return[_0xc112f4(0xd3)+_0x5f439b[_0xc112f4(0xc6)],'The\x20same\x20address\x20works\x20on\x20every\x20network\x20below.\x20Balances\x20are\x20separate\x20per\x20network.',..._0x5f439b[_0xc112f4(0xa9)][_0xc112f4(0xe3)](_0x1f6d87=>['',...F(_0x1f6d87)])][_0xc112f4(0xf6)]('\x0a');}function P(_0x517808){const _0x3b71f3=_0x38f2,_0x252f59=_0x517808[_0x3b71f3(0xa9)][_0x3b71f3(0xb7)](_0x4fb674=>'\x20\x20'+_0x4fb674[_0x3b71f3(0xc9)]+':\x20'+_0x4fb674[_0x3b71f3(0xee)][_0x3b71f3(0xf6)](',\x20'));return[_0x517808['networks'][_0x3b71f3(0xa8)]===0x1?'Receive\x20on\x20'+_0x517808[_0x3b71f3(0xc9)]:'Receive\x20funds',_0x517808['address'],_0x517808[_0x3b71f3(0xa9)]['length']===0x1?_0x3b71f3(0xed):_0x3b71f3(0xeb),..._0x252f59,_0x3b71f3(0xfd),'Also\x20send\x20a\x20little\x20ETH\x20on\x20the\x20same\x20network\x20for\x20gas\x20(network\x20fees).']['join']('\x0a');}function U(_0x23a0ab){const _0x579bd1=_0x38f2,_0x2a260f=_0x23a0ab['command'](_0x579bd1(0xf2))[_0x579bd1(0xf1)]('create,\x20import,\x20back\x20up\x20and\x20fund\x20your\x20local\x20wallet');_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xd0))[_0x579bd1(0xf1)](_0x579bd1(0xd8))['action']((_0x37e311,_0x20257c)=>{const _0x568c46=_0x579bd1,_0x2a4ce0=_0x20257c['optsWithGlobals'](),_0x2ec430=_0x5dd19e(_0x2a4ce0['home']);_0x2c8cb6(_0x2a4ce0[_0x568c46(0xd7)]?_0x2ec430:_0x2ec430['length']?_0x2ec430[_0x568c46(0xb7)](_0x5128ff=>(_0x5128ff[_0x568c46(0xb0)]?'*':'\x20')+'\x20'+_0x5128ff['address']+(_0x5128ff[_0x568c46(0xb0)]?_0x568c46(0xce):''))[_0x568c46(0xf6)]('\x0a'):'No\x20saved\x20wallets.\x20Create,\x20import\x20or\x20restore\x20one.',_0x2a4ce0);}),_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xcd))[_0x579bd1(0xf1)](_0x579bd1(0xc8))[_0x579bd1(0xd2)](async(_0x5a7fb0,_0x2837c1,_0x4b6a73)=>{const _0x43d30e=_0x579bd1,_0x3a7a40=_0x4b6a73['optsWithGlobals'](),_0x198bf8=await _0x526e30(_0x3a7a40[_0x43d30e(0xe9)],_0x5a7fb0);_0x2c8cb6(_0x3a7a40['json']?_0x198bf8:'Active\x20wallet:\x20'+_0x198bf8[_0x43d30e(0xc6)],_0x3a7a40);}),_0x2a260f['command']('create')[_0x579bd1(0xf1)](_0x579bd1(0xe8))[_0x579bd1(0xd2)](async(_0x27c094,_0x47fd31)=>{const _0x1618f8=_0x579bd1,_0x13747c=_0x47fd31[_0x1618f8(0xda)](),_0x4fad8c=await _0x409d9c(_0x13747c[_0x1618f8(0xe9)],_0x5dd19e(_0x13747c['home'])[_0x1618f8(0xa8)]?void 0x0:await v());_0x2c8cb6(_0x13747c[_0x1618f8(0xd7)]?_0x4fad8c:w(_0x4fad8c,_0x13747c[_0x1618f8(0xe9)]),_0x13747c);}),_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xe0))[_0x579bd1(0xf1)](_0x579bd1(0xfa))[_0x579bd1(0xd2)](async(_0xaab77f,_0x49c04b)=>{const _0x3abf73=_0x579bd1,_0x3225af=_0x49c04b[_0x3abf73(0xda)](),_0x30524c=await _0x1d8192('Private\x20key\x20(hidden)'),_0x3d61e9=await _0x409d9c(_0x3225af[_0x3abf73(0xe9)],_0x5dd19e(_0x3225af[_0x3abf73(0xe9)])[_0x3abf73(0xa8)]?void 0x0:await v(),_0x30524c);_0x2c8cb6(_0x3225af[_0x3abf73(0xd7)]?_0x3d61e9:w(_0x3d61e9,_0x3225af['home']),_0x3225af);}),_0x2a260f[_0x579bd1(0xc5)]('backup')[_0x579bd1(0xf1)]('copy\x20the\x20encrypted\x20wallet\x20file;\x20never\x20export\x20a\x20plaintext\x20key')[_0x579bd1(0xb2)](_0x579bd1(0xcc),'new\x20backup\x20file\x20path')[_0x579bd1(0xd2)](async(_0x26f520,_0x2cf2e0)=>{const _0x25312f=_0x579bd1,_0x330838=_0x2cf2e0[_0x25312f(0xda)](),_0x3fe297=await _0x5eb53b(_0x330838['home'],_0x330838['out']);_0x2c8cb6(_0x330838['json']?_0x3fe297:_0x25312f(0xc3)+_0x3fe297[_0x25312f(0xaf)]+_0x25312f(0xc7),_0x330838);}),_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xca))['description'](_0x579bd1(0xf0))['requiredOption'](_0x579bd1(0xfc),'encrypted\x20JSON\x20keystore\x20backup')[_0x579bd1(0xd2)](async(_0x5cd51a,_0x371449)=>{const _0x370473=_0x579bd1,_0x355450=_0x371449[_0x370473(0xda)](),_0x79edf0=await _0x4c6f31(_0x355450['home'],_0x355450[_0x370473(0xbd)],await _0x1d8192(_0x370473(0xf5)));_0x2c8cb6(_0x355450[_0x370473(0xd7)]?_0x79edf0:w(_0x79edf0,_0x355450[_0x370473(0xe9)]),_0x355450);}),_0x2a260f[_0x579bd1(0xc5)]('receive')['description'](_0x579bd1(0xea))[_0x579bd1(0xe6)]('--out\x20<file>',_0x579bd1(0xd9))[_0x579bd1(0xd2)](async(_0x3cf6d1,_0x5cc8e8)=>{const _0x55e0a0=_0x579bd1,_0x10cfea=_0x5cc8e8[_0x55e0a0(0xda)](),_0x3672a9=await _0x61022(_0x10cfea);if(_0x10cfea[_0x55e0a0(0xf3)]&&(_0x3672a9['qrFile']=(await _0x318d9c(_0x3672a9[_0x55e0a0(0xc6)],_0x10cfea[_0x55e0a0(0xf3)]))['path']),_0x10cfea[_0x55e0a0(0xd7)])return _0x2c8cb6(_0x3672a9,_0x10cfea);_0x2c8cb6(P(_0x3672a9),_0x10cfea),_0x3672a9[_0x55e0a0(0xfb)]?_0x2c8cb6(_0x55e0a0(0xb1)+_0x3672a9[_0x55e0a0(0xfb)],_0x10cfea):process['stdout'][_0x55e0a0(0xae)](await _0x572f4e(_0x3672a9[_0x55e0a0(0xc6)]));}),_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xc6))[_0x579bd1(0xf1)]('print\x20your\x20public\x20wallet\x20address\x20without\x20unlocking')[_0x579bd1(0xd2)]((_0x25a2dc,_0xfc6061)=>{const _0x40e557=_0x579bd1,_0x511b9b=_0xfc6061['optsWithGlobals'](),_0x1859b8=_0x2cc6cb(_0x511b9b);if(!_0x1859b8[_0x40e557(0xbe)])throw new Error(_0x40e557(0xdb));_0x2c8cb6(_0x511b9b[_0x40e557(0xd7)]?{'address':_0x1859b8[_0x40e557(0xc6)]}:z(_0x1859b8['address']),_0x511b9b);}),_0x2a260f['command'](_0x579bd1(0xbb))[_0x579bd1(0xf1)](_0x579bd1(0xef))['action'](async(_0x11e150,_0x66cee7)=>{const _0x35dc48=_0x579bd1,_0x1831ae=_0x66cee7[_0x35dc48(0xda)](),_0x450d10=await _0x49b775(_0x1831ae);_0x2c8cb6(_0x1831ae[_0x35dc48(0xd7)]?_0x450d10:M(_0x450d10),_0x1831ae);}),_0x2a260f[_0x579bd1(0xc5)](_0x579bd1(0xb6))[_0x579bd1(0xf1)](_0x579bd1(0xec))[_0x579bd1(0xb2)](_0x579bd1(0xd6),_0x579bd1(0xdf))[_0x579bd1(0xe6)](_0x579bd1(0xc2),_0x579bd1(0xbc))[_0x579bd1(0xd2)](async(_0x2eaf48,_0x24c918)=>{const _0x4b2ae6=_0x579bd1,_0x5e18fd=_0x24c918[_0x4b2ae6(0xda)](),_0x4ad3aa=_0x5e18fd['wallet']??_0x2cc6cb(_0x5e18fd)[_0x4b2ae6(0xc6)],_0x27b7f7=await _0x295ec9(_0x5e18fd),{payment:_0x33891c,chainId:_0x4f93db,spender:_0x2c3df7}=await _0x490d93(_0x5e18fd[_0x4b2ae6(0xe7)],'job.open',_0x27b7f7[_0x4b2ae6(0xe1)]),_0x4fc8fc=_0x1fdcd8(_0x5e18fd[_0x4b2ae6(0xe2)],_0x33891c[_0x4b2ae6(0xd4)]);if(_0x4fc8fc<=0x0n)throw new Error('--amount\x20must\x20be\x20greater\x20than\x20zero');await _0x33c220(_0x4b2ae6(0xbf)+_0x5e18fd[_0x4b2ae6(0xe2)]+_0x4b2ae6(0xad)+_0x27b7f7[_0x4b2ae6(0xde)][_0x4b2ae6(0xd5)]+_0x4b2ae6(0xb3)+_0x4ad3aa+_0x4b2ae6(0xf9)+_0x33891c['asset']+'\x0aSpender:\x20'+_0x2c3df7+_0x4b2ae6(0xf7),_0x5e18fd);const {publicClient:_0x1652f8,walletClient:_0x373cf8}=await _0x3fd8b9({..._0x5e18fd,'expectedWallet':_0x4ad3aa},_0x4f93db),_0x20cd82=await _0x373cf8['writeContract']({'address':_0x33891c['asset'],'abi':_0x533225,'functionName':_0x4b2ae6(0xb6),'args':[_0x2c3df7,_0x4fc8fc]});if((await _0x1652f8[_0x4b2ae6(0xc1)]({'hash':_0x20cd82}))[_0x4b2ae6(0xbb)]!==_0x4b2ae6(0xe5))throw new Error('approve\x20transaction\x20failed:\x20'+_0x20cd82);const _0x204d2f={'transactionHash':_0x20cd82,'chainId':_0x4f93db,'asset':_0x33891c[_0x4b2ae6(0xaa)],'spender':_0x2c3df7,'amount':_0x5e18fd[_0x4b2ae6(0xe2)],'amountAtomic':String(_0x4fc8fc)};_0x2c8cb6(_0x5e18fd['json']?_0x204d2f:'authorized\x20'+_0x5e18fd['amount']+_0x4b2ae6(0xc4)+_0x27b7f7[_0x4b2ae6(0xde)][_0x4b2ae6(0xd5)]+'\x0atx:\x20'+_0x20cd82,_0x5e18fd);});}export{U as registerWalletCommands};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mkdir as _0x662094,readdir as _0x2eb280,readFile as _0x86b4e6,rename as _0x28f4e0,rm as _0x8dc6df,writeFile as _0x4a70f1}from'node:fs/promises';import{randomUUID as _0x44fcde}from'node:crypto';import{join as _0x45bd89}from'node:path';import{loadOrder as _0x241e00}from'./orders.mjs';const c=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function i(_0x47ddf5,_0x409e7c){const _0xe4bd76=_0x1a0c;if(!c[_0xe4bd76(0x122)](_0x409e7c))throw new Error(_0xe4bd76(0x12a));return _0x45bd89(_0x47ddf5,_0xe4bd76(0x121),_0x409e7c+_0xe4bd76(0x12d));}function _0x5531(){const _0x4bf76a=['utf8','api','stringify','drafts','test','ENOENT','endsWith','map','parse','plan','code','slice','Invalid\x20draft\x20ID.','objective','all','.json','filter','.tmp'];_0x5531=function(){return _0x4bf76a;};return _0x5531();}async function O(_0x34b8b9,_0xa7c1ed){const _0x4a3f39=_0x1a0c,_0x155016=i(_0x34b8b9,_0xa7c1ed['id']),_0x4cd943=new Date()['toISOString'](),_0x20fffd={'id':_0xa7c1ed['id'],'api':_0xa7c1ed[_0x4a3f39(0x11f)],'objective':_0xa7c1ed[_0x4a3f39(0x12b)],'parent':_0xa7c1ed['parent']??null,..._0xa7c1ed[_0x4a3f39(0x127)]?{'plan':_0xa7c1ed['plan']}:{},'createdAt':_0xa7c1ed['createdAt']??_0x4cd943,'updatedAt':_0x4cd943};await _0x662094(_0x45bd89(_0x34b8b9,'drafts'),{'recursive':!0x0,'mode':0x1c0});const _0x3b367b=_0x45bd89(_0x34b8b9,_0x4a3f39(0x121),'.'+_0xa7c1ed['id']+'.'+_0x44fcde()+_0x4a3f39(0x12f));return await _0x4a70f1(_0x3b367b,JSON[_0x4a3f39(0x120)](_0x20fffd,null,0x2)+'\x0a',{'flag':'wx','mode':0x180}),await _0x28f4e0(_0x3b367b,_0x155016),_0x20fffd;}async function D(_0x322ef1,_0x55de34){const _0x2756f5=_0x1a0c;return JSON[_0x2756f5(0x126)](await _0x86b4e6(i(_0x322ef1,_0x55de34),_0x2756f5(0x11e)));}async function N(_0x183437,_0x5abe5d){return await _0x8dc6df(i(_0x183437,_0x5abe5d),{'force':!0x0}),{'id':_0x5abe5d};}function _0x1a0c(_0x4d5114,_0x55318e){_0x4d5114=_0x4d5114-0x11e;const _0x1a0cad=_0x5531();let _0xdbd38c=_0x1a0cad[_0x4d5114];return _0xdbd38c;}async function S(_0x1b6471){const _0x5642aa=_0x1a0c;let _0x379581;try{_0x379581=await _0x2eb280(_0x45bd89(_0x1b6471,_0x5642aa(0x121)));}catch(_0x3eb374){if(_0x3eb374[_0x5642aa(0x128)]===_0x5642aa(0x123))return[];throw _0x3eb374;}return(await Promise[_0x5642aa(0x12c)](_0x379581[_0x5642aa(0x12e)](_0xbf2279=>_0xbf2279[_0x5642aa(0x124)]('.json')&&c['test'](_0xbf2279[_0x5642aa(0x129)](0x0,-0x5)))[_0x5642aa(0x125)](async _0x3d4198=>{const _0x4fb058=_0x5642aa,_0x423963=_0x3d4198[_0x4fb058(0x129)](0x0,-0x5);return await _0x241e00(_0x1b6471,_0x423963)?null:D(_0x1b6471,_0x423963);})))[_0x5642aa(0x12e)](Boolean);}export{N as deleteDraft,S as listDrafts,D as loadDraft,O as saveDraft};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const _0x32fc2b=_0x4a81;function _0xb990(){const _0x44c03f=['Your\x20wallet:\x20',':\x20you\x20have\x20','balance','join','no\x20coin\x20available\x20right\x20now','\x20(enough)','error','required','map','\x20yet.\x20Add\x20funds,\x20then\x20check\x20again.','slice','Same\x20address\x20on\x20','\x20\x20You\x20have:\x20','Not\x20enough\x20funds\x20on\x20','IMD','Not\x20enough\x20funds\x20yet.\x20Add\x20funds\x20on\x20either\x20network,\x20then\x20check\x20again.','\x20·\x20','\x20(enough\x20for\x20gas)','\x20optional\x20support','replace','\x20and\x20','some','\x20\x20Plus\x20gas\x20(network\x20fee,\x20always\x20ETH):\x20','ETH\x20for\x20gas','\x20Amounts\x20are\x20estimates.','\x20or\x20','imd','support','\x20·\x20pay\x20with\x20','\x20·\x20task\x20price\x20','network','length','assign','\x20\x20Not\x20available\x20right\x20now:\x20','flatMap','\x20·\x20not\x20available\x20right\x20now','find','options','networks','nativeBalance','text','chain','funding_required','name','Pay\x20with\x20any\x20one:\x20','coin','shortages',':\x20no\x20exchange\x20route\x20now)','Payment,\x20any\x20one\x20of:\x20','ETH','reduce','chainName','filter','\x20for\x20gas,\x20then\x20pay\x20with\x20your\x20','sort','payment','option','gas','\x20·\x20gas\x20≈\x20','unavailable','.\x20Funds\x20stay\x20on\x20the\x20network\x20you\x20send\x20them\x20on.','amount','\x20·\x20need\x20','Quickest:\x20add\x20about\x20','\x20to\x20','high','price'];_0xb990=function(){return _0x44c03f;};return _0xb990();}import{coinAmount as _0x43312a,friendlyAmount as _0x17addf}from'./payment-coins.mjs';function _0x4a81(_0x313e8b,_0xb990bf){_0x313e8b=_0x313e8b-0x14b;const _0x4a81aa=_0xb990();let _0x2c418d=_0x4a81aa[_0x313e8b];return _0x2c418d;}import{PAYMENT_NETWORKS as _0x13d4d8,paymentNetwork as _0x53843f}from'./payment-networks.mjs';const d=_0x334ee6=>Object[_0x32fc2b(0x16b)](new Error(A(_0x334ee6)[_0x32fc2b(0x14e)]('\x0a')),{'code':_0x32fc2b(0x175),'funding':_0x334ee6});function O(_0x1ba345,_0x2f4292,_0x1b343a,_0x3f7f2a){const _0x4b1f83=_0x32fc2b,_0x58fc74=_0x53843f(_0x2f4292)[_0x4b1f83(0x174)][_0x4b1f83(0x176)],_0xcecfc7={'key':_0x2f4292,'chainName':_0x58fc74,'price':_0x3f7f2a?.[_0x4b1f83(0x18d)]??_0x3f7f2a?.[_0x4b1f83(0x165)],'support':_0x3f7f2a?.['support'],'nativeBalance':_0x3f7f2a?.['nativeBalance'],'options':_0x3f7f2a?[{..._0x3f7f2a,'funded':!0x1,'shortages':_0x1b343a}]:[],'shortages':_0x1b343a};return d({'address':_0x1ba345,'network':_0x2f4292,'chainName':_0x58fc74,'shortages':_0x1b343a,'networks':[_0xcecfc7]});}function w(_0x44cf50,_0xfe2f69){return d({'address':_0x44cf50,'networks':_0xfe2f69});}function b(_0x511b8f){const _0x5ba1ff=_0x32fc2b;return _0x511b8f[_0x5ba1ff(0x171)]??[{'key':_0x511b8f[_0x5ba1ff(0x169)],'chainName':_0x511b8f['chainName'],'options':[],'shortages':_0x511b8f[_0x5ba1ff(0x179)]??[]}];}const m=_0x407fc4=>BigInt(_0x407fc4[_0x32fc2b(0x152)])-BigInt(_0x407fc4['balance']),y=_0x4f6904=>(_0x4f6904*0xbn+0x9n)/0xan,u=_0x286ae1=>(_0x286ae1['options']??[])['filter'](_0x25853e=>!_0x25853e[_0x32fc2b(0x151)]&&_0x25853e[_0x32fc2b(0x182)]!==void 0x0);function p(_0x6dc605){const _0x228307=_0x32fc2b,_0x21add0=u(_0x6dc605)['map'](_0x29580f=>BigInt(_0x29580f[_0x228307(0x184)]));if(!_0x21add0['length'])return null;const _0x267d8e=_0x21add0['reduce']((_0x5eab13,_0x234796)=>_0x5eab13<_0x234796?_0x5eab13:_0x234796),_0x5c8531=_0x21add0[_0x228307(0x17d)]((_0x3946a3,_0x32182a)=>_0x3946a3>_0x32182a?_0x3946a3:_0x32182a),_0xd49d68=_0x17addf(_0x267d8e,'ETH',{'up':!0x0});return{'low':_0x267d8e,'high':_0x5c8531,'text':_0x267d8e===_0x5c8531?_0xd49d68:_0xd49d68[_0x228307(0x15e)](/ ETH$/,'')+_0x228307(0x18b)+_0x17addf(_0x5c8531,'ETH',{'up':!0x0})};}function E(_0x52d82d){const _0x1941f8=_0x32fc2b;return(_0x52d82d['coin']==='IMD'?'':'\u2248\x20')+_0x17addf(_0x52d82d[_0x1941f8(0x182)],_0x52d82d[_0x1941f8(0x178)],{'up':!0x0});}const l=_0x35e701=>_0x35e701!=null,T=_0x5975f2=>_0x5975f2['funded']||!_0x5975f2[_0x32fc2b(0x179)]?.[_0x32fc2b(0x160)](_0x1ca2ca=>_0x1ca2ca[_0x32fc2b(0x178)]===_0x5975f2['coin']);function B(_0x170346,_0x1dc314){const _0x4bc296=_0x32fc2b,_0x5063c2=u(_0x170346),_0x1323ea=_0x5063c2[_0x4bc296(0x17f)](_0x15fe5b=>_0x15fe5b[_0x4bc296(0x178)]!==_0x4bc296(0x17c)&&l(_0x15fe5b[_0x4bc296(0x14d)]))['map'](_0x208cc2=>_0x17addf(_0x208cc2[_0x4bc296(0x14d)],_0x208cc2[_0x4bc296(0x178)])+(T(_0x208cc2)?_0x4bc296(0x150):'')),_0x5d0e34=_0x5063c2[_0x4bc296(0x16f)](_0x50be9f=>_0x50be9f[_0x4bc296(0x178)]===_0x4bc296(0x17c)),_0x2fda6c=_0x170346[_0x4bc296(0x172)]??_0x5063c2[_0x4bc296(0x16f)](_0x229951=>l(_0x229951[_0x4bc296(0x172)]))?.[_0x4bc296(0x172)];if(l(_0x2fda6c)){let _0x2931ab='';_0x5d0e34&&T(_0x5d0e34)?_0x2931ab=_0x4bc296(0x150):_0x1dc314&&BigInt(_0x2fda6c)>=_0x1dc314[_0x4bc296(0x18c)]&&(_0x2931ab=_0x4bc296(0x15c)),_0x1323ea['push'](_0x17addf(_0x2fda6c,_0x4bc296(0x17c))+_0x2931ab);}return _0x1323ea[_0x4bc296(0x16a)]?_0x4bc296(0x157)+_0x1323ea[_0x4bc296(0x14e)](_0x4bc296(0x15b)):null;}function H(_0x4c7eb9){const _0x5b1d2c=_0x32fc2b,_0x3ce8fe=u(_0x4c7eb9)[_0x5b1d2c(0x17f)](_0x50dda5=>_0x50dda5[_0x5b1d2c(0x179)]?.[_0x5b1d2c(0x16a)]),_0x42b14f=_0x3ce8fe[_0x5b1d2c(0x17f)](_0x5626ef=>_0x5626ef[_0x5b1d2c(0x178)]!==_0x5b1d2c(0x17c)&&_0x5626ef[_0x5b1d2c(0x179)]['every'](_0x5f1fc2=>_0x5f1fc2[_0x5b1d2c(0x178)]===_0x5b1d2c(0x17c)))[_0x5b1d2c(0x153)](_0x5b88c4=>({'option':_0x5b88c4,'amount':m(_0x5b88c4['shortages'][0x0])}))[_0x5b1d2c(0x181)]((_0x22158e,_0x553c7c)=>_0x22158e[_0x5b1d2c(0x188)]<_0x553c7c[_0x5b1d2c(0x188)]?-0x1:_0x22158e[_0x5b1d2c(0x188)]>_0x553c7c['amount']?0x1:0x0);if(_0x42b14f[_0x5b1d2c(0x16a)])return _0x5b1d2c(0x18a)+_0x17addf(y(_0x42b14f[0x0]['amount']),_0x5b1d2c(0x17c),{'up':!0x0})+_0x5b1d2c(0x180)+_0x42b14f[0x0][_0x5b1d2c(0x183)][_0x5b1d2c(0x178)]+'.';const _0x5bb63e=_0x3ce8fe['find'](_0x492a9b=>_0x492a9b[_0x5b1d2c(0x178)]===_0x5b1d2c(0x17c))?.[_0x5b1d2c(0x179)][_0x5b1d2c(0x16f)](_0x204547=>_0x204547[_0x5b1d2c(0x178)]==='ETH');return _0x5bb63e?'Simplest:\x20send\x20about\x20'+_0x17addf(y(m(_0x5bb63e)),_0x5b1d2c(0x17c),{'up':!0x0})+',\x20which\x20covers\x20both\x20the\x20payment\x20and\x20gas.':null;}function I(_0x5a196f){const _0x16042f=_0x32fc2b,_0x779d=_0x5a196f['shortages'][_0x16042f(0x160)](_0x1aeee4=>_0x1aeee4[_0x16042f(0x178)]!=='ETH');return _0x5a196f[_0x16042f(0x179)][_0x16042f(0x153)](_0x2df836=>'\x20\x20'+(_0x2df836[_0x16042f(0x178)]==='ETH'&&_0x779d?_0x16042f(0x162):_0x2df836[_0x16042f(0x178)])+_0x16042f(0x14c)+_0x43312a(_0x2df836[_0x16042f(0x14d)],_0x2df836[_0x16042f(0x178)])+_0x16042f(0x189)+_0x43312a(_0x2df836[_0x16042f(0x152)],_0x2df836[_0x16042f(0x178)]));}function j(_0x4b3652){const _0x3821c7=_0x32fc2b,_0x367fa9=_0x4b3652[_0x3821c7(0x166)]&&BigInt(_0x4b3652['support'])>0x0n?'\x20+\x20'+_0x17addf(_0x4b3652[_0x3821c7(0x166)],_0x3821c7(0x159),{'up':!0x0})+_0x3821c7(0x15d):'',_0x2e0e25=_0x4b3652['chainName']['toUpperCase']()+(_0x4b3652[_0x3821c7(0x18d)]?_0x3821c7(0x168)+_0x17addf(_0x4b3652[_0x3821c7(0x18d)],_0x3821c7(0x159),{'up':!0x0})+_0x367fa9:'');if(_0x4b3652[_0x3821c7(0x151)])return[_0x2e0e25,_0x3821c7(0x16c)+_0x4b3652[_0x3821c7(0x151)]];const _0x1370b2=_0x4b3652[_0x3821c7(0x170)]??[];if(!_0x1370b2[_0x3821c7(0x16a)])return[_0x2e0e25,...I(_0x4b3652)];const _0x243724=u(_0x4b3652)[_0x3821c7(0x181)]((_0x4f27cc,_0xc22302)=>(_0x4f27cc['coin']===_0x3821c7(0x17c))-(_0xc22302[_0x3821c7(0x178)]===_0x3821c7(0x17c))),_0x4b5666=p(_0x4b3652),_0x5b645a=_0x1370b2[_0x3821c7(0x17f)](_0xce4bda=>_0xce4bda[_0x3821c7(0x151)])['map'](_0x54c86b=>_0x54c86b[_0x3821c7(0x178)]),_0x45b016=H(_0x4b3652),_0x1d61ec=B(_0x4b3652,_0x4b5666);return[_0x2e0e25,'\x20\x20'+(_0x243724[_0x3821c7(0x16a)]>0x1?_0x3821c7(0x177):'Pay:\x20')+(_0x243724[_0x3821c7(0x153)](E)[_0x3821c7(0x14e)](_0x3821c7(0x164))||_0x3821c7(0x14f))+(_0x5b645a[_0x3821c7(0x16a)]?'\x20('+_0x5b645a[_0x3821c7(0x14e)](',\x20')+_0x3821c7(0x17a):''),_0x3821c7(0x161)+(_0x4b5666?'\u2248\x20'+_0x4b5666[_0x3821c7(0x173)]:_0x3821c7(0x186)),..._0x1d61ec?[_0x1d61ec]:[],..._0x45b016?['\x20\x20'+_0x45b016]:[]];}function L(_0x5e8bb3){const _0x264e33=_0x32fc2b,_0x35c18f=u(_0x5e8bb3)['sort']((_0x553b97,_0x432f4f)=>(_0x553b97[_0x264e33(0x178)]==='ETH')-(_0x432f4f[_0x264e33(0x178)]==='ETH'));if(!_0x35c18f[_0x264e33(0x16a)])return[];const _0x776477=p(_0x5e8bb3),_0x11bd30=H(_0x5e8bb3);return[_0x264e33(0x17b)+_0x35c18f[_0x264e33(0x153)](E)[_0x264e33(0x14e)]('\x20or\x20'),'Gas,\x20always\x20ETH:\x20\u2248\x20'+_0x776477[_0x264e33(0x173)],..._0x11bd30?[_0x11bd30]:[]];}function R(_0x5b4138){const _0x4a9133=_0x32fc2b;if(_0x5b4138['error'])return _0x5b4138['chainName']+_0x4a9133(0x16e);const _0x16b0aa=(_0x5b4138[_0x4a9133(0x170)]??[])[_0x4a9133(0x17f)](_0x589cd3=>!_0x589cd3[_0x4a9133(0x151)])[_0x4a9133(0x153)](_0x4906cf=>_0x4906cf['coin']),_0x44a975=p(_0x5b4138),_0x51d090=_0x16b0aa['length']>0x1?_0x16b0aa[_0x4a9133(0x155)](0x0,-0x1)['join'](',\x20')+_0x4a9133(0x164)+_0x16b0aa['at'](-0x1):_0x16b0aa[0x0];return _0x5b4138[_0x4a9133(0x17e)]+(_0x51d090?_0x4a9133(0x167)+_0x51d090:'')+(_0x44a975?_0x4a9133(0x185)+_0x44a975[_0x4a9133(0x173)]:'');}function A(_0xf5429f){const _0x1f65ff=_0x32fc2b,_0x4a89a0=b(_0xf5429f),_0x4fc5d8=_0x13d4d8[_0x1f65ff(0x153)](_0xb0cd20=>_0xb0cd20[_0x1f65ff(0x174)][_0x1f65ff(0x176)])[_0x1f65ff(0x14e)](_0x1f65ff(0x15f));return[(_0x4a89a0[_0x1f65ff(0x16a)]>0x1?_0x1f65ff(0x15a):_0x1f65ff(0x158)+_0x4a89a0[0x0]['chainName']+_0x1f65ff(0x154))+_0x1f65ff(0x163),_0x1f65ff(0x14b)+_0xf5429f['address'],_0x1f65ff(0x156)+_0x4fc5d8+_0x1f65ff(0x187),..._0x4a89a0[_0x1f65ff(0x16d)](_0x430f80=>['',...j(_0x430f80)]),..._0x4a89a0[_0x1f65ff(0x160)](_0x38b9de=>_0x38b9de[_0x1f65ff(0x166)]&&BigInt(_0x38b9de[_0x1f65ff(0x166)])>0x0n)?['','Includes\x20the\x20optional\x2010%\x20support.\x20Choose\x20Original\x20price\x20when\x20asked\x20to\x20pay\x20only\x20the\x20task\x20price.']:[]];}export{A as fundingInstructions,b as fundingNetworks,O as fundingRequired,w as fundingRequiredOptions,R as networkChoiceLabel,j as networkLines,L as networkTargets,H as quickestFix};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{formatEther as _0x345c63}from'viem';import{coinAmount as _0x1a2b08,friendlyAmount as _0x54111c}from'./payment-coins.mjs';function c(_0x56acda){var _0x53ecf1=_0x353b;return{'coin':_0x56acda[_0x53ecf1(0x151)],'amount':_0x1a2b08(_0x56acda['amountIn'],_0x56acda[_0x53ecf1(0x151)]),'estimatedAmount':_0x56acda['quotedInput']===void 0x0?void 0x0:_0x1a2b08(_0x56acda[_0x53ecf1(0x159)],_0x56acda[_0x53ecf1(0x151)]),'minimumImd':_0x1a2b08(_0x56acda[_0x53ecf1(0x153)],'IMD'),'maximumDebit':_0x1a2b08(_0x56acda[_0x53ecf1(0x157)],_0x56acda[_0x53ecf1(0x151)]),'networkFeeCap':_0x345c63(BigInt(_0x56acda[_0x53ecf1(0x152)])),'display':{'payment':_0x54111c(_0x56acda['amountIn'],_0x56acda[_0x53ecf1(0x151)],{'up':!0x0}),..._0x56acda[_0x53ecf1(0x159)]===void 0x0?{}:{'estimate':_0x54111c(_0x56acda[_0x53ecf1(0x159)],_0x56acda[_0x53ecf1(0x151)],{'up':!0x0})},'gas':_0x54111c(_0x56acda[_0x53ecf1(0x152)],_0x53ecf1(0x154),{'up':!0x0}),'maximumDebit':_0x54111c(_0x56acda[_0x53ecf1(0x157)],_0x56acda['coin'],{'up':!0x0})},'converted':_0x56acda['steps'][_0x53ecf1(0x155)](_0x3a3399=>_0x3a3399[_0x53ecf1(0x15a)]===_0x53ecf1(0x158)&&_0x3a3399[_0x53ecf1(0x15b)]===_0x53ecf1(0x156))&&!_0x56acda[_0x53ecf1(0x15c)][_0x53ecf1(0x155)](_0x525fa5=>_0x525fa5[_0x53ecf1(0x15a)]===_0x53ecf1(0x158)&&_0x525fa5[_0x53ecf1(0x15b)]!==_0x53ecf1(0x156)),'steps':_0x56acda['steps'][_0x53ecf1(0x150)](({kind:_0x13e04a,hash:_0x3b2a93,confirmedHash:_0x3618d7,status:_0x14c403})=>({'kind':_0x13e04a,'hash':_0x3618d7??_0x3b2a93,'status':_0x14c403}))};}function _0x353b(_0x12a765,_0x3d4e1a){_0x12a765=_0x12a765-0x150;var _0x353b47=_0x3d4e();var _0x455953=_0x353b47[_0x12a765];return _0x455953;}function _0x3d4e(){var _0x437126=['map','coin','feeCap','minimumOut','ETH','some','confirmed','maximumDebit','swap','quotedInput','kind','status','steps'];_0x3d4e=function(){return _0x437126;};return _0x3d4e();}export{c as fundingSummary};
|
package/dist/lib/funding.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x17641c=_0x4db2;function _0x4db2(_0x5f4f9a,_0x4d859b){_0x5f4f9a=_0x5f4f9a-0x66;const _0x4db2ea=_0x4d85();let _0xf3ab6e=_0x4db2ea[_0x5f4f9a];return _0xf3ab6e;}import{decodeFunctionData as _0x21f518,encodeFunctionData as _0x4b2cc2,erc20Abi as _0x1f875f,EstimateGasExecutionError as _0xbb9c6,formatEther as _0x263337,keccak256 as _0x1396e2}from'viem';import{getPublicRpcClient as _0x5f117b,getRpcClients as _0x45e0f7,getSigner as _0x124c1c}from'../shared.mjs';import{paymentCoin as _0x4e0217}from'./payment-coins.mjs';import{paymentNetwork as _0x4b25c4}from'./payment-networks.mjs';import{assertQuotePayment as _0x2fc045,orderPayment as _0x194cc3,loadPaymentConfig as _0x16ca6e}from'./payments.mjs';import{assertOrderNotCancelled as _0x2949f8,findOrder as _0x5aa9d4,saveOrder as _0x22cdc2}from'./orders.mjs';import{quoteSwap as _0x45bbd6,buildSwap as _0x377971,UNISWAP as _0x1604fc,APPROVAL_GAS as _0x4a908b,SWAP_ABI as _0x9085fe}from'./swaps.mjs';import{submitTransaction as _0x5c5117}from'./transactions.mjs';import{fundingRequired as _0x3f65d0}from'./funding-error.mjs';import{walletInfo as _0x21ddb0}from'./local-wallet.mjs';import{transactionFees as _0x439569,reviewedFees as _0x2b0c27}from'./transaction-fees.mjs';function _0x4d85(){const _0x2ff278=['.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.','The\x20saved\x20swap\x20has\x20finished,\x20but\x20this\x20wallet\x20no\x20longer\x20has\x20enough\x20IMD.\x20No\x20additional\x20swap\x20was\x20made.','The\x20token\x20authorization','coin\x20conversion','checking_funds','Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.','prepareTransactionRequest','gas','replacementNonce','hash','readContract','kind','paymentReview','amountIn','spender','address','success','ETH','account','signTransaction','toLowerCase','...','api','estimateGas','maxFeePerGas','router','quote','IMD','Checking\x20balances,\x20current\x20exchange\x20rate\x20and\x20network\x20fees...','asset','Required\x20network\x20fees\x20exceed\x20the\x20reviewed\x20cap.\x20No\x20new\x20transaction\x20was\x20signed.','status','Preparing\x20','reset_source_allowance','requestKey','filter','swap','funding','symbol','value','signed','signal','slippageBps','amount','action','steps','payment_review_expired','expectedWallet','reverted','.\x20Your\x20order\x20was\x20not\x20paid.','recipient','optional\x20support\x20transfer','approve','signing','\x20transaction\x20reverted:\x20','support','min','ready','transactionHash','transfer','amountOut','USDT','payWith','\x20cannot\x20currently\x20execute.\x20No\x20new\x20transaction\x20was\x20signed.\x20Any\x20completed\x20steps\x20remain\x20saved\x20in\x20this\x20order.','token\x20authorization','pendingTransaction','chain','floor','throwIfAborted','expiresAt','payment','feeCap','assign','The\x20','robinhood','args','confirmed','configured','confirmedHash','reduce','quotedInput','home','push','rawTransaction','ethereum','data','paymentChain','approve_source','now','all','balanceOf','IMD\x20payment\x20asset\x20differs\x20from\x20the\x20selected\x20network.'];_0x4d85=function(){return _0x2ff278;};return _0x4d85();}import{resumeTransaction as _0x1295f6,recoveryNonce as _0x1fedbd,retireExpiredSwap as _0x4372fa}from'./transaction-recovery.mjs';const he=0x7a120n,A=(_0x53bc5d,_0x991c64,_0x3ec0fd)=>_0x53bc5d[_0x17641c(0x70)]({'address':_0x991c64,'abi':_0x1f875f,'functionName':_0x17641c(0xc0),'args':[_0x3ec0fd]}),Y=(_0x279838,_0x246b0c,_0x119428,_0x2183c7)=>_0x279838[_0x17641c(0x70)]({'address':_0x246b0c,'abi':_0x1f875f,'functionName':'allowance','args':[_0x119428,_0x2183c7]}),R=(_0x325f5a,_0x20a950,_0x31faeb,_0x337cc1)=>({'kind':_0x325f5a,'to':_0x20a950,'value':'0','gas':String(_0x4a908b),'data':_0x4b2cc2({'abi':_0x1f875f,'functionName':_0x17641c(0x9a),'args':[_0x31faeb,_0x337cc1]})});async function ge(_0x92d27f,_0x55f477,_0x411e5e,_0x4fbc79,_0x5e0c7c){const _0x2e5c65=_0x17641c,_0x99ebc5=_0x92d27f[_0x2e5c65(0xbc)]??_0x2e5c65(0xba),_0x3498fb=_0x4e0217(_0x99ebc5,_0x92d27f[_0x2e5c65(0xa4)]),_0x277f16=_0x5e0c7c??await _0x16ca6e(_0x55f477[_0x2e5c65(0x7c)],_0x92d27f[_0x2e5c65(0x92)],_0x99ebc5,_0x55f477),_0x3838e3=_0x5e0c7c?_0x5e0c7c[_0x2e5c65(0xac)]:_0x194cc3(_0x92d27f);if(_0x2fc045(_0x3838e3),_0x3838e3[_0x2e5c65(0x83)][_0x2e5c65(0x7a)]()!==_0x277f16['payment'][_0x2e5c65(0x83)]['toLowerCase']())throw new Error(_0x2e5c65(0xc1));const _0x1528ca=BigInt(_0x3838e3[_0x2e5c65(0x91)]),[_0x5dda6f,_0x58e249,_0x1e912f]=await Promise[_0x2e5c65(0xbf)]([Y(_0x411e5e,_0x3838e3['asset'],_0x4fbc79[_0x2e5c65(0x75)],_0x277f16[_0x2e5c65(0x74)]),_0x411e5e['getBalance']({'address':_0x4fbc79[_0x2e5c65(0x75)]}),_0x439569(_0x411e5e,_0x4b25c4(_0x99ebc5)[_0x2e5c65(0xa8)]['id'])]),_0x5893f6=(_0x92d27f[_0x2e5c65(0x8b)]?.['steps']??[])[_0x2e5c65(0x89)](_0x4cab0c=>_0x4cab0c[_0x2e5c65(0x85)]===_0x2e5c65(0xb2));let _0x165f6a=0x0n,_0x1ef6bf=0x0n;for(const _0x33a10d of _0x5893f6)if(_0x33a10d[_0x2e5c65(0x71)]==='swap'){const _0x565c7f=_0x21f518({'abi':_0x9085fe,'data':_0x33a10d['data']});_0x165f6a+=_0x21f518({'abi':_0x9085fe,'data':_0x565c7f[_0x2e5c65(0xb1)][0x1][0x0]})[_0x2e5c65(0xb1)][0x0][_0x2e5c65(0xa2)];}else _0x33a10d[_0x2e5c65(0x71)]===_0x2e5c65(0x9d)&&(_0x1ef6bf+=_0x21f518({'abi':_0x1f875f,'data':_0x33a10d[_0x2e5c65(0xbb)]})[_0x2e5c65(0xb1)][0x1]);const _0x4a9915=BigInt(_0x92d27f[_0x2e5c65(0x9d)]?.[_0x2e5c65(0x91)]??0x0)-_0x1ef6bf,_0x399392=_0x1528ca+_0x4a9915,_0x524262=_0x1604fc[_0x99ebc5][_0x2e5c65(0x7f)],_0xd9e597=_0x99ebc5===_0x2e5c65(0xb0)?he:0x0n,_0x5e84bf=_0x4a9915>0x0n?0x186a0n:0x0n,_0x1d871b=_0xd9e597+_0x5e84bf+(_0x5dda6f<_0x1528ca?_0x4a908b:0x0n),_0x119ec2=[],_0x5cc99c=[];let _0x58be73;const _0x21b60e=Math[_0x2e5c65(0x9e)](Number(_0x92d27f[_0x2e5c65(0x80)]['expiresAt']),Math[_0x2e5c65(0xa9)](Date[_0x2e5c65(0xbe)]()/0x3e8)+0x12c);if(_0x3498fb['symbol']===_0x2e5c65(0x81)){const _0x5aeb87=await A(_0x411e5e,_0x3838e3[_0x2e5c65(0x83)],_0x4fbc79[_0x2e5c65(0x75)]);_0x5aeb87<_0x399392&&_0x5cc99c[_0x2e5c65(0xb8)]({'coin':_0x2e5c65(0x81),'balance':String(_0x5aeb87),'required':String(_0x399392)});}const _0x1c583c=_0x165f6a>_0x1ef6bf?_0x165f6a-_0x1ef6bf:0x0n,_0x1712d9=_0x399392>_0x1c583c?_0x399392-_0x1c583c:0x0n;if(_0x1c583c>0x0n){const _0x536c48=await A(_0x411e5e,_0x3838e3[_0x2e5c65(0x83)],_0x4fbc79['address']),_0x2fb5b1=_0x399392<_0x1c583c?_0x399392:_0x1c583c;_0x536c48<_0x2fb5b1&&_0x5cc99c[_0x2e5c65(0xb8)]({'coin':_0x2e5c65(0x81),'balance':String(_0x536c48),'required':String(_0x2fb5b1)});}if(_0x3498fb[_0x2e5c65(0x8c)]!==_0x2e5c65(0x81)&&_0x1712d9>0x0n){const _0x287331=_0x3498fb[_0x2e5c65(0x8c)]===_0x2e5c65(0x77)?0x0n:await Y(_0x411e5e,_0x3498fb[_0x2e5c65(0x75)],_0x4fbc79[_0x2e5c65(0x75)],_0x524262);_0x58be73=await _0x45bbd6(_0x99ebc5,_0x3498fb,_0x1712d9,{'client':_0x411e5e,'maxFeePerGas':_0x1e912f[_0x2e5c65(0x7e)],'sourceAllowance':_0x287331,'fixedGas':_0x1d871b,'signal':_0x55f477[_0x2e5c65(0x8f)]});const _0x42c9bf=BigInt(_0x58be73[_0x2e5c65(0x73)]);if(_0x3498fb[_0x2e5c65(0x8c)]!==_0x2e5c65(0x77)){const _0x49ca33=await A(_0x411e5e,_0x3498fb[_0x2e5c65(0x75)],_0x4fbc79[_0x2e5c65(0x75)]),_0x4e3e6a=_0x287331;_0x49ca33<_0x42c9bf&&_0x5cc99c[_0x2e5c65(0xb8)]({'coin':_0x3498fb[_0x2e5c65(0x8c)],'balance':String(_0x49ca33),'required':String(_0x42c9bf)}),_0x4e3e6a<_0x42c9bf&&(_0x3498fb[_0x2e5c65(0x8c)]===_0x2e5c65(0xa3)&&_0x4e3e6a>0x0n&&_0x119ec2[_0x2e5c65(0xb8)](R(_0x2e5c65(0x87),_0x3498fb['address'],_0x524262,0x0n)),_0x119ec2[_0x2e5c65(0xb8)](R(_0x2e5c65(0xbd),_0x3498fb[_0x2e5c65(0x75)],_0x524262,_0x42c9bf)));}const _0x55fda1=_0x377971(_0x99ebc5,_0x3498fb,_0x58be73,_0x1712d9,_0x4fbc79[_0x2e5c65(0x75)],_0x21b60e);_0x119ec2[_0x2e5c65(0xb8)]({'kind':_0x2e5c65(0x8a),..._0x55fda1,'gas':String(_0x58be73[_0x2e5c65(0x6d)]),'expiresAt':_0x21b60e});}_0x5dda6f<_0x1528ca&&_0x119ec2['push'](R('approve_imd',_0x3838e3['asset'],_0x277f16[_0x2e5c65(0x74)],_0x1528ca)),_0x4a9915>0x0n&&_0x119ec2[_0x2e5c65(0xb8)]({'kind':_0x2e5c65(0x9d),'to':_0x3838e3[_0x2e5c65(0x83)],'value':'0','gas':String(_0x5e84bf),'data':_0x4b2cc2({'abi':_0x1f875f,'functionName':_0x2e5c65(0xa1),'args':[_0x92d27f[_0x2e5c65(0x9d)][_0x2e5c65(0x98)],_0x4a9915]})});const _0x114e25=_0x119ec2[_0x2e5c65(0xb5)]((_0x49c2dd,_0x23499c)=>_0x49c2dd+BigInt(_0x23499c[_0x2e5c65(0x6d)]),_0xd9e597)*_0x1e912f[_0x2e5c65(0x7e)],_0x3bc291=_0x3498fb[_0x2e5c65(0x8c)]===_0x2e5c65(0x81)?_0x399392:BigInt(_0x58be73?.[_0x2e5c65(0x73)]??0x0),_0x2ad8de=_0x3bc291+(_0x3498fb[_0x2e5c65(0x8c)]==='ETH'?_0x114e25:0x0n),_0x34d8b3=_0x114e25+(_0x3498fb[_0x2e5c65(0x8c)]==='ETH'?_0x3bc291:0x0n);if(_0x58e249<_0x34d8b3&&_0x5cc99c['push']({'coin':_0x2e5c65(0x77),'balance':String(_0x58e249),'required':String(_0x34d8b3)}),_0x5cc99c['length'])throw _0x3f65d0(_0x4fbc79['address'],_0x99ebc5,_0x5cc99c);return{'chainId':_0x4b25c4(_0x99ebc5)[_0x2e5c65(0xa8)]['id'],'account':_0x4fbc79['address'],'coin':_0x3498fb[_0x2e5c65(0x8c)],'amountIn':String(_0x3bc291),'minimumOut':String(_0x399392),'maximumDebit':String(_0x2ad8de),'quotedInput':String(_0x3498fb['symbol']===_0x2e5c65(0x81)?_0x399392:_0x58be73?.[_0x2e5c65(0xb6)]??0x0),..._0x58be73?{'slippageBps':_0x58be73[_0x2e5c65(0x90)]}:{},'feeCap':String(_0x114e25),'maxFeePerGas':String(_0x1e912f[_0x2e5c65(0x7e)]),'maxPriorityFeePerGas':String(_0x1e912f['maxPriorityFeePerGas']),'paymentGas':String(_0xd9e597),'expiresAt':_0x21b60e,'steps':[..._0x5893f6,..._0x119ec2]};}async function Ne(_0x7e2039,_0x32e3bd,_0x5a8654){const _0x5bfa80=_0x17641c,_0x2a8b58=_0x4b25c4(_0x7e2039[_0x5bfa80(0xbc)]??_0x5bfa80(0xba))['chain']['id'],_0x153c72=_0x21ddb0(_0x32e3bd);if(!_0x153c72[_0x5bfa80(0xb3)])throw new Error('Create\x20or\x20import\x20a\x20wallet\x20in\x20Wallets\x20before\x20paying.');if(_0x32e3bd[_0x5bfa80(0x95)]&&_0x32e3bd[_0x5bfa80(0x95)][_0x5bfa80(0x7a)]()!==_0x153c72['address'][_0x5bfa80(0x7a)]())throw new Error('Payment\x20wallet\x20changed.\x20Review\x20this\x20task\x20with\x20the\x20selected\x20wallet\x20before\x20paying.');const _0x5c61c7=await _0x5f117b(_0x32e3bd,_0x2a8b58);if(_0x7e2039[_0x5bfa80(0x8b)]&&_0x7e2039[_0x5bfa80(0x8b)][_0x5bfa80(0x78)][_0x5bfa80(0x7a)]()!==_0x153c72[_0x5bfa80(0x75)][_0x5bfa80(0x7a)]())throw new Error('Resume\x20funding\x20with\x20the\x20same\x20wallet\x20that\x20started\x20this\x20order.');for(const _0x1bfd8f of _0x7e2039[_0x5bfa80(0x8b)]?.[_0x5bfa80(0x93)]??[]){if(_0x1bfd8f[_0x5bfa80(0xb9)]&&_0x1bfd8f[_0x5bfa80(0x85)]!==_0x5bfa80(0xb2)&&await _0x4372fa(_0x7e2039,_0x1bfd8f,_0x5c61c7,_0x32e3bd))continue;if(_0x1bfd8f[_0x5bfa80(0x85)]==='reverted')throw new Error(_0x5bfa80(0xaf)+_0x1bfd8f[_0x5bfa80(0x71)]+_0x5bfa80(0x9c)+_0x1bfd8f[_0x5bfa80(0x6f)]+_0x5bfa80(0x66));if(!_0x1bfd8f[_0x5bfa80(0xb9)]||_0x1bfd8f[_0x5bfa80(0x85)]===_0x5bfa80(0xb2))continue;const _0xa3071b=await _0x1295f6(_0x7e2039,_0x1bfd8f,_0x5c61c7,_0x32e3bd);if(_0x1bfd8f['status']=_0xa3071b[_0x5bfa80(0x85)]===_0x5bfa80(0x76)?_0x5bfa80(0xb2):_0x5bfa80(0x96),_0x1bfd8f[_0x5bfa80(0xb4)]=_0xa3071b[_0x5bfa80(0xa0)],delete _0x7e2039['pendingTransaction'],await _0x22cdc2(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039),_0x1bfd8f[_0x5bfa80(0x85)]===_0x5bfa80(0x96))throw new Error(_0x5bfa80(0xaf)+_0x1bfd8f[_0x5bfa80(0x71)]+_0x5bfa80(0x9c)+_0x1bfd8f['hash']+_0x5bfa80(0x66));}_0x32e3bd['onProgress']?.({'phase':_0x5bfa80(0x6a),'message':_0x5bfa80(0x82)}),_0x7e2039[_0x5bfa80(0x8b)]=await ge(_0x7e2039,_0x32e3bd,_0x5c61c7,_0x153c72);const _0x204f49=_0x7e2039[_0x5bfa80(0x8b)];_0x7e2039[_0x5bfa80(0x72)]={'networkFeeCap':_0x263337(BigInt(_0x204f49[_0x5bfa80(0xad)]))},await _0x5a8654(_0x7e2039),_0x32e3bd[_0x5bfa80(0x8f)]?.[_0x5bfa80(0xaa)](),_0x2949f8(await _0x5aa9d4(_0x32e3bd['home'],_0x7e2039[_0x5bfa80(0x88)])),await _0x22cdc2(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039);const {walletClient:_0x1584e2,account:_0x3ba84e}=await _0x45e0f7({..._0x32e3bd,'expectedWallet':_0x153c72[_0x5bfa80(0x75)]},_0x2a8b58);if(_0x32e3bd[_0x5bfa80(0x8f)]?.[_0x5bfa80(0xaa)](),_0x2949f8(await _0x5aa9d4(_0x32e3bd['home'],_0x7e2039[_0x5bfa80(0x88)])),_0x204f49['expiresAt']*0x3e8<=Date[_0x5bfa80(0xbe)]())throw Object[_0x5bfa80(0xae)](new Error(_0x5bfa80(0x6b)),{'code':_0x5bfa80(0x94)});for(const _0x40fd10 of _0x204f49[_0x5bfa80(0x93)]){if(_0x40fd10[_0x5bfa80(0x85)]===_0x5bfa80(0xb2))continue;if(_0x40fd10['status']===_0x5bfa80(0x96))throw new Error(_0x5bfa80(0xaf)+_0x40fd10[_0x5bfa80(0x71)]+_0x5bfa80(0x9c)+_0x40fd10[_0x5bfa80(0x6f)]+_0x5bfa80(0x66));if(!_0x40fd10[_0x5bfa80(0xb9)]){if(_0x204f49[_0x5bfa80(0xab)]*0x3e8<=Date[_0x5bfa80(0xbe)]())throw Object[_0x5bfa80(0xae)](new Error('Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.'),{'code':_0x5bfa80(0x94)});const _0x428bf7=_0x2b0c27(await _0x439569(_0x5c61c7,_0x2a8b58),_0x204f49);_0x32e3bd['onProgress']?.({'phase':_0x5bfa80(0x9b),'message':_0x5bfa80(0x86)+(_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x8a)?_0x5bfa80(0x69):_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x9d)?_0x5bfa80(0x99):_0x5bfa80(0xa6))+_0x5bfa80(0x7b)});const _0x51d69a={'account':_0x3ba84e,'to':_0x40fd10['to'],'data':_0x40fd10[_0x5bfa80(0xbb)],'value':BigInt(_0x40fd10[_0x5bfa80(0x8d)]),..._0x428bf7};let _0x5ee10b;try{_0x5ee10b=await _0x5c61c7[_0x5bfa80(0x7d)](_0x51d69a);}catch(_0x25c4af){throw _0x25c4af instanceof _0xbb9c6?new Error((_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x8a)?'The\x20swap\x20quote':_0x40fd10[_0x5bfa80(0x71)]===_0x5bfa80(0x9d)?'The\x20support\x20transfer':_0x5bfa80(0x68))+_0x5bfa80(0xa5),{'cause':_0x25c4af}):_0x25c4af;}if(_0x5ee10b>BigInt(_0x40fd10[_0x5bfa80(0x6d)]))throw new Error(_0x5bfa80(0x84));const _0x1cb71f=await _0x1584e2[_0x5bfa80(0x6c)]({..._0x51d69a,'gas':BigInt(_0x40fd10['gas']),'nonce':await _0x1fedbd(_0x7e2039,_0x5c61c7,_0x3ba84e[_0x5bfa80(0x75)])});if(await _0x124c1c({..._0x32e3bd,'expectedWallet':_0x3ba84e['address']}),_0x32e3bd[_0x5bfa80(0x8f)]?.[_0x5bfa80(0xaa)](),_0x2949f8(await _0x5aa9d4(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039[_0x5bfa80(0x88)])),_0x204f49[_0x5bfa80(0xab)]*0x3e8<=Date['now']())throw Object[_0x5bfa80(0xae)](new Error('Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.'),{'code':_0x5bfa80(0x94)});Object[_0x5bfa80(0xae)](_0x1cb71f,_0x2b0c27(await _0x439569(_0x5c61c7,_0x2a8b58),_0x204f49)),_0x40fd10[_0x5bfa80(0xb9)]=await _0x1584e2[_0x5bfa80(0x79)](_0x1cb71f),_0x40fd10[_0x5bfa80(0x6f)]=_0x1396e2(_0x40fd10[_0x5bfa80(0xb9)]),_0x40fd10[_0x5bfa80(0x85)]=_0x5bfa80(0x8e),delete _0x7e2039[_0x5bfa80(0x6e)],_0x7e2039['status']=_0x5bfa80(0x8b),await _0x22cdc2(_0x32e3bd['home'],_0x7e2039);}const _0x1d03e0=await _0x5c5117(_0x5c61c7,_0x40fd10,_0x32e3bd);if(_0x40fd10['status']=_0x1d03e0['status']===_0x5bfa80(0x76)?_0x5bfa80(0xb2):_0x5bfa80(0x96),_0x40fd10[_0x5bfa80(0xb4)]=_0x1d03e0[_0x5bfa80(0xa0)],delete _0x7e2039[_0x5bfa80(0xa7)],await _0x22cdc2(_0x32e3bd['home'],_0x7e2039),_0x40fd10['status']===_0x5bfa80(0x96))throw new Error(_0x5bfa80(0xaf)+_0x40fd10[_0x5bfa80(0x71)]+'\x20transaction\x20reverted:\x20'+_0x40fd10['hash']+_0x5bfa80(0x97));}const _0x47d8ae=_0x194cc3(_0x7e2039);if(await A(_0x5c61c7,_0x47d8ae['asset'],_0x3ba84e[_0x5bfa80(0x75)])<BigInt(_0x47d8ae[_0x5bfa80(0x91)]))throw new Error(_0x5bfa80(0x67));_0x2949f8(await _0x5aa9d4(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039[_0x5bfa80(0x88)])),_0x204f49[_0x5bfa80(0x85)]=_0x5bfa80(0x9f),await _0x22cdc2(_0x32e3bd[_0x5bfa80(0xb7)],_0x7e2039);}export{Ne as fundOrder,ge as prepareFunding};
|
|
1
|
+
const _0x35fbd5=_0x4783;function _0x14da(){const _0x4d5746=['pendingTransaction','payment_review_expired','hash','onProgress','feeCap','chain','robinhood','spender','prepareTransactionRequest','.\x20Your\x20order\x20was\x20not\x20paid.','ready','The\x20support\x20transfer','status','gas','coin\x20conversion','min','...','paymentChain','signTransaction','maxPriorityFeePerGas','value','transfer','assign','payment','amountOut','slippageBps','quotedInput','signed','Required\x20network\x20fees\x20exceed\x20the\x20reviewed\x20cap.\x20No\x20new\x20transaction\x20was\x20signed.','The\x20','\x20transaction\x20reverted:\x20','confirmedHash','args','The\x20token\x20authorization','IMD\x20payment\x20asset\x20differs\x20from\x20the\x20selected\x20network.','Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.','length','throwIfAborted','optional\x20support\x20transfer','Preparing\x20','approve_imd','home','ETH','signal','approve','action','all','Payment\x20wallet\x20changed.\x20Review\x20this\x20task\x20with\x20the\x20selected\x20wallet\x20before\x20paying.','quote','expiresAt','success','push','configured','maxFeePerGas','expectedWallet','now','symbol','ethereum','Checking\x20balances,\x20current\x20exchange\x20rate\x20and\x20network\x20fees...','IMD','The\x20saved\x20swap\x20has\x20finished,\x20but\x20this\x20wallet\x20no\x20longer\x20has\x20enough\x20IMD.\x20No\x20additional\x20swap\x20was\x20made.','reverted','getBalance','.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.','USDT','rawTransaction','requestKey','swap','approve_source','transactionHash','funding','confirmed','asset','toLowerCase','floor','router','filter','amount','support','kind','reset_source_allowance','amountIn','The\x20swap\x20quote','replacementNonce','signing','address','data','api','steps','\x20cannot\x20currently\x20execute.\x20No\x20new\x20transaction\x20was\x20signed.\x20Any\x20completed\x20steps\x20remain\x20saved\x20in\x20this\x20order.'];_0x14da=function(){return _0x4d5746;};return _0x14da();}import{decodeFunctionData as _0xea4bc7,encodeFunctionData as _0x147fc7,erc20Abi as _0x1c44ef,EstimateGasExecutionError as _0x1ae311,formatEther as _0x6f11b2,keccak256 as _0x2007a7}from'viem';import{getPublicRpcClient as _0x581e7d,getRpcClients as _0x24e488,getSigner as _0xa34bba}from'../shared.mjs';import{paymentCoin as _0x1b1ff1}from'./payment-coins.mjs';import{paymentNetwork as _0x2de524}from'./payment-networks.mjs';import{assertQuotePayment as _0x1a9fc8,orderPayment as _0x11416a,loadPaymentConfig as _0x2dfc5d}from'./payments.mjs';import{assertOrderNotCancelled as _0x212344,findOrder as _0x2cfba5,saveOrder as _0x25ac23}from'./orders.mjs';import{quoteSwap as _0x1c9820,buildSwap as _0x9ab358,UNISWAP as _0x1bd057,APPROVAL_GAS as _0x8abe36,SWAP_ABI as _0x16cc0b}from'./swaps.mjs';import{submitTransaction as _0x5adafa}from'./transactions.mjs';import{fundingRequired as _0x5004bb}from'./funding-error.mjs';import{walletInfo as _0x36db5d}from'./local-wallet.mjs';function _0x4783(_0x29a36d,_0x14da17){_0x29a36d=_0x29a36d-0x1dd;const _0x4783bd=_0x14da();let _0x31bdac=_0x4783bd[_0x29a36d];return _0x31bdac;}import{transactionFees as _0x40b947,reviewedFees as _0x1f5a96}from'./transaction-fees.mjs';import{resumeTransaction as _0x44ee7a,recoveryNonce as _0x49601d,retireExpiredSwap as _0x93fbd1}from'./transaction-recovery.mjs';const be=0x7a120n,N=(_0x58b6e5,_0x223f0b,_0x554232)=>_0x58b6e5['readContract']({'address':_0x223f0b,'abi':_0x1c44ef,'functionName':'balanceOf','args':[_0x554232]}),Q=(_0x2ff612,_0x51a8f6,_0xa84523,_0x506ef5)=>_0x2ff612['readContract']({'address':_0x51a8f6,'abi':_0x1c44ef,'functionName':'allowance','args':[_0xa84523,_0x506ef5]}),H=(_0x453eaf,_0x4571e0,_0x234baa,_0x236c88)=>({'kind':_0x453eaf,'to':_0x4571e0,'value':'0','gas':String(_0x8abe36),'data':_0x147fc7({'abi':_0x1c44ef,'functionName':_0x35fbd5(0x209),'args':[_0x234baa,_0x236c88]})});async function ye(_0x46c55d,_0xd29db5,_0x1b96ab,_0x354c5d,_0x271c65){const _0x3ab721=_0x35fbd5,{funding:_0x3c1f7a,shortages:_0x147e53,requirement:_0x185f01}=await ve(_0x46c55d,_0xd29db5,_0x1b96ab,_0x354c5d,_0x271c65);if(_0x147e53[_0x3ab721(0x201)])throw _0x5004bb(_0x354c5d[_0x3ab721(0x232)],_0x46c55d[_0x3ab721(0x1ee)]??_0x3ab721(0x216),_0x147e53,_0x185f01);return _0x3c1f7a;}async function ve(_0x1935ba,_0x100148,_0x2b4c13,_0x1ed18d,_0x334b96){const _0x597332=_0x35fbd5,_0x12d299=_0x1935ba[_0x597332(0x1ee)]??'ethereum',_0x15a54f=_0x1b1ff1(_0x12d299,_0x1935ba['payWith']),_0x4e9ca7=_0x334b96??await _0x2dfc5d(_0x100148[_0x597332(0x234)],_0x1935ba[_0x597332(0x20a)],_0x12d299,_0x100148),_0x242874=_0x334b96?_0x334b96[_0x597332(0x1f4)]:_0x11416a(_0x1935ba);if(_0x1a9fc8(_0x242874),_0x242874['asset'][_0x597332(0x226)]()!==_0x4e9ca7['payment'][_0x597332(0x225)][_0x597332(0x226)]())throw new Error(_0x597332(0x1ff));const _0x2ee3cf=BigInt(_0x242874['amount']),[_0x22aa99,_0xd84fda,_0x250c70]=await Promise[_0x597332(0x20b)]([Q(_0x2b4c13,_0x242874[_0x597332(0x225)],_0x1ed18d[_0x597332(0x232)],_0x4e9ca7[_0x597332(0x1e4)]),_0x2b4c13[_0x597332(0x21b)]({'address':_0x1ed18d[_0x597332(0x232)]}),_0x40b947(_0x2b4c13,_0x2de524(_0x12d299)['chain']['id'])]),_0x2c1394=(_0x1935ba['funding']?.[_0x597332(0x235)]??[])[_0x597332(0x229)](_0x48b253=>_0x48b253[_0x597332(0x1e9)]==='confirmed');let _0x9cabe6=0x0n,_0x2219d1=0x0n;for(const _0x5d50bf of _0x2c1394)if(_0x5d50bf['kind']==='swap'){const _0x2caed9=_0xea4bc7({'abi':_0x16cc0b,'data':_0x5d50bf['data']});_0x9cabe6+=_0xea4bc7({'abi':_0x16cc0b,'data':_0x2caed9[_0x597332(0x1fd)][0x1][0x0]})['args'][0x0][_0x597332(0x1f5)];}else _0x5d50bf['kind']==='support'&&(_0x2219d1+=_0xea4bc7({'abi':_0x1c44ef,'data':_0x5d50bf[_0x597332(0x233)]})[_0x597332(0x1fd)][0x1]);const _0x468eee=BigInt(_0x1935ba['support']?.[_0x597332(0x22a)]??0x0)-_0x2219d1,_0x19537c=_0x2ee3cf+_0x468eee,_0x36456a=_0x1bd057[_0x12d299][_0x597332(0x228)],_0x8588e8=_0x12d299===_0x597332(0x1e3)?be:0x0n,_0x28de61=_0x468eee>0x0n?0x186a0n:0x0n,_0x281e66=_0x8588e8+_0x28de61+(_0x22aa99<_0x2ee3cf?_0x8abe36:0x0n),_0x4c9ffb=[],_0x17430d=[];let _0x9930ee;const _0x589fc1=Math[_0x597332(0x1ec)](Number(_0x1935ba[_0x597332(0x20d)]['expiresAt']),Math[_0x597332(0x227)](Date[_0x597332(0x214)]()/0x3e8)+0x12c);let _0x181c8b=_0x15a54f[_0x597332(0x215)]===_0x597332(0x207)?_0xd84fda:null;if(_0x15a54f['symbol']===_0x597332(0x218)){const _0x1d59c0=await N(_0x2b4c13,_0x242874[_0x597332(0x225)],_0x1ed18d['address']);_0x181c8b=_0x1d59c0,_0x1d59c0<_0x19537c&&_0x17430d[_0x597332(0x210)]({'coin':_0x597332(0x218),'balance':String(_0x1d59c0),'required':String(_0x19537c)});}const _0x4dcbc2=_0x9cabe6>_0x2219d1?_0x9cabe6-_0x2219d1:0x0n,_0x4dfce4=_0x19537c>_0x4dcbc2?_0x19537c-_0x4dcbc2:0x0n;if(_0x4dcbc2>0x0n){const _0x57d1ac=await N(_0x2b4c13,_0x242874[_0x597332(0x225)],_0x1ed18d[_0x597332(0x232)]),_0x2d1438=_0x19537c<_0x4dcbc2?_0x19537c:_0x4dcbc2;_0x57d1ac<_0x2d1438&&_0x17430d[_0x597332(0x210)]({'coin':'IMD','balance':String(_0x57d1ac),'required':String(_0x2d1438)});}if(_0x15a54f['symbol']!==_0x597332(0x218)&&_0x4dfce4>0x0n){const _0x358634=_0x15a54f['symbol']===_0x597332(0x207)?0x0n:await Q(_0x2b4c13,_0x15a54f[_0x597332(0x232)],_0x1ed18d[_0x597332(0x232)],_0x36456a);_0x9930ee=await _0x1c9820(_0x12d299,_0x15a54f,_0x4dfce4,{'client':_0x2b4c13,'maxFeePerGas':_0x250c70[_0x597332(0x212)],'sourceAllowance':_0x358634,'fixedGas':_0x281e66,'signal':_0x100148[_0x597332(0x208)]});const _0x430dea=BigInt(_0x9930ee[_0x597332(0x22e)]);if(_0x15a54f['symbol']!==_0x597332(0x207)){const _0x531a43=await N(_0x2b4c13,_0x15a54f['address'],_0x1ed18d[_0x597332(0x232)]);_0x181c8b=_0x531a43;const _0x4b00df=_0x358634;_0x531a43<_0x430dea&&_0x17430d[_0x597332(0x210)]({'coin':_0x15a54f[_0x597332(0x215)],'balance':String(_0x531a43),'required':String(_0x430dea)}),_0x4b00df<_0x430dea&&(_0x15a54f[_0x597332(0x215)]===_0x597332(0x21d)&&_0x4b00df>0x0n&&_0x4c9ffb[_0x597332(0x210)](H(_0x597332(0x22d),_0x15a54f[_0x597332(0x232)],_0x36456a,0x0n)),_0x4c9ffb[_0x597332(0x210)](H(_0x597332(0x221),_0x15a54f[_0x597332(0x232)],_0x36456a,_0x430dea)));}const _0x59f784=_0x9ab358(_0x12d299,_0x15a54f,_0x9930ee,_0x4dfce4,_0x1ed18d[_0x597332(0x232)],_0x589fc1);_0x4c9ffb[_0x597332(0x210)]({'kind':_0x597332(0x220),..._0x59f784,'gas':String(_0x9930ee['gas']),'expiresAt':_0x589fc1});}_0x22aa99<_0x2ee3cf&&_0x4c9ffb['push'](H(_0x597332(0x205),_0x242874['asset'],_0x4e9ca7[_0x597332(0x1e4)],_0x2ee3cf)),_0x468eee>0x0n&&_0x4c9ffb['push']({'kind':_0x597332(0x22b),'to':_0x242874['asset'],'value':'0','gas':String(_0x28de61),'data':_0x147fc7({'abi':_0x1c44ef,'functionName':_0x597332(0x1f2),'args':[_0x1935ba[_0x597332(0x22b)]['recipient'],_0x468eee]})});const _0x56cb0d=_0x4c9ffb['reduce']((_0x56e19d,_0x3a4c03)=>_0x56e19d+BigInt(_0x3a4c03[_0x597332(0x1ea)]),_0x8588e8)*_0x250c70[_0x597332(0x212)],_0x5221d1=_0x15a54f[_0x597332(0x215)]===_0x597332(0x218)?_0x19537c:BigInt(_0x9930ee?.[_0x597332(0x22e)]??0x0),_0x3c666c=_0x5221d1+(_0x15a54f[_0x597332(0x215)]===_0x597332(0x207)?_0x56cb0d:0x0n),_0x24877a=_0x56cb0d+(_0x15a54f[_0x597332(0x215)]===_0x597332(0x207)?_0x5221d1:0x0n);_0xd84fda<_0x24877a&&_0x17430d[_0x597332(0x210)]({'coin':'ETH','balance':String(_0xd84fda),'required':String(_0x24877a)});const _0x522c02={'coin':_0x15a54f[_0x597332(0x215)],'imd':String(_0x19537c),'price':String(_0x2ee3cf),'support':String(_0x468eee>0x0n?_0x468eee:0x0n),'payment':String(_0x5221d1),'estimate':String(_0x15a54f[_0x597332(0x215)]==='IMD'?_0x19537c:_0x9930ee?.[_0x597332(0x1f7)]??0x0),'gas':String(_0x56cb0d),'balance':_0x181c8b===null?null:String(_0x181c8b),'nativeBalance':String(_0xd84fda)};return{'shortages':_0x17430d,'requirement':_0x522c02,'funding':{'chainId':_0x2de524(_0x12d299)[_0x597332(0x1e2)]['id'],'account':_0x1ed18d[_0x597332(0x232)],'coin':_0x15a54f[_0x597332(0x215)],'amountIn':String(_0x5221d1),'minimumOut':String(_0x19537c),'maximumDebit':String(_0x3c666c),'quotedInput':String(_0x15a54f['symbol']===_0x597332(0x218)?_0x19537c:_0x9930ee?.[_0x597332(0x1f7)]??0x0),..._0x9930ee?{'slippageBps':_0x9930ee[_0x597332(0x1f6)]}:{},'feeCap':String(_0x56cb0d),'maxFeePerGas':String(_0x250c70[_0x597332(0x212)]),'maxPriorityFeePerGas':String(_0x250c70[_0x597332(0x1f0)]),'paymentGas':String(_0x8588e8),'expiresAt':_0x589fc1,'steps':[..._0x2c1394,..._0x4c9ffb]}};}async function Be(_0x4af445,_0x327e69,_0x34baa0){const _0x1bbfc4=_0x35fbd5,_0x3a0b85=_0x2de524(_0x4af445[_0x1bbfc4(0x1ee)]??_0x1bbfc4(0x216))['chain']['id'],_0x1c088d=_0x36db5d(_0x327e69);if(!_0x1c088d[_0x1bbfc4(0x211)])throw new Error('Create\x20or\x20import\x20a\x20wallet\x20in\x20Wallets\x20before\x20paying.');if(_0x327e69[_0x1bbfc4(0x213)]&&_0x327e69[_0x1bbfc4(0x213)][_0x1bbfc4(0x226)]()!==_0x1c088d['address'][_0x1bbfc4(0x226)]())throw new Error(_0x1bbfc4(0x20c));const _0x16b6e6=await _0x581e7d(_0x327e69,_0x3a0b85);if(_0x4af445[_0x1bbfc4(0x223)]&&_0x4af445['funding']['account'][_0x1bbfc4(0x226)]()!==_0x1c088d['address'][_0x1bbfc4(0x226)]())throw new Error('Resume\x20funding\x20with\x20the\x20same\x20wallet\x20that\x20started\x20this\x20order.');for(const _0xeefee8 of _0x4af445['funding']?.[_0x1bbfc4(0x235)]??[]){if(_0xeefee8[_0x1bbfc4(0x21e)]&&_0xeefee8['status']!==_0x1bbfc4(0x224)&&await _0x93fbd1(_0x4af445,_0xeefee8,_0x16b6e6,_0x327e69))continue;if(_0xeefee8[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x21a))throw new Error(_0x1bbfc4(0x1fa)+_0xeefee8[_0x1bbfc4(0x22c)]+_0x1bbfc4(0x1fb)+_0xeefee8[_0x1bbfc4(0x1df)]+'.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.');if(!_0xeefee8[_0x1bbfc4(0x21e)]||_0xeefee8[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x224))continue;const _0x5be3ef=await _0x44ee7a(_0x4af445,_0xeefee8,_0x16b6e6,_0x327e69);if(_0xeefee8[_0x1bbfc4(0x1e9)]=_0x5be3ef[_0x1bbfc4(0x1e9)]==='success'?_0x1bbfc4(0x224):_0x1bbfc4(0x21a),_0xeefee8[_0x1bbfc4(0x1fc)]=_0x5be3ef['transactionHash'],delete _0x4af445[_0x1bbfc4(0x1dd)],await _0x25ac23(_0x327e69[_0x1bbfc4(0x206)],_0x4af445),_0xeefee8[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x21a))throw new Error(_0x1bbfc4(0x1fa)+_0xeefee8[_0x1bbfc4(0x22c)]+_0x1bbfc4(0x1fb)+_0xeefee8[_0x1bbfc4(0x1df)]+'.\x20No\x20replacement\x20swap\x20will\x20be\x20made\x20for\x20this\x20order.');}_0x327e69[_0x1bbfc4(0x1e0)]?.({'phase':'checking_funds','message':_0x1bbfc4(0x217)}),_0x4af445['funding']=await ye(_0x4af445,_0x327e69,_0x16b6e6,_0x1c088d);const _0x371056=_0x4af445[_0x1bbfc4(0x223)];_0x4af445['paymentReview']={'networkFeeCap':_0x6f11b2(BigInt(_0x371056[_0x1bbfc4(0x1e1)]))},await _0x34baa0(_0x4af445),_0x327e69[_0x1bbfc4(0x208)]?.[_0x1bbfc4(0x202)](),_0x212344(await _0x2cfba5(_0x327e69[_0x1bbfc4(0x206)],_0x4af445[_0x1bbfc4(0x21f)])),await _0x25ac23(_0x327e69[_0x1bbfc4(0x206)],_0x4af445);const {walletClient:_0x7bcdb9,account:_0x3d42af}=await _0x24e488({..._0x327e69,'expectedWallet':_0x1c088d[_0x1bbfc4(0x232)]},_0x3a0b85);if(_0x327e69[_0x1bbfc4(0x208)]?.[_0x1bbfc4(0x202)](),_0x212344(await _0x2cfba5(_0x327e69['home'],_0x4af445['requestKey'])),_0x371056[_0x1bbfc4(0x20e)]*0x3e8<=Date[_0x1bbfc4(0x214)]())throw Object['assign'](new Error(_0x1bbfc4(0x200)),{'code':_0x1bbfc4(0x1de)});for(const _0x1ed7f1 of _0x371056[_0x1bbfc4(0x235)]){if(_0x1ed7f1[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x224))continue;if(_0x1ed7f1[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x21a))throw new Error('The\x20'+_0x1ed7f1['kind']+_0x1bbfc4(0x1fb)+_0x1ed7f1[_0x1bbfc4(0x1df)]+_0x1bbfc4(0x21c));if(!_0x1ed7f1[_0x1bbfc4(0x21e)]){if(_0x371056[_0x1bbfc4(0x20e)]*0x3e8<=Date[_0x1bbfc4(0x214)]())throw Object[_0x1bbfc4(0x1f3)](new Error(_0x1bbfc4(0x200)),{'code':'payment_review_expired'});const _0x1da29e=_0x1f5a96(await _0x40b947(_0x16b6e6,_0x3a0b85),_0x371056);_0x327e69[_0x1bbfc4(0x1e0)]?.({'phase':_0x1bbfc4(0x231),'message':_0x1bbfc4(0x204)+(_0x1ed7f1[_0x1bbfc4(0x22c)]===_0x1bbfc4(0x220)?_0x1bbfc4(0x1eb):_0x1ed7f1[_0x1bbfc4(0x22c)]==='support'?_0x1bbfc4(0x203):'token\x20authorization')+_0x1bbfc4(0x1ed)});const _0x5131e4={'account':_0x3d42af,'to':_0x1ed7f1['to'],'data':_0x1ed7f1['data'],'value':BigInt(_0x1ed7f1[_0x1bbfc4(0x1f1)]),..._0x1da29e};let _0x53e348;try{_0x53e348=await _0x16b6e6['estimateGas'](_0x5131e4);}catch(_0x103d24){throw _0x103d24 instanceof _0x1ae311?new Error((_0x1ed7f1[_0x1bbfc4(0x22c)]===_0x1bbfc4(0x220)?_0x1bbfc4(0x22f):_0x1ed7f1[_0x1bbfc4(0x22c)]===_0x1bbfc4(0x22b)?_0x1bbfc4(0x1e8):_0x1bbfc4(0x1fe))+_0x1bbfc4(0x236),{'cause':_0x103d24}):_0x103d24;}if(_0x53e348>BigInt(_0x1ed7f1[_0x1bbfc4(0x1ea)]))throw new Error(_0x1bbfc4(0x1f9));const _0x3aa57a=await _0x7bcdb9[_0x1bbfc4(0x1e5)]({..._0x5131e4,'gas':BigInt(_0x1ed7f1['gas']),'nonce':await _0x49601d(_0x4af445,_0x16b6e6,_0x3d42af['address'])});if(await _0xa34bba({..._0x327e69,'expectedWallet':_0x3d42af[_0x1bbfc4(0x232)]}),_0x327e69[_0x1bbfc4(0x208)]?.[_0x1bbfc4(0x202)](),_0x212344(await _0x2cfba5(_0x327e69[_0x1bbfc4(0x206)],_0x4af445['requestKey'])),_0x371056[_0x1bbfc4(0x20e)]*0x3e8<=Date['now']())throw Object[_0x1bbfc4(0x1f3)](new Error('Refreshing\x20the\x20payment\x20review.\x20No\x20new\x20transaction\x20was\x20signed.'),{'code':'payment_review_expired'});Object[_0x1bbfc4(0x1f3)](_0x3aa57a,_0x1f5a96(await _0x40b947(_0x16b6e6,_0x3a0b85),_0x371056)),_0x1ed7f1['rawTransaction']=await _0x7bcdb9[_0x1bbfc4(0x1ef)](_0x3aa57a),_0x1ed7f1[_0x1bbfc4(0x1df)]=_0x2007a7(_0x1ed7f1['rawTransaction']),_0x1ed7f1[_0x1bbfc4(0x1e9)]=_0x1bbfc4(0x1f8),delete _0x4af445[_0x1bbfc4(0x230)],_0x4af445[_0x1bbfc4(0x1e9)]=_0x1bbfc4(0x223),await _0x25ac23(_0x327e69[_0x1bbfc4(0x206)],_0x4af445);}const _0x14755a=await _0x5adafa(_0x16b6e6,_0x1ed7f1,_0x327e69);if(_0x1ed7f1[_0x1bbfc4(0x1e9)]=_0x14755a['status']===_0x1bbfc4(0x20f)?_0x1bbfc4(0x224):_0x1bbfc4(0x21a),_0x1ed7f1['confirmedHash']=_0x14755a[_0x1bbfc4(0x222)],delete _0x4af445[_0x1bbfc4(0x1dd)],await _0x25ac23(_0x327e69[_0x1bbfc4(0x206)],_0x4af445),_0x1ed7f1[_0x1bbfc4(0x1e9)]===_0x1bbfc4(0x21a))throw new Error(_0x1bbfc4(0x1fa)+_0x1ed7f1[_0x1bbfc4(0x22c)]+'\x20transaction\x20reverted:\x20'+_0x1ed7f1['hash']+_0x1bbfc4(0x1e6));}const _0x15cff1=_0x11416a(_0x4af445);if(await N(_0x16b6e6,_0x15cff1[_0x1bbfc4(0x225)],_0x3d42af['address'])<BigInt(_0x15cff1[_0x1bbfc4(0x22a)]))throw new Error(_0x1bbfc4(0x219));_0x212344(await _0x2cfba5(_0x327e69[_0x1bbfc4(0x206)],_0x4af445[_0x1bbfc4(0x21f)])),_0x371056[_0x1bbfc4(0x1e9)]=_0x1bbfc4(0x1e7),await _0x25ac23(_0x327e69['home'],_0x4af445);}export{Be as fundOrder,ve as planFunding,ye as prepareFunding};
|