@t2000/sdk 0.1.4 → 0.1.5

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 CHANGED
@@ -147,13 +147,18 @@ validateAddress('0x...'); // throws if invalid
147
147
 
148
148
  ## Gas Abstraction
149
149
 
150
- Gas is handled automatically with three strategies:
150
+ Every operation (send, save, borrow, repay, withdraw, swap) routes through a 3-step gas resolution chain via `executeWithGas()`. The agent never fails due to low gas if it has USDC or the Gas Station is reachable:
151
151
 
152
- 1. **Self-funded** uses the agent's SUI balance
153
- 2. **Auto-topup** — swaps $1 USDC → SUI when gas runs low (< 0.05 SUI)
154
- 3. **Sponsored** Gas Station fallback for bootstrapping (first 10 transactions)
152
+ | Step | Strategy | Condition | How it works |
153
+ |------|----------|-----------|--------------|
154
+ | 1 | **Self-funded** | SUI 0.05 | Uses the agent's own SUI for gas |
155
+ | 2 | **Auto-topup** | SUI < 0.05, USDC ≥ $2 | Swaps $1 USDC → SUI (swap is gas-sponsored), then self-funds |
156
+ | 3 | **Sponsored** | Steps 1 & 2 fail | Gas Station sponsors the full transaction |
157
+ | 4 | **Error** | All fail | Throws `INSUFFICIENT_GAS` |
155
158
 
156
- Every transaction result includes a `gasMethod` field indicating which strategy was used.
159
+ Every transaction result includes a `gasMethod` field (`'self-funded'` | `'auto-topup'` | `'sponsored'`) indicating which strategy was used.
160
+
161
+ **Architecture:** Each protocol operation (NAVI, Cetus, send) exposes a `buildXxxTx()` function that returns a `Transaction` without executing it. `executeWithGas()` then handles execution with the fallback chain. This separation ensures gas management is consistent across all operations.
157
162
 
158
163
  ## Configuration
159
164