Skip to content

Commit 3fe8d96

Browse files
committed
Add tron and USDT tests to grid-test skill
1 parent 44f6bcc commit 3fe8d96

3 files changed

Lines changed: 332 additions & 133 deletions

File tree

.claude/skills/grid-test/SKILL.md

Lines changed: 75 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
22
name: grid-test
33
description: >
4-
This skill should be used when the user asks to "test Grid", "run USDC tests", "test deposits",
5-
"test withdrawals", "test Solana flows", "test Base flows", "test Polygon flows",
6-
"test Ethereum flows", "test ETH L1", "run e2e tests",
7-
"test sandbox", "test USDC to USD", "test USDC to MXN", "run all Grid tests", "test transfer out",
8-
"test realtime funding", "test quote flows", "test deposits and withdrawals",
9-
"run sandbox tests", "test USDC sandbox", "test Grid API", "run e2e USDC test",
10-
"test USDC on [chain]", or wants to verify Grid's USDC deposit/withdrawal/quote pipeline.
4+
This skill should be used when the user asks to "test Grid", "run USDC tests", "run USDT tests",
5+
"test deposits", "test withdrawals", "test Solana flows", "test Base flows", "test Polygon flows",
6+
"test Ethereum flows", "test ETH L1", "test Tron flows", "test USDT on Tron", "run e2e tests",
7+
"test sandbox", "test USDC to USD", "test USDT to USD", "test USDC to MXN", "run all Grid tests",
8+
"test transfer out", "test realtime funding", "test quote flows", "test deposits and withdrawals",
9+
"run sandbox tests", "test USDC sandbox", "test USDT sandbox", "test Grid API", "run e2e USDC test",
10+
"run e2e USDT test", "test USDC on [chain]", "test USDT on [chain]", or wants to verify Grid's
11+
stablecoin deposit/withdrawal/quote pipeline (USDC on Solana/Base/Polygon/Ethereum, USDT on Tron).
1112
Even if the user mentions just one chain, one test, or one corridor, this skill applies.
1213
This replaces both grid-solana-usdc-sandbox and grid-base-usdc-test.
1314
allowed-tools:
@@ -20,15 +21,17 @@ allowed-tools:
2021

2122
# Grid API Test Suite
2223

23-
End-to-end tests for USDC flows on Solana, Base, Polygon, and Ethereum L1: deposits, withdrawals, and cross-currency quotes using real testnet (or mainnet) funds.
24+
End-to-end tests for stablecoin flows: USDC on Solana, Base, Polygon, and Ethereum L1, and USDT on Tron. Covers deposits, withdrawals, and cross-currency quotes using real testnet (or mainnet) funds.
25+
26+
Each chain has a single supported stablecoin (`STABLE_ASSET` / `STABLE_CURRENCY` in the catalog). For Solana/Base/Polygon/Ethereum this is USDC; for Tron it is USDT. The tests themselves are asset-agnostic and parameterized over the chain's stablecoin.
2427

2528
## Step 1: Parse the User's Prompt
2629

2730
Determine what to run from the user's request:
2831

2932
**Chains** (default: all available — see step 3 for which have keys):
30-
- `solana`, `base`, `polygon`, `ethereum`, or `all`
31-
- Multiple chains: "test solana and base", "run base and polygon tests", "test ethereum"
33+
- `solana`, `base`, `polygon`, `ethereum`, `tron`, or `all`
34+
- Multiple chains: "test solana and base", "run base and polygon tests", "test tron"
3235

3336
**Tests** (default: all):
3437
- By number: "run test 4 on solana"
@@ -98,26 +101,30 @@ For each chain the user wants to test, set the chain-specific variables and veri
98101

99102
**Testnet (sandbox/dev):**
100103

