@xpr-agents/openclaw 0.3.1 → 0.4.0
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 +51 -10
- package/openclaw.plugin.json +15 -1
- package/package.json +7 -4
- package/skills/code-sandbox/SKILL.md +30 -0
- package/skills/code-sandbox/dist/index.js +188 -0
- package/skills/code-sandbox/skill.json +13 -0
- package/skills/code-sandbox/src/index.ts +212 -0
- package/skills/creative/SKILL.md +32 -0
- package/skills/creative/dist/index.js +667 -0
- package/skills/creative/skill.json +13 -0
- package/skills/creative/src/index.ts +679 -0
- package/skills/defi/SKILL.md +123 -0
- package/skills/defi/dist/index.js +1745 -0
- package/skills/defi/skill.json +44 -0
- package/skills/defi/src/index.ts +1788 -0
- package/skills/defi/test-read.mjs +281 -0
- package/skills/governance/SKILL.md +69 -0
- package/skills/governance/dist/index.js +632 -0
- package/skills/governance/skill.json +21 -0
- package/skills/governance/src/index.ts +656 -0
- package/skills/governance/test-read.mjs +176 -0
- package/skills/lending/SKILL.md +63 -0
- package/skills/lending/dist/index.js +1039 -0
- package/skills/lending/skill.json +29 -0
- package/skills/lending/src/index.ts +1105 -0
- package/skills/lending/test-read.mjs +156 -0
- package/skills/nft/SKILL.md +95 -0
- package/skills/nft/dist/index.js +1520 -0
- package/skills/nft/skill.json +37 -0
- package/skills/nft/src/index.ts +1539 -0
- package/skills/shellbook/SKILL.md +59 -0
- package/skills/shellbook/dist/index.js +381 -0
- package/skills/shellbook/skill.json +29 -0
- package/skills/shellbook/src/index.ts +391 -0
- package/skills/shellbook/tsconfig.json +14 -0
- package/skills/smart-contracts/SKILL.md +128 -0
- package/skills/smart-contracts/dist/index.js +1225 -0
- package/skills/smart-contracts/skill.json +25 -0
- package/skills/smart-contracts/src/index.ts +1327 -0
- package/skills/smart-contracts/tsconfig.json +14 -0
- package/skills/structured-data/SKILL.md +36 -0
- package/skills/structured-data/dist/index.js +501 -0
- package/skills/structured-data/skill.json +13 -0
- package/skills/structured-data/src/index.ts +597 -0
- package/skills/tax/SKILL.md +109 -0
- package/skills/tax/dist/index.js +1749 -0
- package/skills/tax/skill.json +20 -0
- package/skills/tax/src/index.ts +1985 -0
- package/skills/web-scraping/SKILL.md +29 -0
- package/skills/web-scraping/dist/index.js +311 -0
- package/skills/web-scraping/skill.json +13 -0
- package/skills/web-scraping/src/index.ts +371 -0
- package/skills/xmd/SKILL.md +52 -0
- package/skills/xmd/dist/index.js +596 -0
- package/skills/xmd/skill.json +22 -0
- package/skills/xmd/src/index.ts +635 -0
- package/skills/xmd/test-read.mjs +178 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tax
|
|
3
|
+
description: Crypto tax reporting for XPR Network with regional support
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Crypto Tax Reporting
|
|
7
|
+
|
|
8
|
+
You have tools to generate crypto tax reports from on-chain XPR Network activity. Supports **New Zealand** (NZ) and **United States** (US).
|
|
9
|
+
|
|
10
|
+
### Key Facts
|
|
11
|
+
|
|
12
|
+
- **NZ tax year:** April 1 – March 31 (e.g. "2025" = Apr 2024 – Mar 2025)
|
|
13
|
+
- **US tax year:** January 1 – December 31 (calendar year, e.g. "2024" = Jan 2024 – Dec 2024)
|
|
14
|
+
- **NZ has NO capital gains tax** — all crypto gains are taxed as **income** if you're a regular trader
|
|
15
|
+
- **US HAS capital gains tax** — short-term (<1 year) taxed as ordinary income, long-term at lower rates. Uses 2024 Single filer federal brackets. Does not include state taxes or NIIT.
|
|
16
|
+
- **Cost basis methods:** FIFO (first-in-first-out) or Average Cost
|
|
17
|
+
- **All tools are read-only** — they query APIs and calculate, never transact
|
|
18
|
+
- **Default region is NZ** — pass `region: "US"` for US tax reports
|
|
19
|
+
|
|
20
|
+
### Typical Workflow
|
|
21
|
+
|
|
22
|
+
For a full tax report, the recommended sequence is:
|
|
23
|
+
|
|
24
|
+
1. `tax_get_balances` — opening balances (start of tax year) and closing balances (end of tax year)
|
|
25
|
+
2. `tax_get_dex_trades` — all Metal X DEX trading history for the period
|
|
26
|
+
3. `tax_get_transfers` — on-chain transfers, auto-categorized (staking rewards, lending, swaps, NFT sales, etc.)
|
|
27
|
+
4. `tax_get_rates` — local currency conversion rates for each token
|
|
28
|
+
5. `tax_calculate_gains` — compute taxable gains/losses using FIFO or Average Cost
|
|
29
|
+
6. `tax_generate_report` — full report with tax brackets and estimated tax
|
|
30
|
+
|
|
31
|
+
Or use `tax_generate_report` directly for a one-shot report that orchestrates all steps automatically.
|
|
32
|
+
|
|
33
|
+
### Data Sources (Mainnet Only)
|
|
34
|
+
|
|
35
|
+
- **Saltant API** — historical balance snapshots (liquid, staked, lending, yield farm)
|
|
36
|
+
- **Metal X API** — DEX trade history in CSV format (only filled trades)
|
|
37
|
+
- **Hyperion API** — raw on-chain transfer/action history
|
|
38
|
+
- **CoinGecko API** — historical and current crypto prices (set `COINGECKO_API_KEY` in .env for full historical access)
|
|
39
|
+
|
|
40
|
+
### Transfer Categories
|
|
41
|
+
|
|
42
|
+
Transfers are auto-categorized by sender/receiver:
|
|
43
|
+
|
|
44
|
+
| Category | Detection |
|
|
45
|
+
|----------|-----------|
|
|
46
|
+
| `staking_reward` | from `eosio` or `eosio.vpay` |
|
|
47
|
+
| `lending_deposit` | to `lending.loan` |
|
|
48
|
+
| `lending_withdrawal` | from `lending.loan` |
|
|
49
|
+
| `lending_interest` | from `lending.loan` with interest memo |
|
|
50
|
+
| `swap_deposit` | to `proton.swaps` |
|
|
51
|
+
| `swap_withdrawal` | from `proton.swaps` |
|
|
52
|
+
| `long_stake` | to `longstaking` (XPR long staking) |
|
|
53
|
+
| `long_unstake` | from `longstaking` |
|
|
54
|
+
| `loan_stake` | to `lock.token` or `yield.farms` (LOAN/SLOAN staking) |
|
|
55
|
+
| `loan_unstake` | from `lock.token` or `yield.farms` |
|
|
56
|
+
| `dex_deposit` | to `dex` or `metalx` |
|
|
57
|
+
| `dex_withdrawal` | from `dex` or `metalx` |
|
|
58
|
+
| `nft_sale` | from `atomicmarket` |
|
|
59
|
+
| `nft_purchase` | to `atomicmarket` |
|
|
60
|
+
| `burn` | to `eosio.null` (token burn = realized loss) |
|
|
61
|
+
| `escrow` | to/from `agentescrow` |
|
|
62
|
+
| `transfer` | everything else |
|
|
63
|
+
|
|
64
|
+
### Staking Income Rules
|
|
65
|
+
|
|
66
|
+
- **Block producer rewards** (`staking_reward`): Full amount is income at time of receipt
|
|
67
|
+
- **Long staking** (XPR via `longstaking`): Only the **excess** over the staked amount is income. E.g. stake 100 XPR, unstake 150 XPR → income of 50 XPR
|
|
68
|
+
- **LOAN staking** (via `lock.token`/`yield.farms`): Same excess-only rule as long staking
|
|
69
|
+
- **Lending interest**: Full amount from `lending.loan` with interest memo is income
|
|
70
|
+
|
|
71
|
+
### Stablecoin Handling
|
|
72
|
+
|
|
73
|
+
XUSDC and XMD are pegged to USD — their local currency value uses forex rates (USD/NZD) directly, without CoinGecko. This is more accurate than market-based pricing for stablecoins.
|
|
74
|
+
|
|
75
|
+
### Rate Sources (Priority Order)
|
|
76
|
+
|
|
77
|
+
1. **DEX trades** — derives token prices from TOKEN/XMD trade ratios (most accurate, no API limits)
|
|
78
|
+
2. **Forward-fill** — gaps between DEX trade dates use nearest prior known rate
|
|
79
|
+
3. **CoinGecko** — fallback for dates with no DEX data. Without API key: limited to 365 days. With `COINGECKO_API_KEY`: unlimited history
|
|
80
|
+
4. **Forex** — stablecoins use USD→NZD conversion rate
|
|
81
|
+
|
|
82
|
+
### Delivering the Report
|
|
83
|
+
|
|
84
|
+
`tax_generate_report` returns a `report_markdown` field — a pre-formatted Markdown document with balance sheets, trading summary, income breakdown, tax brackets, and disclaimer. To deliver it:
|
|
85
|
+
|
|
86
|
+
1. Upload `report_markdown` via `store_deliverable` with `content_type: "application/pdf"` — this is the primary deliverable
|
|
87
|
+
2. Upload `csv_exports.disposals` via `store_deliverable` with `content_type: "text/csv"` — disposals CSV
|
|
88
|
+
3. Upload `csv_exports.income` via `store_deliverable` with `content_type: "text/csv"` — income events CSV
|
|
89
|
+
4. Call `xpr_deliver_job` with ALL URLs comma-separated (PDF first): `"https://ipfs.io/ipfs/QmPDF...,https://ipfs.io/ipfs/QmDisposals...,https://ipfs.io/ipfs/QmIncome..."`
|
|
90
|
+
|
|
91
|
+
**IMPORTANT:** You MUST complete ALL steps (upload + deliver) in a single run. Do NOT stop after uploading the PDF — you must also upload the CSVs and call `xpr_deliver_job`. The job is not complete until `xpr_deliver_job` is called.
|
|
92
|
+
|
|
93
|
+
The frontend displays the primary file (PDF) prominently and lists additional files as download links.
|
|
94
|
+
|
|
95
|
+
### Known Limitations
|
|
96
|
+
|
|
97
|
+
- Only **filled DEX trades** are included (not pending orders)
|
|
98
|
+
- NFT: only buy/sell supported (not auctions)
|
|
99
|
+
- Liquidations on Metal Lending are not supported
|
|
100
|
+
- Escrow payments are tracked but not fully categorized
|
|
101
|
+
- Historical pricing accuracy depends on DEX trade activity and CoinGecko data availability
|
|
102
|
+
|
|
103
|
+
### Important Notes
|
|
104
|
+
|
|
105
|
+
- Always include the **disclaimer** from the report — this is not tax advice
|
|
106
|
+
- Suggest users **save CSV exports** for the IRD 7-year record requirement
|
|
107
|
+
- The `region` parameter defaults to `"NZ"` on all tools — pass a different region code when other regions are added
|
|
108
|
+
- Set `COINGECKO_API_KEY` in .env for best historical pricing (free Demo key removes 365-day limit)
|
|
109
|
+
- For tokens not on CoinGecko, the tool derives prices from Metal X DEX trade ratios
|