transfer method
Implementation
Future<bool> transfer(
{String? srcSpark,
String? dstMage,
String? dstSpark,
required int mana}) async =>
(await http
.patch(
u("/mage/transfer", {
if (srcSpark != null) "srcSpark": srcSpark,
if (dstMage != null) "dstMage": dstMage,
if (dstSpark != null) "dstSpark": dstSpark,
"mana": mana.toString()
}),
headers: h)
.then((v) {
String b = v.body;
try {
if (jsonDecode(b)["ok"] != true) {
throw b;
}
} catch (e) {
throw b;
}
return v;
}))
.statusCode ==
200;