101-
| Variable | Solana | Base | Polygon | Ethereum |
102-
|---|---|---|---|---|
103-
| `CRYPTO_NETWORK` | `SOLANA_DEVNET` | `BASE_TESTNET` | `POLYGON_TESTNET` | `ETHEREUM_TESTNET` |
104-
| `WALLET_TYPE` | `SOLANA_WALLET` | `BASE_WALLET` | `POLYGON_WALLET` | `ETHEREUM_WALLET` |
105-
| `CRED_KEY` | `solanaDevnetPrivateKey` | `baseTestnetPrivateKey` | `polygonTestnetPrivateKey` | `ethereumTestnetPrivateKey` |
106-
| `HELPER_SCRIPT` | `scripts/solana_helper.py` | `scripts/base_helper.py` | `scripts/polygon_helper.py` | `scripts/ethereum_helper.py` |
107-
| `GAS_CMD` | `sol-balance` | `eth-balance` | `pol-balance` | `eth-balance` |
108-
| `GAS_TOKEN` | SOL | ETH | POL | ETH |
109-
| `GAS_MIN` | 0.1 | 0.001 | 0.1 | 0.01 |
110-
| `TRANSFER_OUT_AMT` | 100000 | 200000 | 200000 | 200000 |
111-
| `PIP_DEPS` | `solders solana base58` | `web3` | `web3` | `web3` |
104+
| Variable | Solana | Base | Polygon | Ethereum | Tron |
105+
|---|---|---|---|---|---|
106+
| `CRYPTO_NETWORK` | `SOLANA_DEVNET` | `BASE_TESTNET` | `POLYGON_TESTNET` | `ETHEREUM_TESTNET` | `TRON_TESTNET` |
107+
| `WALLET_TYPE` | `SOLANA_WALLET` | `BASE_WALLET` | `POLYGON_WALLET` | `ETHEREUM_WALLET` | `TRON_WALLET` |
108+
| `STABLE_ASSET` | `usdc` | `usdc` | `usdc` | `usdc` | `usdt` |
109+
| `STABLE_CURRENCY` | `USDC` | `USDC` | `USDC` | `USDC` | `USDT` |
110+
| `CRED_KEY` | `solanaDevnetPrivateKey` | `baseTestnetPrivateKey` | `polygonTestnetPrivateKey` | `ethereumTestnetPrivateKey` | `tronTestnetPrivateKey` |
111+
| `HELPER_SCRIPT` | `scripts/solana_helper.py` | `scripts/base_helper.py` | `scripts/polygon_helper.py` | `scripts/ethereum_helper.py` | `scripts/tron_helper.py` |
112+
| `GAS_CMD` | `sol-balance` | `eth-balance` | `pol-balance` | `eth-balance` | `trx-balance` |
113+
| `GAS_TOKEN` | SOL | ETH | POL | ETH | TRX |
114+
| `GAS_MIN` | 0.1 | 0.001 | 0.1 | 0.01 | 50 |
115+
| `TRANSFER_OUT_AMT` | 100000 | 200000 | 200000 | 200000 | 200000 |
116+
| `PIP_DEPS` | `solders solana base58` | `web3` | `web3` | `web3` | `tronpy` |
112117

113118
**Mainnet (non-sandbox production):**
114119

115-
| Variable | Solana | Base | Polygon | Ethereum |
116-
|---|---|---|---|---|
117-
| `CRYPTO_NETWORK` | `SOLANA_MAINNET` | `BASE_MAINNET` | `POLYGON_MAINNET` | `ETHEREUM_MAINNET` |
118-
| `WALLET_TYPE` | `SOLANA_WALLET` | `BASE_WALLET` | `POLYGON_WALLET` | `ETHEREUM_WALLET` |
119-
| `CRED_KEY` | `solanaMainnetPrivateKey` | `baseMainnetPrivateKey` | `polygonMainnetPrivateKey` | `ethereumMainnetPrivateKey` |
120-
| Other vars | Same as testnet | Same as testnet | Same as testnet | Same as testnet |
120+
| Variable | Solana | Base | Polygon | Ethereum | Tron |
121+
|---|---|---|---|---|---|
122+
| `CRYPTO_NETWORK` | `SOLANA_MAINNET` | `BASE_MAINNET` | `POLYGON_MAINNET` | `ETHEREUM_MAINNET` | `TRON_MAINNET` |
123+
| `WALLET_TYPE` | `SOLANA_WALLET` | `BASE_WALLET` | `POLYGON_WALLET` | `ETHEREUM_WALLET` | `TRON_WALLET` |
124+
| `CRED_KEY` | `solanaMainnetPrivateKey` | `baseMainnetPrivateKey` | `polygonMainnetPrivateKey` | `ethereumMainnetPrivateKey` | `tronMainnetPrivateKey` |
125+
| Other vars | Same as testnet | Same as testnet | Same as testnet | Same as testnet | Same as testnet |
126+
127+
`STABLE_ASSET` is the lowercase asset name used in helper subcommands (`$STABLE_ASSET-balance`, `send-$STABLE_ASSET`). `STABLE_CURRENCY` is the uppercase Grid currency code used in API request bodies. Tron uses USDT; every other chain uses USDC.
121128

122129
### Per-chain prerequisites
123130

