Spaces:
Runtime error
Runtime error
Upload app.py
Browse filesfix. conversion to units from uint
app.py
CHANGED
|
@@ -148,12 +148,13 @@ if CDP_ENABLED:
|
|
| 148 |
|
| 149 |
for split in SPLITS:
|
| 150 |
split_amount = amount_usdc * (split["pct"] / 100)
|
|
|
|
|
|
|
| 151 |
|
| 152 |
# Transfer to recipient (use same network as x402)
|
| 153 |
-
# CDP SDK handles USDC decimals automatically
|
| 154 |
tx_hash = await sender.transfer(
|
| 155 |
to=split["wallet"],
|
| 156 |
-
amount=
|
| 157 |
token="usdc",
|
| 158 |
network=os.getenv("X402_NETWORK", "base-sepolia")
|
| 159 |
)
|
|
|
|
| 148 |
|
| 149 |
for split in SPLITS:
|
| 150 |
split_amount = amount_usdc * (split["pct"] / 100)
|
| 151 |
+
# Convert to USDC units (6 decimals)
|
| 152 |
+
usdc_units = int(split_amount * 1_000_000)
|
| 153 |
|
| 154 |
# Transfer to recipient (use same network as x402)
|
|
|
|
| 155 |
tx_hash = await sender.transfer(
|
| 156 |
to=split["wallet"],
|
| 157 |
+
amount=usdc_units,
|
| 158 |
token="usdc",
|
| 159 |
network=os.getenv("X402_NETWORK", "base-sepolia")
|
| 160 |
)
|