@@ -146,23 +153,25 @@ For each selected chain, run these checks. Skip a chain (with a warning) if its
146153

147154
4. **Check gas balance:**
148155
```bash
149-
$CHAIN_HELPER $GAS_CMD
156+
chain_helper $GAS_CMD
150157
```
151158
If below `GAS_MIN`, warn the user with instructions for obtaining testnet gas:
152159
- Solana: `chain_helper airdrop-sol --amount 1000000000`
153160
- Base: https://www.alchemy.com/faucets/base-sepolia
154161
- Polygon: https://faucet.polygon.technology/
155162
- Ethereum: https://www.alchemy.com/faucets/ethereum-sepolia
163+
- Tron: https://shasta.tronex.io/ (Shasta testnet TRX faucet)
156164

157-
5. **Check USDC balance:**
165+
5. **Check stablecoin balance:**
158166
```bash
159-
$CHAIN_HELPER usdc-balance
167+
chain_helper $STABLE_ASSET-balance
160168
```
161-
If `amount` < 1.0 USDC, warn the user. Testnet USDC sources:
162-
- Solana: Solana devnet USDC faucet
163-
- Base: https://faucet.circle.com/ (select Base Sepolia)
164-
- Polygon: https://faucet.circle.com/ (select Polygon Amoy)
165-
- Ethereum: https://faucet.circle.com/ (select Ethereum Sepolia)
169+
If `amount` < 1.0, warn the user. Testnet stablecoin sources:
170+
- Solana (USDC): Solana devnet USDC faucet
171+
- Base (USDC): https://faucet.circle.com/ (select Base Sepolia)
172+
- Polygon (USDC): https://faucet.circle.com/ (select Polygon Amoy)
173+
- Ethereum (USDC): https://faucet.circle.com/ (select Ethereum Sepolia)
174+
- Tron (USDT): https://shasta.tronex.io/ (Shasta testnet faucet — request TRX, then swap or fund via the TRC-20 USDT contract `TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs`)
166175

167176
6. **Get wallet address:**
168177
```bash
@@ -187,31 +196,34 @@ If running a subset, create the customer (Test 1) silently as setup, then run on
187196
- Base: `CHAIN_PREFIX="base-test"`
188197
- Polygon: `CHAIN_PREFIX="polygon-test"`
189198
- Ethereum: `CHAIN_PREFIX="ethereum-test"`
199+
- Tron: `CHAIN_PREFIX="tron-test"`
190200

191201
## Step 6: Results Summary
192202

193203
After all tests complete, print a results table per chain:
194204

195205
```
196206
## Solana Results
197-
| # | Test Case | Status | Details |
198-
|---|----------------------------------------|--------|---------|
199-
| 1 | Customer + USDC Account Creation | PASS | ... |
200-
| 2 | Fund Internal Account (deposit) | PASS | ... |
201-
| 3 | Transfer Out (→ wallet) | PASS | ... |
202-
| 4 | USDC → USD (RT funded → internal) | PASS | ... |
203-
| 5 | USDC → USD (RT funded → external bank) | PASS | ... |
204-
| 6 | USDC → MXN (RT funded → CLABE) | PASS | ... |
205-
| 7 | USD → USDC (Account funded → wallet) | PASS | ... |
206-
| 8 | USDC → USD (Account funded → internal) | PASS | ... |
207-
| 9 | USDC → MXN (Account funded → CLABE) | PASS | ... |
208-
| 10 | USDC → USD (RT funded → UMA) | PASS | ... |
209-
| 11 | USD → USD (Account funded → UMA) | PASS | ... |
207+
| # | Test Case | Status | Details |
208+
|---|---------------------------------------------------|--------|---------|
209+
| 1 | Customer + Stablecoin Account Creation | PASS | ... |
210+
| 2 | Fund Internal Account (deposit) | PASS | ... |
211+
| 3 | Transfer Out (→ wallet) | PASS | ... |
212+
| 4 | Stablecoin → USD (RT funded → internal) | PASS | ... |
213+
| 5 | Stablecoin → USD (RT funded → external bank) | PASS | ... |
214+
| 6 | Stablecoin → MXN (RT funded → CLABE) | PASS | ... |
215+
| 7 | USD → Stablecoin (Account funded → wallet) | PASS | ... |
216+
| 8 | Stablecoin → USD (Account funded → internal) | PASS | ... |
217+
| 9 | Stablecoin → MXN (Account funded → CLABE) | PASS | ... |
218+
| 10 | Stablecoin → USD (RT funded → UMA) | PASS | ... |
219+
| 11 | USD → USD (Account funded → UMA) | PASS | ... |
220+
221+
(For USDC chains, "Stablecoin" = USDC. For Tron, "Stablecoin" = USDT.)
210222
211223
## Base Results
212224
...
213225
214-
## Polygon Results
226+
## Tron Results
215227
...
216228
```
217229

@@ -226,6 +238,7 @@ If multiple chains were tested, add an aggregate summary:
226238
| Solana | 7/7 | 0 | 0 |
227239
| Base | 6/7 | 1 | 0 |
228240
| Polygon | 0/7 | 0 | 7 |
241+
| Tron | 7/7 | 0 | 0 |
229242
```
230243

231244
## Error Handling
@@ -241,21 +254,21 @@ If multiple chains were tested, add an aggregate summary:
241254

242255
## Amounts Reference
243256

244-
All tests use small amounts to conserve testnet funds:
257+
All tests use small amounts to conserve testnet funds. Amounts are denominated in the chain's stablecoin (USDC for Solana/Base/Polygon/Ethereum, USDT for Tron) at 6 decimals.
245258

246259
| Test | Amount | Notes |
247260
|------|--------|-------|
248-
| 2 (deposit) | 0.50 USDC (500000) | |
249-
| 3 (transfer-out) | Solana: 0.10 USDC (100000), Base/Polygon/Ethereum: 0.20 USDC (200000) | EVM chains must exceed ~100100 custody fee |
250-
| 4-5 (USDC→USD RT) | $0.10 locked receiving (10 cents) | |
251-
| 6 (USDC→MXN RT) | 11.00 MXN locked receiving (1100 centavos, ~$0.55) | Some envs enforce 1100 minimum |
252-
| 7 (USD→USDC) | $0.50 sending (50 cents) | Requires sandbox or prior USD balance |
253-
| 8 (USDC→USD acct) | 0.05 USDC sending (50000) | Requires USDC from test 2 |
254-
| 9 (USDC→MXN acct) | 0.05 USDC sending (50000) | Requires USDC from test 2 |
255-
| 10 (USDC→UMA RT) | $0.10 locked receiving (10 cents) | Requires valid UMA receiver |
261+
| 2 (deposit) | 0.50 stablecoin (500000) | |
262+
| 3 (transfer-out) | Solana: 0.10 (100000), Base/Polygon/Ethereum/Tron: 0.20 (200000) | EVM chains must exceed ~100100 custody fee; Tron mirrors the EVM minimum |
263+
| 4-5 (Stablecoin→USD RT) | $0.10 locked receiving (10 cents) | |
264+
| 6 (Stablecoin→MXN RT) | 11.00 MXN locked receiving (1100 centavos, ~$0.55) | Some envs enforce 1100 minimum |
265+
| 7 (USD→Stablecoin) | $0.50 sending (50 cents) | Requires sandbox or prior USD balance |
266+
| 8 (Stablecoin→USD acct) | 0.05 stablecoin sending (50000) | Requires stablecoin from test 2 |
267+
| 9 (Stablecoin→MXN acct) | 0.05 stablecoin sending (50000) | Requires stablecoin from test 2 |
268+
| 10 (Stablecoin→UMA RT) | $0.10 locked receiving (10 cents) | Requires valid UMA receiver |
256269
| 11 (USD→UMA acct) | $0.10 sending (10 cents) | Requires USD balance + valid UMA receiver |
257270

258-
**Total per chain: ~1.3-1.5 USDC + gas fees**
271+
**Total per chain: ~1.3-1.5 stablecoin units + gas fees**
259272

260273
## Credential Schema
261274

@@ -273,7 +286,9 @@ All tests use small amounts to conserve testnet funds:
273286
"polygonTestnetPrivateKey": "hex-private-key-with-or-without-0x",
274287
"polygonMainnetPrivateKey": "hex-private-key-with-or-without-0x",
275288
"ethereumTestnetPrivateKey": "hex-private-key-with-or-without-0x",
276-
"ethereumMainnetPrivateKey": "hex-private-key-with-or-without-0x"
289+
"ethereumMainnetPrivateKey": "hex-private-key-with-or-without-0x",
290+
"tronTestnetPrivateKey": "hex-private-key-with-or-without-0x",
291+
"tronMainnetPrivateKey": "hex-private-key-with-or-without-0x"
277292
}
278293
```
279294

0 commit comments

Comments
 (0)